From 9e39408ad26a3ebf66669adb4dca1f8193ab803a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 2 Apr 2026 20:32:11 +0000 Subject: [PATCH] Configurations: 'specification/servicefabric/resource-manager/Microsoft.ServiceFabric/ServiceFabric/tspconfig.yaml', API Version: 2026-03-01-preview, SDK Release Type: beta, and CommitSHA: 'a3fd1efe038ca9c4a0042c3ee3afe6b279079ff6' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6101247 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 305 +++++- .../README.md | 12 +- .../SAMPLE.md | 202 ++-- .../pom.xml | 10 +- .../servicefabric/ServiceFabricManager.java | 83 +- .../fluent/ApplicationTypeVersionsClient.java | 48 +- .../fluent/ApplicationTypesClient.java | 42 +- .../fluent/ApplicationsClient.java | 54 +- .../fluent/ClusterVersionsClient.java | 51 +- .../servicefabric/fluent/ClustersClient.java | 67 +- .../fluent/OperationsClient.java | 10 +- .../fluent/ServiceFabricManagementClient.java | 45 +- .../servicefabric/fluent/ServicesClient.java | 54 +- .../fluent/UnsupportedVmSizesClient.java | 71 ++ .../models/ApplicationResourceInner.java | 64 +- .../models/ApplicationResourceProperties.java | 20 +- .../ApplicationResourceUpdateProperties.java | 19 +- .../models/ApplicationTypeResourceInner.java | 25 +- .../ApplicationTypeResourceProperties.java | 10 +- .../ApplicationTypeVersionResourceInner.java | 25 +- ...licationTypeVersionResourceProperties.java | 18 +- .../ClusterCodeVersionsListResultInner.java | 52 +- .../fluent/models/ClusterInner.java | 32 +- .../fluent/models/ClusterProperties.java | 93 +- .../ClusterPropertiesUpdateParameters.java | 69 +- .../fluent/models/ClusterVersionDetails.java | 49 +- .../fluent/models/OperationResultInner.java | 74 +- .../fluent/models/ServiceResourceInner.java | 25 +- .../UpgradableVersionPathResultInner.java | 33 +- .../fluent/models/VMSizeResourceInner.java | 143 +++ .../fluent/models/package-info.java | 6 +- .../servicefabric/fluent/package-info.java | 6 +- .../ApplicationResourceImpl.java | 14 +- .../ApplicationTypeResourceImpl.java | 7 +- .../ApplicationTypeVersionResourceImpl.java | 7 +- .../ApplicationTypeVersionsClientImpl.java | 720 +++++-------- .../ApplicationTypeVersionsImpl.java | 10 +- .../ApplicationTypesClientImpl.java | 592 ++++------- .../implementation/ApplicationTypesImpl.java | 10 +- .../ApplicationsClientImpl.java | 817 ++++++--------- .../implementation/ApplicationsImpl.java | 10 +- .../ClusterCodeVersionsListResultImpl.java | 2 +- .../implementation/ClusterImpl.java | 18 +- .../ClusterVersionsClientImpl.java | 392 +++---- .../implementation/ClusterVersionsImpl.java | 34 +- .../implementation/ClustersClientImpl.java | 980 +++++++----------- .../implementation/ClustersImpl.java | 18 +- .../implementation/OperationResultImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 145 +-- .../implementation/OperationsImpl.java | 2 +- .../implementation/ResourceManagerUtils.java | 2 +- .../ServiceFabricManagementClientBuilder.java | 28 +- .../ServiceFabricManagementClientImpl.java | 124 ++- .../implementation/ServiceResourceImpl.java | 16 +- .../implementation/ServicesClientImpl.java | 869 ++++++---------- .../implementation/ServicesImpl.java | 10 +- .../UnsupportedVmSizesClientImpl.java | 346 +++++++ .../UnsupportedVmSizesImpl.java | 62 ++ .../UpgradableVersionPathResultImpl.java | 2 +- .../implementation/VMSizeResourceImpl.java | 50 + .../models/ApplicationResourceList.java | 42 +- .../models/ApplicationTypeResourceList.java | 42 +- .../ApplicationTypeVersionResourceList.java | 42 +- .../models/ClusterListResult.java | 54 +- .../models/OperationListResult.java | 33 +- .../models/ServiceResourceList.java | 42 +- .../implementation/models/VMSizesResult.java | 96 ++ .../implementation/package-info.java | 6 +- .../servicefabric/models/AddOnFeatures.java | 10 +- .../models/ApplicationDeltaHealthPolicy.java | 20 +- .../models/ApplicationHealthPolicy.java | 20 +- .../models/ApplicationMetricDescription.java | 10 +- .../models/ApplicationResource.java | 49 +- .../models/ApplicationResourceUpdate.java | 25 +- .../models/ApplicationTypeResource.java | 36 +- .../ApplicationTypeVersionResource.java | 38 +- .../models/ApplicationTypeVersions.java | 48 +- .../ApplicationTypeVersionsCleanupPolicy.java | 12 +- .../models/ApplicationTypes.java | 42 +- .../models/ApplicationUpgradePolicy.java | 16 +- .../ApplicationUserAssignedIdentity.java | 25 +- .../servicefabric/models/Applications.java | 42 +- .../models/ArmApplicationHealthPolicy.java | 20 +- .../ArmRollingUpgradeMonitoringPolicy.java | 75 +- .../ArmServicePackageActivationMode.java | 6 +- .../models/ArmServiceTypeHealthPolicy.java | 10 +- .../models/ArmUpgradeFailureAction.java | 7 +- .../models/AvailableOperationDisplay.java | 60 +- .../models/AzureActiveDirectory.java | 10 +- .../models/CertificateDescription.java | 18 +- .../models/ClientCertificateCommonName.java | 23 +- .../models/ClientCertificateThumbprint.java | 18 +- .../servicefabric/models/Cluster.java | 67 +- .../models/ClusterCodeVersionsListResult.java | 6 +- .../models/ClusterCodeVersionsResult.java | 94 +- .../models/ClusterEnvironment.java | 6 +- .../models/ClusterHealthPolicy.java | 17 +- .../servicefabric/models/ClusterState.java | 45 +- .../models/ClusterUpdateParameters.java | 28 +- .../models/ClusterUpgradeCadence.java | 8 +- .../ClusterUpgradeDeltaHealthPolicy.java | 17 +- .../models/ClusterUpgradePolicy.java | 53 +- .../servicefabric/models/ClusterVersions.java | 51 +- .../models/ClusterVersionsEnvironment.java | 8 +- .../servicefabric/models/Clusters.java | 63 +- .../DiagnosticsStorageAccountConfig.java | 38 +- .../servicefabric/models/DurabilityLevel.java | 14 +- .../models/EndpointRangeDescription.java | 10 +- .../servicefabric/models/ManagedIdentity.java | 17 +- .../models/ManagedIdentityType.java | 10 +- .../servicefabric/models/MoveCost.java | 10 +- .../NamedPartitionSchemeDescription.java | 19 +- .../models/NodeTypeDescription.java | 47 +- .../servicefabric/models/Notification.java | 29 +- .../models/NotificationCategory.java | 4 +- .../models/NotificationChannel.java | 8 +- .../models/NotificationLevel.java | 6 +- .../models/NotificationTarget.java | 22 +- .../servicefabric/models/OperationResult.java | 2 +- .../servicefabric/models/Operations.java | 10 +- .../servicefabric/models/PartitionScheme.java | 14 +- .../models/PartitionSchemeDescription.java | 10 +- .../models/ProvisioningState.java | 10 +- .../models/ReliabilityLevel.java | 18 +- .../models/RollingUpgradeMode.java | 12 +- .../models/ServerCertificateCommonName.java | 23 +- .../models/ServerCertificateCommonNames.java | 13 +- .../models/ServiceCorrelationDescription.java | 29 +- .../models/ServiceCorrelationScheme.java | 13 +- .../servicefabric/models/ServiceKind.java | 8 +- .../models/ServiceLoadMetricDescription.java | 18 +- .../models/ServiceLoadMetricWeight.java | 10 +- .../ServicePlacementPolicyDescription.java | 10 +- .../models/ServicePlacementPolicyType.java | 25 +- .../servicefabric/models/ServiceResource.java | 42 +- .../models/ServiceResourceProperties.java | 44 +- .../models/ServiceResourcePropertiesBase.java | 19 +- .../models/ServiceResourceUpdate.java | 31 +- .../ServiceResourceUpdateProperties.java | 20 +- .../models/ServiceTypeDeltaHealthPolicy.java | 10 +- .../models/ServiceTypeHealthPolicy.java | 10 +- .../servicefabric/models/Services.java | 42 +- .../models/SettingsParameterDescription.java | 23 +- .../models/SettingsSectionDescription.java | 25 +- .../models/SfZonalUpgradeMode.java | 11 +- .../SingletonPartitionSchemeDescription.java | 13 +- .../models/StatefulServiceProperties.java | 23 +- .../StatefulServiceUpdateProperties.java | 20 +- .../models/StatelessServiceProperties.java | 104 +- .../StatelessServiceUpdateProperties.java | 30 +- .../servicefabric/models/StoreName.java | 18 +- ...mInt64RangePartitionSchemeDescription.java | 24 +- .../models/UnsupportedVmSizes.java | 64 ++ .../models/UpgradableVersionPathResult.java | 4 +- .../models/UpgradableVersionsDescription.java | 20 +- .../servicefabric/models/UpgradeMode.java | 8 +- .../models/UserAssignedIdentity.java | 12 +- .../servicefabric/models/VMSize.java | 73 ++ .../servicefabric/models/VMSizeResource.java | 55 + .../models/VmssZonalUpgradeMode.java | 8 +- .../servicefabric/models/package-info.java | 6 +- .../servicefabric/package-info.java | 6 +- .../src/main/java/module-info.java | 3 +- ...esourcemanager-servicefabric_metadata.json | 1 + .../proxy-config.json | 2 +- ...e-resourcemanager-servicefabric.properties | 1 + ...tionTypeVersionsCreateOrUpdateSamples.java | 6 +- .../ApplicationTypeVersionsDeleteSamples.java | 6 +- .../ApplicationTypeVersionsGetSamples.java | 6 +- .../ApplicationTypeVersionsListSamples.java | 6 +- ...ApplicationTypesCreateOrUpdateSamples.java | 6 +- .../ApplicationTypesDeleteSamples.java | 6 +- .../generated/ApplicationTypesGetSamples.java | 6 +- .../ApplicationTypesListSamples.java | 6 +- .../ApplicationsCreateOrUpdateSamples.java | 14 +- .../generated/ApplicationsDeleteSamples.java | 6 +- .../generated/ApplicationsGetSamples.java | 6 +- .../generated/ApplicationsListSamples.java | 6 +- .../generated/ApplicationsUpdateSamples.java | 6 +- ...lusterVersionsGetByEnvironmentSamples.java | 6 +- .../generated/ClusterVersionsGetSamples.java | 6 +- ...usterVersionsListByEnvironmentSamples.java | 6 +- .../generated/ClusterVersionsListSamples.java | 6 +- .../ClustersCreateOrUpdateSamples.java | 14 +- .../generated/ClustersDeleteSamples.java | 6 +- .../ClustersGetByResourceGroupSamples.java | 6 +- .../ClustersListByResourceGroupSamples.java | 6 +- .../generated/ClustersListSamples.java | 6 +- ...ClustersListUpgradableVersionsSamples.java | 10 +- .../generated/ClustersUpdateSamples.java | 13 +- .../generated/OperationsListSamples.java | 10 +- .../ServicesCreateOrUpdateSamples.java | 10 +- .../generated/ServicesDeleteSamples.java | 6 +- .../generated/ServicesGetSamples.java | 6 +- .../generated/ServicesListSamples.java | 6 +- .../generated/ServicesUpdateSamples.java | 6 +- .../UnsupportedVmSizesGetSamples.java | 22 + .../UnsupportedVmSizesListSamples.java | 22 + .../ApplicationDeltaHealthPolicyTests.java | 23 +- .../ApplicationHealthPolicyTests.java | 24 +- .../ApplicationMetricDescriptionTests.java | 28 +- .../ApplicationResourceInnerTests.java | 267 ++--- .../ApplicationResourceListTests.java | 230 +--- .../ApplicationResourcePropertiesTests.java | 219 ++-- ...licationResourceUpdatePropertiesTests.java | 228 ++-- .../ApplicationResourceUpdateTests.java | 220 ++-- .../ApplicationTypeResourceInnerTests.java | 14 +- .../ApplicationTypeResourceListTests.java | 40 +- ...pplicationTypeResourcePropertiesTests.java | 4 +- ...licationTypeVersionResourceInnerTests.java | 23 +- ...plicationTypeVersionResourceListTests.java | 52 +- ...ionTypeVersionResourcePropertiesTests.java | 10 +- ...icationTypeVersionsCleanupPolicyTests.java | 10 +- ...nTypeVersionsGetWithResponseMockTests.java | 16 +- .../ApplicationTypeVersionsListMockTests.java | 16 +- ...esCreateOrUpdateWithResponseMockTests.java | 20 +- ...licationTypesGetWithResponseMockTests.java | 14 +- .../ApplicationTypesListMockTests.java | 14 +- .../ApplicationUpgradePolicyTests.java | 136 +-- .../ApplicationUserAssignedIdentityTests.java | 17 +- .../ApplicationsGetWithResponseMockTests.java | 66 +- .../generated/ApplicationsListMockTests.java | 71 +- .../ArmApplicationHealthPolicyTests.java | 84 +- ...rmRollingUpgradeMonitoringPolicyTests.java | 34 +- .../ArmServiceTypeHealthPolicyTests.java | 22 +- .../AvailableOperationDisplayTests.java | 25 +- .../generated/AzureActiveDirectoryTests.java | 25 +- .../CertificateDescriptionTests.java | 22 +- .../ClientCertificateCommonNameTests.java | 23 +- .../ClientCertificateThumbprintTests.java | 14 +- .../generated/ClusterHealthPolicyTests.java | 62 +- .../ClusterUpgradeDeltaHealthPolicyTests.java | 90 +- .../generated/ClusterUpgradePolicyTests.java | 186 ++-- ...eByResourceGroupWithResponseMockTests.java | 9 +- ...gradableVersionsWithResponseMockTests.java | 15 +- .../EndpointRangeDescriptionTests.java | 14 +- .../generated/ManagedIdentityTests.java | 6 +- .../NamedPartitionSchemeDescriptionTests.java | 21 +- .../generated/NodeTypeDescriptionTests.java | 82 -- .../generated/NotificationTargetTests.java | 12 +- .../generated/NotificationTests.java | 27 +- .../generated/OperationListResultTests.java | 56 +- .../generated/OperationResultInnerTests.java | 42 +- .../generated/OperationsListMockTests.java | 24 +- .../PartitionSchemeDescriptionTests.java | 2 +- .../ServerCertificateCommonNameTests.java | 18 +- .../ServerCertificateCommonNamesTests.java | 27 +- .../ServiceCorrelationDescriptionTests.java | 16 +- .../ServiceLoadMetricDescriptionTests.java | 34 +- ...ervicePlacementPolicyDescriptionTests.java | 2 +- .../generated/ServiceResourceInnerTests.java | 112 +- .../generated/ServiceResourceListTests.java | 144 +-- .../ServiceResourcePropertiesBaseTests.java | 68 +- .../ServiceResourcePropertiesTests.java | 87 +- .../ServiceResourceUpdatePropertiesTests.java | 93 +- .../generated/ServiceResourceUpdateTests.java | 104 +- .../ServiceTypeDeltaHealthPolicyTests.java | 10 +- .../ServiceTypeHealthPolicyTests.java | 10 +- .../ServicesGetWithResponseMockTests.java | 37 +- .../generated/ServicesListMockTests.java | 34 +- .../SettingsParameterDescriptionTests.java | 17 +- .../SettingsSectionDescriptionTests.java | 26 +- ...gletonPartitionSchemeDescriptionTests.java | 2 +- .../StatefulServicePropertiesTests.java | 117 +-- .../StatefulServiceUpdatePropertiesTests.java | 106 +- .../StatelessServicePropertiesTests.java | 115 +- ...StatelessServiceUpdatePropertiesTests.java | 77 +- ...portedVmSizesGetWithResponseMockTests.java | 37 + .../UnsupportedVmSizesListMockTests.java | 37 + ...UpgradableVersionPathResultInnerTests.java | 15 +- .../UpgradableVersionsDescriptionTests.java | 12 +- .../generated/UserAssignedIdentityTests.java | 7 +- .../generated/VMSizeResourceInnerTests.java | 17 + .../servicefabric/generated/VMSizeTests.java | 15 + .../generated/VMSizesResultTests.java | 19 + .../tsp-location.yaml | 4 + 276 files changed, 6645 insertions(+), 7489 deletions(-) create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/UnsupportedVmSizesClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/VMSizeResourceInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/VMSizeResourceImpl.java rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/ApplicationResourceList.java (72%) rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/ApplicationTypeResourceList.java (72%) rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/ApplicationTypeVersionResourceList.java (72%) rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/ClusterListResult.java (65%) rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/OperationListResult.java (78%) rename sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/{ => implementation}/models/ServiceResourceList.java (72%) create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/VMSizesResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UnsupportedVmSizes.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSize.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSizeResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/azure-resourcemanager-servicefabric_metadata.json create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/azure-resourcemanager-servicefabric.properties create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetSamples.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListSamples.java delete mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NodeTypeDescriptionTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetWithResponseMockTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListMockTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeResourceInnerTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizesResultTests.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/tsp-location.yaml diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md index 053c5aa8b93e..b858d6ba91f4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md @@ -1,14 +1,311 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-04-02) -### Features Added +- Azure Resource Manager Service Fabric client library for Java. This package contains Microsoft Azure SDK for Service Fabric Management SDK. Azure Service Fabric Resource Provider API Client. Package api-version 2026-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ServiceResourceList` was removed + +#### `models.ClusterListResult` was removed + +#### `models.ApplicationTypeResourceList` was removed + +#### `models.ApplicationTypeVersionResourceList` was removed + +#### `models.OperationListResult` was removed + +#### `models.ApplicationResourceList` was removed + +#### `models.StatefulServiceProperties` was modified + +* `validate()` was removed + +#### `models.SettingsSectionDescription` was modified + +* `validate()` was removed + +#### `models.ManagedIdentity` was modified + +* `validate()` was removed + +#### `models.SingletonPartitionSchemeDescription` was modified + +* `validate()` was removed + +#### `models.ServiceCorrelationDescription` was modified + +* `validate()` was removed + +#### `models.UpgradableVersionsDescription` was modified + +* `validate()` was removed + +#### `models.AzureActiveDirectory` was modified + +* `validate()` was removed + +#### `models.ServiceTypeDeltaHealthPolicy` was modified + +* `validate()` was removed + +#### `models.StatelessServiceProperties` was modified + +* `validate()` was removed + +#### `models.ServiceLoadMetricDescription` was modified + +* `validate()` was removed + +#### `models.ApplicationResourceUpdate` was modified + +* `validate()` was removed + +#### `models.ApplicationDeltaHealthPolicy` was modified + +* `validate()` was removed + +#### `models.StatefulServiceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.ArmServiceTypeHealthPolicy` was modified + +* `validate()` was removed + +#### `models.ClusterHealthPolicy` was modified + +* `validate()` was removed + +#### `models.NotificationTarget` was modified + +* `validate()` was removed + +#### `models.ClusterUpdateParameters` was modified + +* `validate()` was removed + +#### `models.ServiceResourceUpdate` was modified + +* `validate()` was removed + +#### `models.AvailableOperationDisplay` was modified + +* `AvailableOperationDisplay()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed + +#### `models.NodeTypeDescription` was modified + +* `validate()` was removed + +#### `models.ApplicationHealthPolicy` was modified + +* `validate()` was removed + +#### `models.ClusterCodeVersionsResult` was modified + +* `ClusterCodeVersionsResult()` was changed to private access +* `withSupportExpiryUtc(java.lang.String)` was removed +* `withId(java.lang.String)` was removed +* `withCodeVersion(java.lang.String)` was removed +* `withName(java.lang.String)` was removed +* `validate()` was removed +* `withType(java.lang.String)` was removed +* `withEnvironment(models.ClusterEnvironment)` was removed + +#### `models.ApplicationUpgradePolicy` was modified + +* `validate()` was removed + +#### `models.SettingsParameterDescription` was modified + +* `validate()` was removed + +#### `models.ApplicationMetricDescription` was modified + +* `validate()` was removed + +#### `models.CertificateDescription` was modified + +* `validate()` was removed + +#### `models.NamedPartitionSchemeDescription` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.ClientCertificateCommonName` was modified + +* `validate()` was removed + +#### `models.DiagnosticsStorageAccountConfig` was modified + +* `validate()` was removed + +#### `models.ArmRollingUpgradeMonitoringPolicy` was modified + +* `validate()` was removed + +#### `models.ServiceResourceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.ApplicationUserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.ServiceTypeHealthPolicy` was modified + +* `validate()` was removed + +#### `models.PartitionSchemeDescription` was modified + +* `validate()` was removed + +#### `models.ServerCertificateCommonName` was modified + +* `validate()` was removed + +#### `models.ServerCertificateCommonNames` was modified + +* `validate()` was removed + +#### `models.ClientCertificateThumbprint` was modified + +* `validate()` was removed + +#### `models.ServiceResourcePropertiesBase` was modified + +* `validate()` was removed + +#### `models.ClusterUpgradePolicy` was modified + +* `validate()` was removed + +#### `models.UniformInt64RangePartitionSchemeDescription` was modified + +* `validate()` was removed + +#### `models.ArmApplicationHealthPolicy` was modified + +* `validate()` was removed + +#### `models.Notification` was modified + +* `validate()` was removed + +#### `models.ServiceResourceProperties` was modified + +* `validate()` was removed + +#### `models.ApplicationTypeVersionsCleanupPolicy` was modified + +* `validate()` was removed + +#### `models.StatelessServiceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.EndpointRangeDescription` was modified + +* `validate()` was removed + +#### `models.ServicePlacementPolicyDescription` was modified + +* `validate()` was removed + +#### `models.ClusterUpgradeDeltaHealthPolicy` was modified + +* `validate()` was removed + +### Features Added + +* `models.VMSizeResource` was added + +* `models.UnsupportedVmSizes` was added + +* `models.VMSize` was added + +#### `models.Cluster$Definition` was modified + +* `withEnableHttpGatewayExclusiveAuthMode(java.lang.Boolean)` was added + +#### `models.StatelessServiceProperties` was modified + +* `withMinInstanceCount(java.lang.Integer)` was added +* `minInstancePercentage()` was added +* `withMinInstancePercentage(byte[])` was added +* `minInstanceCount()` was added + +#### `models.ApplicationResourceUpdate` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ApplicationResource$Definition` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ApplicationTypeResource$Definition` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.Cluster$Update` was modified + +* `withEnableHttpGatewayExclusiveAuthMode(java.lang.Boolean)` was added + +#### `models.ServiceResource$Definition` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ClusterUpdateParameters` was modified + +* `withEnableHttpGatewayExclusiveAuthMode(java.lang.Boolean)` was added +* `enableHttpGatewayExclusiveAuthMode()` was added + +#### `models.ServiceResourceUpdate` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ApplicationTypeResource$Update` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.NodeTypeDescription` was modified + +* `httpGatewayTokenAuthEndpointPort()` was added +* `withHttpGatewayTokenAuthEndpointPort(java.lang.Integer)` was added + +#### `models.Cluster` was modified + +* `enableHttpGatewayExclusiveAuthMode()` was added + +#### `models.ApplicationResource$Update` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ApplicationTypeVersionResource$Definition` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `models.ServiceResource$Update` was modified + +* `withSystemData(com.azure.core.management.SystemData)` was added + +#### `ServiceFabricManager` was modified + +* `unsupportedVmSizes()` was added + +#### `models.ApplicationTypeVersionResource$Update` was modified -### Other Changes +* `withSystemData(com.azure.core.management.SystemData)` was added ## 1.0.0 (2024-12-24) diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md index 7256b0126114..643e6c5d891f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager ServiceFabric client library for Java +# Azure Resource Manager Service Fabric client library for Java -Azure Resource Manager ServiceFabric client library for Java. +Azure Resource Manager Service Fabric client library for Java. -This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Service Fabric Management SDK. Azure Service Fabric Resource Provider API Client. Package api-version 2026-03-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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ ServiceFabricManager manager = ServiceFabricManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/SAMPLE.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/SAMPLE.md index b09c32aec6e2..8ee789e5147f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/SAMPLE.md +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/SAMPLE.md @@ -51,6 +51,11 @@ - [Get](#services_get) - [List](#services_list) - [Update](#services_update) + +## UnsupportedVmSizes + +- [Get](#unsupportedvmsizes_get) +- [List](#unsupportedvmsizes_list) ### ApplicationTypeVersions_CreateOrUpdate ```java @@ -62,9 +67,7 @@ import java.util.Map; */ public final class ApplicationTypeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionPutOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionPutOperation_example.json */ /** * Sample code: Put an application type version. @@ -103,9 +106,7 @@ public final class ApplicationTypeVersionsCreateOrUpdateSamples { */ public final class ApplicationTypeVersionsDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionDeleteOperation_example.json */ /** * Sample code: Delete an application type version. @@ -128,9 +129,7 @@ public final class ApplicationTypeVersionsDeleteSamples { */ public final class ApplicationTypeVersionsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionGetOperation_example.json */ /** * Sample code: Get an application type version. @@ -153,9 +152,7 @@ public final class ApplicationTypeVersionsGetSamples { */ public final class ApplicationTypeVersionsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionListOperation_example.json */ /** * Sample code: Get a list of application type version resources. @@ -180,9 +177,7 @@ import java.util.Map; */ public final class ApplicationTypesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNamePutOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNamePutOperation_example.json */ /** * Sample code: Put an application type. @@ -219,9 +214,7 @@ public final class ApplicationTypesCreateOrUpdateSamples { */ public final class ApplicationTypesDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameDeleteOperation_example.json */ /** * Sample code: Delete an application type. @@ -242,9 +235,7 @@ public final class ApplicationTypesDeleteSamples { */ public final class ApplicationTypesGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameGetOperation_example.json */ /** * Sample code: Get an application type. @@ -265,9 +256,7 @@ public final class ApplicationTypesGetSamples { */ public final class ApplicationTypesListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameListOperation_example.json */ /** * Sample code: Get a list of application type name resources. @@ -300,9 +289,7 @@ import java.util.Map; */ public final class ApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_example_max.json */ /** * Sample code: Put an application with maximum parameters. @@ -345,9 +332,7 @@ public final class ApplicationsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_example_min.json */ /** * Sample code: Put an application with minimum parameters. @@ -368,9 +353,7 @@ public final class ApplicationsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_recreate_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_recreate_example.json */ /** * Sample code: Put an application with recreate option. @@ -412,9 +395,7 @@ public final class ApplicationsCreateOrUpdateSamples { */ public final class ApplicationsDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationDeleteOperation_example.json */ /** * Sample code: Delete an application. @@ -435,9 +416,7 @@ public final class ApplicationsDeleteSamples { */ public final class ApplicationsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationGetOperation_example.json */ /** * Sample code: Get an application. @@ -458,9 +437,7 @@ public final class ApplicationsGetSamples { */ public final class ApplicationsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationListOperation_example.json */ /** * Sample code: Get a list of application resources. @@ -486,9 +463,7 @@ import java.util.Arrays; */ public final class ApplicationsUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPatchOperation_example.json */ /** * Sample code: Patch an application. @@ -519,9 +494,7 @@ public final class ApplicationsUpdateSamples { */ public final class ClusterVersionsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsGet_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsGet_example.json */ /** * Sample code: Get cluster version. @@ -544,9 +517,7 @@ import com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment */ public final class ClusterVersionsGetByEnvironmentSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsGetByEnvironment_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsGetByEnvironment_example.json */ /** * Sample code: Get cluster version by environment. @@ -570,9 +541,7 @@ public final class ClusterVersionsGetByEnvironmentSamples { */ public final class ClusterVersionsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsList_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsList_example.json */ /** * Sample code: List cluster versions. @@ -595,9 +564,7 @@ import com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment */ public final class ClusterVersionsListByEnvironmentSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsListByEnvironment.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsListByEnvironment.json */ /** * Sample code: List cluster versions by environment. @@ -657,9 +624,7 @@ import java.util.Map; */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ClusterPutOperation_example_max.json */ /** * Sample code: Put a cluster with maximum parameters. @@ -707,7 +672,8 @@ public final class ClustersCreateOrUpdateSamples { .withIsPrimary(true) .withVmInstanceCount(5) .withIsStateless(false) - .withMultipleAvailabilityZones(true))) + .withMultipleAvailabilityZones(true) + .withHttpGatewayTokenAuthEndpointPort(19081))) .withReliabilityLevel(ReliabilityLevel.PLATINUM) .withReverseProxyCertificateCommonNames(new ServerCertificateCommonNames() .withCommonNames(Arrays.asList(new ServerCertificateCommonName().withCertificateCommonName("abc.com") @@ -764,13 +730,12 @@ public final class ClustersCreateOrUpdateSamples { .withReceivers(Arrays.asList("****@microsoft.com", "****@microsoft.com")), new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_SUBSCRIPTION) .withReceivers(Arrays.asList("Owner", "AccountAdmin")))))) + .withEnableHttpGatewayExclusiveAuthMode(true) .create(); } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ClusterPutOperation_example_min.json */ /** * Sample code: Put a cluster with minimum parameters. @@ -828,9 +793,7 @@ public final class ClustersCreateOrUpdateSamples { */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterDeleteOperation_example.json */ /** * Sample code: Delete a cluster. @@ -851,9 +814,7 @@ public final class ClustersDeleteSamples { */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterGetOperation_example.json */ /** * Sample code: Get a cluster. @@ -874,9 +835,7 @@ public final class ClustersGetByResourceGroupSamples { */ public final class ClustersListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterListOperation_example.json */ /** * Sample code: List clusters. @@ -897,9 +856,7 @@ public final class ClustersListSamples { */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterListByResourceGroupOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterListByResourceGroupOperation_example.json */ /** * Sample code: List cluster by resource group. @@ -923,9 +880,7 @@ import com.azure.resourcemanager.servicefabric.models.UpgradableVersionsDescript */ public final class ClustersListUpgradableVersionsSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ListUpgradableVersionsMinMax_example.json + * x-ms-original-file: 2026-03-01-preview/ListUpgradableVersionsMinMax_example.json */ /** * Sample code: Get minimum and maximum code versions. @@ -939,9 +894,7 @@ public final class ClustersListUpgradableVersionsSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ListUpgradableVersionsPath_example.json + * x-ms-original-file: 2026-03-01-preview/ListUpgradableVersionsPath_example.json */ /** * Sample code: Get upgrade path. @@ -977,9 +930,7 @@ import java.util.Map; */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterPatchOperation_example.json */ /** * Sample code: Patch a cluster. @@ -1004,7 +955,8 @@ public final class ClustersUpdateSamples { new EndpointRangeDescription().withStartPort(20000).withEndPort(30000)) .withEphemeralPorts(new EndpointRangeDescription().withStartPort(49000).withEndPort(64000)) .withIsPrimary(true) - .withVmInstanceCount(5), + .withVmInstanceCount(5) + .withHttpGatewayTokenAuthEndpointPort(19081), new NodeTypeDescription().withName("testnt1") .withClientConnectionEndpointPort(0) .withHttpGatewayEndpointPort(0) @@ -1012,12 +964,14 @@ public final class ClustersUpdateSamples { .withApplicationPorts(new EndpointRangeDescription().withStartPort(1000).withEndPort(2000)) .withEphemeralPorts(new EndpointRangeDescription().withStartPort(3000).withEndPort(4000)) .withIsPrimary(false) - .withVmInstanceCount(3))) + .withVmInstanceCount(3) + .withHttpGatewayTokenAuthEndpointPort(19081))) .withReliabilityLevel(ReliabilityLevel.BRONZE) .withUpgradeMode(UpgradeMode.AUTOMATIC) .withUpgradeWave(ClusterUpgradeCadence.fromString("Wave")) .withUpgradePauseStartTimestampUtc(OffsetDateTime.parse("2021-06-21T22:00:00Z")) .withUpgradePauseEndTimestampUtc(OffsetDateTime.parse("2021-06-25T22:00:00Z")) + .withEnableHttpGatewayExclusiveAuthMode(true) .apply(); } @@ -1043,16 +997,14 @@ public final class ClustersUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListOperations. - * json + * x-ms-original-file: 2026-03-01-preview/Operations_example.json */ /** - * Sample code: ListOperations. + * Sample code: List available operations. * * @param manager Entry point to ServiceFabricManager. */ - public static void listOperations(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + public static void listAvailableOperations(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } @@ -1078,9 +1030,7 @@ import java.util.Map; */ public final class ServicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ServicePutOperation_example_min.json */ /** * Sample code: Put a service with minimum parameters. @@ -1100,9 +1050,7 @@ public final class ServicesCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ServicePutOperation_example_max.json */ /** * Sample code: Put a service with maximum parameters. @@ -1153,9 +1101,7 @@ public final class ServicesCreateOrUpdateSamples { */ public final class ServicesDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceDeleteOperation_example.json */ /** * Sample code: Delete a service. @@ -1176,9 +1122,7 @@ public final class ServicesDeleteSamples { */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceGetOperation_example.json */ /** * Sample code: Get a service. @@ -1200,9 +1144,7 @@ public final class ServicesGetSamples { */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceListOperation_example.json */ /** * Sample code: Get a list of service resources. @@ -1230,9 +1172,7 @@ import java.util.Arrays; */ public final class ServicesUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServicePatchOperation_example.json */ /** * Sample code: Patch a service. @@ -1251,3 +1191,45 @@ public final class ServicesUpdateSamples { } ``` +### UnsupportedVmSizes_Get + +```java +/** + * Samples for UnsupportedVmSizes Get. + */ +public final class UnsupportedVmSizesGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/UnsupportedVMSizesGet_example.json + */ + /** + * Sample code: Get unsupported vm sizes. + * + * @param manager Entry point to ServiceFabricManager. + */ + public static void getUnsupportedVmSizes(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + manager.unsupportedVmSizes().getWithResponse("eastus", "Standard_B1ls1", com.azure.core.util.Context.NONE); + } +} +``` + +### UnsupportedVmSizes_List + +```java +/** + * Samples for UnsupportedVmSizes List. + */ +public final class UnsupportedVmSizesListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/UnsupportedVMSizesList_example.json + */ + /** + * Sample code: List unsupported vm sizes. + * + * @param manager Entry point to ServiceFabricManager. + */ + public static void listUnsupportedVmSizes(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + manager.unsupportedVmSizes().list("eastus", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml index 23000e8cb54e..922be6252d9c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -17,8 +17,8 @@ 1.1.0-beta.1 jar - Microsoft Azure SDK for ServiceFabric Management - This package contains Microsoft Azure SDK for ServiceFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Management Client. Package tag package-2021-06. + Microsoft Azure SDK for Service Fabric Management + This package contains Microsoft Azure SDK for Service Fabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Service Fabric Resource Provider API Client. Package api-version 2026-03-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java index 49e2ec769582..83d6b767e8c5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric; @@ -22,6 +22,7 @@ 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.servicefabric.fluent.ServiceFabricManagementClient; import com.azure.resourcemanager.servicefabric.implementation.ApplicationTypeVersionsImpl; @@ -32,6 +33,7 @@ import com.azure.resourcemanager.servicefabric.implementation.OperationsImpl; import com.azure.resourcemanager.servicefabric.implementation.ServiceFabricManagementClientBuilder; import com.azure.resourcemanager.servicefabric.implementation.ServicesImpl; +import com.azure.resourcemanager.servicefabric.implementation.UnsupportedVmSizesImpl; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersions; import com.azure.resourcemanager.servicefabric.models.ApplicationTypes; import com.azure.resourcemanager.servicefabric.models.Applications; @@ -39,23 +41,25 @@ import com.azure.resourcemanager.servicefabric.models.Clusters; import com.azure.resourcemanager.servicefabric.models.Operations; import com.azure.resourcemanager.servicefabric.models.Services; +import com.azure.resourcemanager.servicefabric.models.UnsupportedVmSizes; 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 ServiceFabricManager. - * Service Fabric Management Client. + * Azure Service Fabric Resource Provider API Client. */ public final class ServiceFabricManager { + private Operations operations; + private Clusters clusters; - private ClusterVersions clusterVersions; - - private Operations operations; + private UnsupportedVmSizes unsupportedVmSizes; private ApplicationTypes applicationTypes; @@ -65,6 +69,8 @@ public final class ServiceFabricManager { private Services services; + private ClusterVersions clusterVersions; + private final ServiceFabricManagementClient clientObject; private ServiceFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -78,11 +84,11 @@ private ServiceFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Du } /** - * Creates an instance of ServiceFabric service API entry point. + * Creates an instance of Service Fabric service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the ServiceFabric service API instance. + * @return the Service Fabric service API instance. */ public static ServiceFabricManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -91,11 +97,11 @@ public static ServiceFabricManager authenticate(TokenCredential credential, Azur } /** - * Creates an instance of ServiceFabric service API entry point. + * Creates an instance of Service Fabric service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the ServiceFabric service API instance. + * @return the Service Fabric service API instance. */ public static ServiceFabricManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -117,6 +123,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-servicefabric.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -214,22 +223,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of ServiceFabric service API entry point. + * Creates an instance of Service Fabric service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the ServiceFabric service API instance. + * @return the Service Fabric service API instance. */ public ServiceFabricManager 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.servicefabric") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -276,39 +287,39 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of Operations. * - * @return Resource collection API of Clusters. + * @return Resource collection API of Operations. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return clusters; + return operations; } /** - * Gets the resource collection API of ClusterVersions. + * Gets the resource collection API of Clusters. It manages Cluster. * - * @return Resource collection API of ClusterVersions. + * @return Resource collection API of Clusters. */ - public ClusterVersions clusterVersions() { - if (this.clusterVersions == null) { - this.clusterVersions = new ClusterVersionsImpl(clientObject.getClusterVersions(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return clusterVersions; + return clusters; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of UnsupportedVmSizes. * - * @return Resource collection API of Operations. + * @return Resource collection API of UnsupportedVmSizes. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public UnsupportedVmSizes unsupportedVmSizes() { + if (this.unsupportedVmSizes == null) { + this.unsupportedVmSizes = new UnsupportedVmSizesImpl(clientObject.getUnsupportedVmSizes(), this); } - return operations; + return unsupportedVmSizes; } /** @@ -360,6 +371,18 @@ public Services services() { return services; } + /** + * Gets the resource collection API of ClusterVersions. + * + * @return Resource collection API of ClusterVersions. + */ + public ClusterVersions clusterVersions() { + if (this.clusterVersions == null) { + this.clusterVersions = new ClusterVersionsImpl(clientObject.getClusterVersions(), this); + } + return clusterVersions; + } + /** * Gets wrapped service client ServiceFabricManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java index 0395751b87e8..f6fb866f75cd 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -23,7 +23,7 @@ public interface ApplicationTypeVersionsClient { * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -31,8 +31,10 @@ public interface ApplicationTypeVersionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String clusterName, @@ -44,15 +46,17 @@ Response getWithResponse(String resourceGro * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ApplicationTypeVersionResourceInner get(String resourceGroupName, String clusterName, String applicationTypeName, @@ -63,7 +67,7 @@ ApplicationTypeVersionResourceInner get(String resourceGroupName, String cluster * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -84,7 +88,7 @@ ApplicationTypeVersionResourceInner get(String resourceGroupName, String cluster * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -106,7 +110,7 @@ ApplicationTypeVersionResourceInner get(String resourceGroupName, String cluster * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -125,7 +129,7 @@ ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupName, Str * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -145,7 +149,7 @@ ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupName, Str * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -163,7 +167,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -182,7 +186,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -198,7 +202,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -218,13 +222,16 @@ void delete(String resourceGroupName, String clusterName, String applicationType * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -238,14 +245,17 @@ PagedIterable list(String resourceGroupName * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java index 41605332ecd7..7dd5f57b45fa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -23,14 +23,16 @@ public interface ApplicationTypesClient { * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -43,13 +45,15 @@ Response getWithResponse(String resourceGroupName, * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -60,7 +64,7 @@ Response getWithResponse(String resourceGroupName, * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -79,7 +83,7 @@ Response createOrUpdateWithResponse(String resourc * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -97,7 +101,7 @@ ApplicationTypeResourceInner createOrUpdate(String resourceGroupName, String clu * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -114,7 +118,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. @@ -132,7 +136,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -147,7 +151,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. @@ -164,13 +168,15 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName); @@ -181,14 +187,16 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java index 4431c088161c..942773c3b368 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -24,14 +24,16 @@ public interface ApplicationsClient { * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -44,13 +46,15 @@ Response getWithResponse(String resourceGroupName, Str * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -61,7 +65,7 @@ Response getWithResponse(String resourceGroupName, Str * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -79,7 +83,7 @@ SyncPoller, ApplicationResourceInner> begin * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -99,7 +103,7 @@ SyncPoller, ApplicationResourceInner> begin * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -117,7 +121,7 @@ ApplicationResourceInner createOrUpdate(String resourceGroupName, String cluster * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -136,7 +140,7 @@ ApplicationResourceInner createOrUpdate(String resourceGroupName, String cluster * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -154,7 +158,7 @@ SyncPoller, ApplicationResourceInner> begin * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -173,7 +177,7 @@ SyncPoller, ApplicationResourceInner> begin * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -191,7 +195,7 @@ ApplicationResourceInner update(String resourceGroupName, String clusterName, St * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -210,7 +214,7 @@ ApplicationResourceInner update(String resourceGroupName, String clusterName, St * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -227,7 +231,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. @@ -245,7 +249,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -260,7 +264,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. @@ -276,13 +280,15 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName); @@ -292,14 +298,16 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java index 9972d44cd512..a25925d01746 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -20,13 +20,15 @@ public interface ClusterVersionsClient { * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version along with {@link Response}. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String location, String clusterVersion, @@ -37,12 +39,14 @@ Response getWithResponse(String location, St * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version. */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterCodeVersionsListResultInner get(String location, String clusterVersion); @@ -52,14 +56,16 @@ Response getWithResponse(String location, St * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment along with + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -71,13 +77,15 @@ Response getByEnvironmentWithResponse(String * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment. + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment. */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterCodeVersionsListResultInner getByEnvironment(String location, ClusterVersionsEnvironment environment, @@ -88,12 +96,14 @@ ClusterCodeVersionsListResultInner getByEnvironment(String location, ClusterVers * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location along with {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(String location, Context context); @@ -103,11 +113,13 @@ ClusterCodeVersionsListResultInner getByEnvironment(String location, ClusterVers * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location. */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterCodeVersionsListResultInner list(String location); @@ -117,14 +129,15 @@ ClusterCodeVersionsListResultInner getByEnvironment(String location, ClusterVers * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment along with - * {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listByEnvironmentWithResponse(String location, @@ -135,12 +148,14 @@ Response listByEnvironmentWithResponse(Strin * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment. */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterCodeVersionsListResultInner listByEnvironment(String location, ClusterVersionsEnvironment environment); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java index 352bb490e741..6e69f1f4ca3e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -25,14 +25,16 @@ public interface ClustersClient { * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, @@ -43,13 +45,14 @@ Response getByResourceGroupWithResponse(String resourceGroupName, * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); @@ -59,7 +62,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,7 +79,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @param context The context to associate with this operation. @@ -94,7 +97,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -110,7 +113,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @param context The context to associate with this operation. @@ -127,7 +130,7 @@ SyncPoller, ClusterInner> beginCreateOrUpdate(String re * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -145,7 +148,7 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -164,7 +167,7 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -181,7 +184,7 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -200,7 +203,7 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,7 +219,7 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -230,11 +233,13 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -245,12 +250,14 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the 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 all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -263,7 +270,9 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -278,7 +287,9 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -292,14 +303,15 @@ ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateP * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param versionsDescription The upgrade path description with target 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 list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listUpgradableVersionsWithResponse(String resourceGroupName, @@ -313,12 +325,13 @@ Response listUpgradableVersionsWithResponse(St * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given. */ @ServiceMethod(returns = ReturnType.SINGLE) UpgradableVersionPathResultInner listUpgradableVersions(String resourceGroupName, String clusterName); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java index ede50c556c46..f4cad381e26d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -21,8 +21,8 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -36,8 +36,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java index 854d79ab5711..0c4201c2e187 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -12,26 +12,26 @@ */ public interface ServiceFabricManagementClient { /** - * Gets The customer subscription identifier. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,25 +47,25 @@ public interface ServiceFabricManagementClient { Duration getDefaultPollInterval(); /** - * Gets the ClustersClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the OperationsClient object. */ - ClustersClient getClusters(); + OperationsClient getOperations(); /** - * Gets the ClusterVersionsClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the ClusterVersionsClient object. + * @return the ClustersClient object. */ - ClusterVersionsClient getClusterVersions(); + ClustersClient getClusters(); /** - * Gets the OperationsClient object to access its operations. + * Gets the UnsupportedVmSizesClient object to access its operations. * - * @return the OperationsClient object. + * @return the UnsupportedVmSizesClient object. */ - OperationsClient getOperations(); + UnsupportedVmSizesClient getUnsupportedVmSizes(); /** * Gets the ApplicationTypesClient object to access its operations. @@ -94,4 +94,11 @@ public interface ServiceFabricManagementClient { * @return the ServicesClient object. */ ServicesClient getServices(); + + /** + * Gets the ClusterVersionsClient object to access its operations. + * + * @return the ClusterVersionsClient object. + */ + ClusterVersionsClient getClusterVersions(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java index 6dcb278670b3..d13d59fa3ab4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent; @@ -24,7 +24,7 @@ public interface ServicesClient { * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -32,7 +32,9 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -45,14 +47,16 @@ Response getWithResponse(String resourceGroupName, String * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -63,7 +67,7 @@ Response getWithResponse(String resourceGroupName, String * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -82,7 +86,7 @@ SyncPoller, ServiceResourceInner> beginCreateOr * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -103,7 +107,7 @@ SyncPoller, ServiceResourceInner> beginCreateOr * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -122,7 +126,7 @@ ServiceResourceInner createOrUpdate(String resourceGroupName, String clusterName * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -142,7 +146,7 @@ ServiceResourceInner createOrUpdate(String resourceGroupName, String clusterName * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -161,7 +165,7 @@ SyncPoller, ServiceResourceInner> beginUpdate(S * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -182,7 +186,7 @@ SyncPoller, ServiceResourceInner> beginUpdate(S * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -201,7 +205,7 @@ ServiceResourceInner update(String resourceGroupName, String clusterName, String * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -221,7 +225,7 @@ ServiceResourceInner update(String resourceGroupName, String clusterName, String * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -239,7 +243,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -258,7 +262,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -274,7 +278,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -292,14 +296,16 @@ void delete(String resourceGroupName, String clusterName, String applicationName * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName, String applicationName); @@ -309,15 +315,17 @@ void delete(String resourceGroupName, String clusterName, String applicationName * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName, String applicationName, diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/UnsupportedVmSizesClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/UnsupportedVmSizesClient.java new file mode 100644 index 000000000000..1c0df5d91c97 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/UnsupportedVmSizesClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.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.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; + +/** + * An instance of this class provides access to all the operations defined in UnsupportedVmSizesClient. + */ +public interface UnsupportedVmSizesClient { + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String vmSize, Context context); + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VMSizeResourceInner get(String location, String vmSize); + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java index 62e49255fa45..0e2d7a634e12 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -24,14 +24,14 @@ @Fluent public final class ApplicationResourceInner extends ProxyResource { /* - * Describes the managed identities for an Azure resource. + * The application resource properties. */ - private ManagedIdentity identity; + private ApplicationResourceProperties innerProperties; /* - * The application resource properties. + * The managed service identities assigned to this resource. */ - private ApplicationResourceProperties innerProperties; + private ManagedIdentity identity; /* * It will be deprecated in New API, resource location depends on the parent resource. @@ -75,7 +75,16 @@ public ApplicationResourceInner() { } /** - * Get the identity property: Describes the managed identities for an Azure resource. + * Get the innerProperties property: The application resource properties. + * + * @return the innerProperties value. + */ + private ApplicationResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -84,7 +93,7 @@ public ManagedIdentity identity() { } /** - * Set the identity property: Describes the managed identities for an Azure resource. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the ApplicationResourceInner object itself. @@ -94,15 +103,6 @@ public ApplicationResourceInner withIdentity(ManagedIdentity identity) { return this; } - /** - * Get the innerProperties property: The application resource properties. - * - * @return the innerProperties value. - */ - private ApplicationResourceProperties innerProperties() { - return this.innerProperties; - } - /** * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. * @@ -161,6 +161,17 @@ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -422,30 +433,17 @@ public ApplicationResourceInner withManagedIdentities(List writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } @@ -471,11 +469,11 @@ public static ApplicationResourceInner fromJson(JsonReader jsonReader) throws IO deserializedApplicationResourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedApplicationResourceInner.type = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedApplicationResourceInner.identity = ManagedIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedApplicationResourceInner.innerProperties = ApplicationResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedApplicationResourceInner.identity = ManagedIdentity.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedApplicationResourceInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceProperties.java index fbc2bfc78fa7..526a0264e451 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -139,24 +139,6 @@ public ApplicationResourceProperties withMetrics(List e.validate()); - } - if (managedIdentities() != null) { - managedIdentities().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceUpdateProperties.java index 975f6b8aed67..fb0116d7218a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -248,23 +248,6 @@ public List managedIdentities() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (upgradePolicy() != null) { - upgradePolicy().validate(); - } - if (metrics() != null) { - metrics().forEach(e -> e.validate()); - } - if (managedIdentities() != null) { - managedIdentities().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java index 631156309419..55bd9c1ae953 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -131,6 +131,17 @@ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. + * @return the ApplicationTypeResourceInner object itself. + */ + public ApplicationTypeResourceInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -171,17 +182,6 @@ public String provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -191,6 +191,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeStringField("location", this.location); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceProperties.java index cc71101e5b1c..568135937431 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -37,14 +37,6 @@ public String provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java index 867b7375cfeb..788664fd613f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -131,6 +131,17 @@ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -204,17 +215,6 @@ public Map defaultParameterList() { return this.innerProperties() == null ? null : this.innerProperties().defaultParameterList(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -224,6 +224,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeStringField("location", this.location); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceProperties.java index a3001390c654..4ce74ff1f79e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -80,21 +79,6 @@ public Map defaultParameterList() { return this.defaultParameterList; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appPackageUrl() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property appPackageUrl in model ApplicationTypeVersionResourceProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationTypeVersionResourceProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java index e073b6db2081..f7b3cd0549b4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The list results of the Service Fabric runtime versions. + * The response of a ClusterCodeVersions list operation. */ -@Fluent +@Immutable public final class ClusterCodeVersionsListResultInner implements JsonSerializable { /* - * The value property. + * The ClusterCodeVersions items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ClusterCodeVersionsListResultInner class. */ - public ClusterCodeVersionsListResultInner() { + private ClusterCodeVersionsListResultInner() { } /** - * Get the value property: The value property. + * Get the value property: The ClusterCodeVersions items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ClusterCodeVersionsListResultInner object itself. - */ - public ClusterCodeVersionsListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ClusterCodeVersionsListResultInner object itself. - */ - public ClusterCodeVersionsListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ClusterCodeVersionsListResultInner 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 ClusterCodeVersionsListResultInner. */ public static ClusterCodeVersionsListResultInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java index bbd308e5ca16..3fe028e6e19e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -50,7 +50,7 @@ public final class ClusterInner extends Resource { private String etag; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -94,7 +94,7 @@ public String etag() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -894,14 +894,30 @@ public ClusterInner withNotifications(List notifications) { } /** - * Validates the instance. + * Get the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the enableHttpGatewayExclusiveAuthMode value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public Boolean enableHttpGatewayExclusiveAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpGatewayExclusiveAuthMode(); + } + + /** + * Set the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @param enableHttpGatewayExclusiveAuthMode the enableHttpGatewayExclusiveAuthMode value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); } + this.innerProperties().withEnableHttpGatewayExclusiveAuthMode(enableHttpGatewayExclusiveAuthMode); + return this; } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterProperties.java index 6ad98cb0d9c6..eeb422f61818 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterProperties.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -235,6 +234,12 @@ public final class ClusterProperties implements JsonSerializable notifications; + /* + * If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS + * versions 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthEndpointPort must be defined. + */ + private Boolean enableHttpGatewayExclusiveAuthMode; + /** * Creates an instance of ClusterProperties class. */ @@ -904,64 +909,28 @@ public ClusterProperties withNotifications(List notifications) { } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availableClusterVersions() != null) { - availableClusterVersions().forEach(e -> e.validate()); - } - if (azureActiveDirectory() != null) { - azureActiveDirectory().validate(); - } - if (certificate() != null) { - certificate().validate(); - } - if (certificateCommonNames() != null) { - certificateCommonNames().validate(); - } - if (clientCertificateCommonNames() != null) { - clientCertificateCommonNames().forEach(e -> e.validate()); - } - if (clientCertificateThumbprints() != null) { - clientCertificateThumbprints().forEach(e -> e.validate()); - } - if (diagnosticsStorageAccountConfig() != null) { - diagnosticsStorageAccountConfig().validate(); - } - if (fabricSettings() != null) { - fabricSettings().forEach(e -> e.validate()); - } - if (managementEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property managementEndpoint in model ClusterProperties")); - } - if (nodeTypes() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property nodeTypes in model ClusterProperties")); - } else { - nodeTypes().forEach(e -> e.validate()); - } - if (reverseProxyCertificate() != null) { - reverseProxyCertificate().validate(); - } - if (reverseProxyCertificateCommonNames() != null) { - reverseProxyCertificateCommonNames().validate(); - } - if (upgradeDescription() != null) { - upgradeDescription().validate(); - } - if (applicationTypeVersionsCleanupPolicy() != null) { - applicationTypeVersionsCleanupPolicy().validate(); - } - if (notifications() != null) { - notifications().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ClusterProperties.class); + * Get the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @return the enableHttpGatewayExclusiveAuthMode value. + */ + public Boolean enableHttpGatewayExclusiveAuthMode() { + return this.enableHttpGatewayExclusiveAuthMode; + } + + /** + * Set the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @param enableHttpGatewayExclusiveAuthMode the enableHttpGatewayExclusiveAuthMode value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode) { + this.enableHttpGatewayExclusiveAuthMode = enableHttpGatewayExclusiveAuthMode; + return this; + } /** * {@inheritDoc} @@ -1009,6 +978,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.upgradePauseEndTimestampUtc)); jsonWriter.writeBooleanField("waveUpgradePaused", this.waveUpgradePaused); jsonWriter.writeArrayField("notifications", this.notifications, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableHttpGatewayExclusiveAuthMode", this.enableHttpGatewayExclusiveAuthMode); return jsonWriter.writeEndObject(); } @@ -1114,6 +1084,9 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("notifications".equals(fieldName)) { List notifications = reader.readArray(reader1 -> Notification.fromJson(reader1)); deserializedClusterProperties.notifications = notifications; + } else if ("enableHttpGatewayExclusiveAuthMode".equals(fieldName)) { + deserializedClusterProperties.enableHttpGatewayExclusiveAuthMode + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterPropertiesUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterPropertiesUpdateParameters.java index 02503a6f68e8..67137980c76b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterPropertiesUpdateParameters.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterPropertiesUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; @@ -163,6 +163,12 @@ public final class ClusterPropertiesUpdateParameters implements JsonSerializable */ private List notifications; + /* + * If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS + * versions 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthEndpointPort must be defined. + */ + private Boolean enableHttpGatewayExclusiveAuthMode; + /** * Creates an instance of ClusterPropertiesUpdateParameters class. */ @@ -667,41 +673,28 @@ public ClusterPropertiesUpdateParameters withNotifications(List no } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificate() != null) { - certificate().validate(); - } - if (certificateCommonNames() != null) { - certificateCommonNames().validate(); - } - if (clientCertificateCommonNames() != null) { - clientCertificateCommonNames().forEach(e -> e.validate()); - } - if (clientCertificateThumbprints() != null) { - clientCertificateThumbprints().forEach(e -> e.validate()); - } - if (fabricSettings() != null) { - fabricSettings().forEach(e -> e.validate()); - } - if (nodeTypes() != null) { - nodeTypes().forEach(e -> e.validate()); - } - if (reverseProxyCertificate() != null) { - reverseProxyCertificate().validate(); - } - if (upgradeDescription() != null) { - upgradeDescription().validate(); - } - if (applicationTypeVersionsCleanupPolicy() != null) { - applicationTypeVersionsCleanupPolicy().validate(); - } - if (notifications() != null) { - notifications().forEach(e -> e.validate()); - } + * Get the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @return the enableHttpGatewayExclusiveAuthMode value. + */ + public Boolean enableHttpGatewayExclusiveAuthMode() { + return this.enableHttpGatewayExclusiveAuthMode; + } + + /** + * Set the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @param enableHttpGatewayExclusiveAuthMode the enableHttpGatewayExclusiveAuthMode value to set. + * @return the ClusterPropertiesUpdateParameters object itself. + */ + public ClusterPropertiesUpdateParameters + withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode) { + this.enableHttpGatewayExclusiveAuthMode = enableHttpGatewayExclusiveAuthMode; + return this; } /** @@ -745,6 +738,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.upgradePauseEndTimestampUtc)); jsonWriter.writeBooleanField("waveUpgradePaused", this.waveUpgradePaused); jsonWriter.writeArrayField("notifications", this.notifications, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableHttpGatewayExclusiveAuthMode", this.enableHttpGatewayExclusiveAuthMode); return jsonWriter.writeEndObject(); } @@ -835,6 +829,9 @@ public static ClusterPropertiesUpdateParameters fromJson(JsonReader jsonReader) } else if ("notifications".equals(fieldName)) { List notifications = reader.readArray(reader1 -> Notification.fromJson(reader1)); deserializedClusterPropertiesUpdateParameters.notifications = notifications; + } else if ("enableHttpGatewayExclusiveAuthMode".equals(fieldName)) { + deserializedClusterPropertiesUpdateParameters.enableHttpGatewayExclusiveAuthMode + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterVersionDetails.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterVersionDetails.java index 5b3262c05914..09da39671c21 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterVersionDetails.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterVersionDetails.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The detail of the Service Fabric runtime version result. */ -@Fluent +@Immutable public final class ClusterVersionDetails implements JsonSerializable { /* * The Service Fabric runtime version of the cluster. @@ -35,7 +35,7 @@ public final class ClusterVersionDetails implements JsonSerializable { /* * The name of the operation. @@ -45,7 +45,7 @@ public final class OperationResultInner implements JsonSerializable writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/UpgradableVersionPathResultInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/UpgradableVersionPathResultInner.java index b305cd47d18f..6d62f0de206a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/UpgradableVersionPathResultInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/UpgradableVersionPathResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,24 +13,24 @@ import java.util.List; /** - * The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version + * The list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum upgradable version * if no target was given. */ -@Fluent +@Immutable public final class UpgradableVersionPathResultInner implements JsonSerializable { /* - * The supportedPath property. + * The list of intermediate cluster code versions for an upgrade or downgrade. */ private List supportedPath; /** * Creates an instance of UpgradableVersionPathResultInner class. */ - public UpgradableVersionPathResultInner() { + private UpgradableVersionPathResultInner() { } /** - * Get the supportedPath property: The supportedPath property. + * Get the supportedPath property: The list of intermediate cluster code versions for an upgrade or downgrade. * * @return the supportedPath value. */ @@ -38,25 +38,6 @@ public List supportedPath() { return this.supportedPath; } - /** - * Set the supportedPath property: The supportedPath property. - * - * @param supportedPath the supportedPath value to set. - * @return the UpgradableVersionPathResultInner object itself. - */ - public UpgradableVersionPathResultInner withSupportedPath(List supportedPath) { - this.supportedPath = supportedPath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/VMSizeResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/VMSizeResourceInner.java new file mode 100644 index 000000000000..7bd7e466d0fc --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/VMSizeResourceInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicefabric.models.VMSize; +import java.io.IOException; + +/** + * Describes a VM Sizes. + */ +@Immutable +public final class VMSizeResourceInner extends ProxyResource { + /* + * VM Size properties. + */ + private VMSize 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 VMSizeResourceInner class. + */ + private VMSizeResourceInner() { + } + + /** + * Get the properties property: VM Size properties. + * + * @return the properties value. + */ + public VMSize properties() { + return this.properties; + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMSizeResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMSizeResourceInner 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 VMSizeResourceInner. + */ + public static VMSizeResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMSizeResourceInner deserializedVMSizeResourceInner = new VMSizeResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVMSizeResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVMSizeResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVMSizeResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVMSizeResourceInner.properties = VMSize.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVMSizeResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVMSizeResourceInner; + }); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java index c22cc2aa8560..f420570a8f64 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for ServiceFabricManagementClient. - * Service Fabric Management Client. + * Package containing the inner data models for ServiceFabric. + * Azure Service Fabric Resource Provider API Client. */ package com.azure.resourcemanager.servicefabric.fluent.models; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java index 916f9d3b1e53..96d05a132217 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for ServiceFabricManagementClient. - * Service Fabric Management Client. + * Package containing the service clients for ServiceFabric. + * Azure Service Fabric Resource Provider API Client. */ package com.azure.resourcemanager.servicefabric.fluent; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java index c4d5a263bf8f..5b30d2973848 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -234,6 +234,16 @@ public ApplicationResourceImpl withIdentity(ManagedIdentity identity) { return this; } + public ApplicationResourceImpl withSystemData(SystemData systemData) { + if (isInCreateMode()) { + this.innerModel().withSystemData(systemData); + return this; + } else { + this.updateParameters.withSystemData(systemData); + return this; + } + } + public ApplicationResourceImpl withTypeName(String typeName) { this.innerModel().withTypeName(typeName); return this; @@ -320,6 +330,6 @@ public ApplicationResourceImpl withManagedIdentities(List tags) { this.innerModel().withTags(tags); return this; } + + public ApplicationTypeResourceImpl withSystemData(SystemData systemData) { + this.innerModel().withSystemData(systemData); + return this; + } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java index aee8cc9a18e0..e3a742a86bf5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -186,6 +186,11 @@ public ApplicationTypeVersionResourceImpl withTags(Map tags) { return this; } + public ApplicationTypeVersionResourceImpl withSystemData(SystemData systemData) { + this.innerModel().withSystemData(systemData); + return this; + } + public ApplicationTypeVersionResourceImpl withAppPackageUrl(String appPackageUrl) { this.innerModel().withAppPackageUrl(appPackageUrl); return this; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java index bd3aad90b0dd..8893a6897cab 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient; import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResourceList; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeVersionResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,57 +68,103 @@ public final class ApplicationTypeVersionsClientImpl implements ApplicationTypeV * The interface defining all the services for ServiceFabricManagementClientApplicationTypeVersions to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientApplicationTypeVersions") public interface ApplicationTypeVersionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/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("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplicationTypeVersionResourceInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationTypeVersionResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationTypeVersionResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/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("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationTypeName") String applicationTypeName, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationTypeName") String applicationTypeName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationTypeName") String applicationTypeName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -127,47 +174,26 @@ Mono> listNext( * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, version, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -177,64 +203,17 @@ private Mono> getWithResponseAsync * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String clusterName, String applicationTypeName, String version, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationTypeName, version, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a Service Fabric application type version resource. + * @return a Service Fabric application type version resource. * * Get a Service Fabric application type version resource created or in the process of being created in the Service - * Fabric application type name resource. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource on successful completion of {@link Mono}. + * Fabric application type name resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String clusterName, @@ -249,7 +228,7 @@ private Mono getAsync(String resourceGroupN * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -257,13 +236,17 @@ private Mono getAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationTypeName, version, accept, context); } /** @@ -272,15 +255,17 @@ public Response getWithResponse(String reso * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationTypeVersionResourceInner get(String resourceGroupName, String clusterName, @@ -293,7 +278,7 @@ public ApplicationTypeVersionResourceInner get(String resourceGroupName, String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -308,38 +293,12 @@ public ApplicationTypeVersionResourceInner get(String resourceGroupName, String private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationTypeName, version, this.client.getApiVersion(), parameters, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,53 +307,25 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. * @param parameters The application type version resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an application type version resource for the specified application type name resource along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, version, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, contentType, + accept, parameters, Context.NONE); } /** @@ -402,26 +333,26 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. * @param parameters The application type version resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an application type version resource for the specified application - * type name resource. + * @return an application type version resource for the specified application type name resource along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApplicationTypeVersionResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String applicationTypeName, - String version, ApplicationTypeVersionResourceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ApplicationTypeVersionResourceInner.class, - ApplicationTypeVersionResourceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, contentType, + accept, parameters, context); } /** @@ -429,12 +360,11 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. * @param parameters The application type version resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -444,13 +374,12 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ApplicationTypeVersionResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String applicationTypeName, - String version, ApplicationTypeVersionResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, - applicationTypeName, version, parameters, context); + String version, ApplicationTypeVersionResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ApplicationTypeVersionResourceInner.class, - ApplicationTypeVersionResourceInner.class, context); + ApplicationTypeVersionResourceInner.class, this.client.getContext()); } /** @@ -458,7 +387,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -473,8 +402,11 @@ private Mono>> createOrUpdateWithResponseAsync(String public SyncPoller, ApplicationTypeVersionResourceInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationTypeName, version, parameters); + return this.client.getLroResult( + response, ApplicationTypeVersionResourceInner.class, ApplicationTypeVersionResourceInner.class, + Context.NONE); } /** @@ -482,7 +414,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -498,9 +430,10 @@ private Mono>> createOrUpdateWithResponseAsync(String public SyncPoller, ApplicationTypeVersionResourceInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationTypeName, + version, parameters, context); + return this.client.getLroResult( + response, ApplicationTypeVersionResourceInner.class, ApplicationTypeVersionResourceInner.class, context); } /** @@ -508,7 +441,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -531,31 +464,7 @@ private Mono createOrUpdateAsync(String res * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @param version The application type version. - * @param parameters The application type version resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application type version resource for the specified application type name resource on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Service Fabric application type version resource. - * - * Create or update a Service Fabric application type version resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -568,7 +477,8 @@ private Mono createOrUpdateAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationTypeName, version, parameters) + .getFinalResult(); } /** @@ -576,7 +486,7 @@ public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupNa * * Create or update a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -590,8 +500,8 @@ public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationTypeName, String version, ApplicationTypeVersionResourceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationTypeName, version, parameters, context) + .getFinalResult(); } /** @@ -599,7 +509,7 @@ public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupNa * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -611,33 +521,9 @@ public ApplicationTypeVersionResourceInner createOrUpdate(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, String version) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, version, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -646,45 +532,21 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String applicationTypeName, String version, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (version == null) { - return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, version, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName, String version) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, + Context.NONE); } /** @@ -692,22 +554,21 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationTypeName, String version) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName, String version, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, version, context); } /** @@ -715,11 +576,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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. @@ -727,12 +587,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationTypeName, String version, Context context) { - context = this.client.mergeContext(context); + String applicationTypeName, String version) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -740,7 +599,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -752,7 +611,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, applicationTypeName, version); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -760,7 +621,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -773,8 +634,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, applicationTypeName, version, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -782,7 +644,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -803,29 +665,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @param version The application type 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, - String version, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Service Fabric application type version resource. - * - * Delete a Service Fabric application type version resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -835,7 +675,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { - deleteAsync(resourceGroupName, clusterName, applicationTypeName, version).block(); + beginDelete(resourceGroupName, clusterName, applicationTypeName, version).getFinalResult(); } /** @@ -843,7 +683,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -855,7 +695,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { - deleteAsync(resourceGroupName, clusterName, applicationTypeName, version, context).block(); + beginDelete(resourceGroupName, clusterName, applicationTypeName, version, context).getFinalResult(); } /** @@ -865,41 +705,25 @@ public void delete(String resourceGroupName, String clusterName, String applicat * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, String applicationTypeName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationTypeName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, 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())); @@ -912,45 +736,23 @@ private Mono> listSinglePageA * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric - * application type name resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName, String applicationTypeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationTypeName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, + String applicationTypeName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationTypeName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -960,20 +762,27 @@ private Mono> listSinglePageA * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric - * application type name resource as paginated response with {@link PagedFlux}. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, - String applicationTypeName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationTypeName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName, String applicationTypeName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationTypeName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -983,21 +792,28 @@ private PagedFlux listAsync(String resource * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric - * application type name resource as paginated response with {@link PagedFlux}. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, - String applicationTypeName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationTypeName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String clusterName, String applicationTypeName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationTypeName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1007,19 +823,23 @@ private PagedFlux listAsync(String resource * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, String applicationTypeName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, applicationTypeName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, applicationTypeName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -1029,41 +849,44 @@ public PagedIterable list(String resourceGr * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, applicationTypeName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, applicationTypeName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * Gets the list of application type version resources created in the specified Service Fabric application type name + * resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application type version resources for the specified application type name resource along - * with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1072,6 +895,34 @@ private Mono> listNextSingleP } /** + * Gets the list of application type version resources created in the specified Service Fabric application type name + * resource. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the list of application type version resources created in the specified Service Fabric application type name + * resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1079,23 +930,18 @@ private Mono> listNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application type version resources for the specified application type name resource along - * with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric + * application type name resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java index 0d49b1a2eb98..c15ea07139b4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceG String applicationTypeName, String version, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, clusterName, applicationTypeName, version, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationTypeVersionResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationTypeVersionResourceImpl(inner.getValue(), this.manager())); } public ApplicationTypeVersionResource get(String resourceGroupName, String clusterName, String applicationTypeName, diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java index 0fdc2e24f979..96b1179f67f4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient; import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResourceList; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,55 +68,99 @@ public final class ApplicationTypesClientImpl implements ApplicationTypesClient * The interface defining all the services for ServiceFabricManagementClientApplicationTypes to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientApplicationTypes") public interface ApplicationTypesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationTypeName") String applicationTypeName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationTypeName") String applicationTypeName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + @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("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationTypeName") String applicationTypeName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplicationTypeResourceInner parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationTypeName") String applicationTypeName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationTypeResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationTypeResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + @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("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationTypeName") String applicationTypeName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -125,41 +170,24 @@ Mono> listNext( * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationTypeName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -169,57 +197,15 @@ private Mono> getWithResponseAsync(String * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service - * Fabric cluster resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String clusterName, String applicationTypeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationTypeName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a Service Fabric application type name resource. + * @return a Service Fabric application type name resource. * * Get a Service Fabric application type name resource created or in the process of being created in the Service - * Fabric cluster resource. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -235,20 +221,24 @@ private Mono getAsync(String resourceGroupName, St * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationTypeName, accept, context); } /** @@ -257,13 +247,15 @@ public Response getWithResponse(String resourceGro * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -276,7 +268,7 @@ public ApplicationTypeResourceInner get(String resourceGroupName, String cluster * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -288,35 +280,12 @@ public ApplicationTypeResourceInner get(String resourceGroupName, String cluster @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName, ApplicationTypeResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationTypeName, this.client.getApiVersion(), parameters, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -325,55 +294,7 @@ private Mono> createOrUpdateWithResponseA * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @param parameters The application type name resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application type name resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, String applicationTypeName, ApplicationTypeResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, this.client.getApiVersion(), parameters, accept, context); - } - - /** - * Creates or updates a Service Fabric application type name resource. - * - * Create or update a Service Fabric application type name resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -394,7 +315,7 @@ private Mono createOrUpdateAsync(String resourceGr * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -407,8 +328,11 @@ private Mono createOrUpdateAsync(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, String applicationTypeName, ApplicationTypeResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, parameters, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, contentType, accept, + parameters, context); } /** @@ -416,7 +340,7 @@ public Response createOrUpdateWithResponse(String * * Create or update a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param parameters The application type name resource. @@ -437,7 +361,7 @@ public ApplicationTypeResourceInner createOrUpdate(String resourceGroupName, Str * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -448,29 +372,9 @@ public ApplicationTypeResourceInner createOrUpdate(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String applicationTypeName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationTypeName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -479,41 +383,19 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String applicationTypeName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationTypeName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, Context.NONE); } /** @@ -521,21 +403,20 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationTypeName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationTypeName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationTypeName, context); } /** @@ -543,10 +424,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -554,12 +434,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationTypeName, Context context) { - context = this.client.mergeContext(context); + String applicationTypeName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -567,7 +446,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -578,7 +457,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationTypeName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, applicationTypeName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -586,7 +466,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. @@ -598,7 +478,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, applicationTypeName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -606,7 +488,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -625,28 +507,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationTypeName The name of the application type name resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Service Fabric application type name resource. - * - * Delete a Service Fabric application type name resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -655,7 +516,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationTypeName) { - deleteAsync(resourceGroupName, clusterName, applicationTypeName).block(); + beginDelete(resourceGroupName, clusterName, applicationTypeName).getFinalResult(); } /** @@ -663,7 +524,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. @@ -673,7 +534,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { - deleteAsync(resourceGroupName, clusterName, applicationTypeName, context).block(); + beginDelete(resourceGroupName, clusterName, applicationTypeName, context).getFinalResult(); } /** @@ -682,36 +543,23 @@ public void delete(String resourceGroupName, String clusterName, String applicat * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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())); @@ -723,40 +571,20 @@ private Mono> listSinglePageAsync(St * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -765,18 +593,24 @@ private Mono> listSinglePageAsync(St * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedFlux}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -785,20 +619,26 @@ private PagedFlux listAsync(String resourceGroupNa * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedFlux}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -807,17 +647,20 @@ private PagedFlux listAsync(String resourceGroupNa * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -826,40 +669,40 @@ public PagedIterable list(String resourceGroupName * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application type names along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -868,6 +711,31 @@ private Mono> listNextSinglePageAsyn } /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the list of application type name resources created in the specified Service Fabric cluster resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -875,23 +743,17 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application type names along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java index 22975cd44748..288c5b31df69 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupNam String applicationTypeName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, clusterName, applicationTypeName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationTypeResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationTypeResourceImpl(inner.getValue(), this.manager())); } public ApplicationTypeResource get(String resourceGroupName, String clusterName, String applicationTypeName) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java index d82b1398b5e8..e8e93c4eab3f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -28,13 +28,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient; import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationResourceList; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationResourceList; import com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -69,66 +70,118 @@ public final class ApplicationsClientImpl implements ApplicationsClient { * The interface defining all the services for ServiceFabricManagementClientApplications to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientApplications") public interface ApplicationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + @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("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplicationResourceInner parameters, @HeaderParam("Accept") String accept, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationResourceInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplicationResourceUpdate parameters, @HeaderParam("Accept") String accept, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationResourceUpdate parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationResourceUpdate parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + @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("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -137,41 +190,24 @@ Mono> listNext(@PathParam(value = "nextLink", * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, String applicationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -181,57 +217,15 @@ private Mono> getWithResponseAsync(String res * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric - * cluster resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a Service Fabric application resource. + * @return a Service Fabric application resource. * * Get a Service Fabric application resource created or in the process of being created in the Service Fabric - * cluster resource. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -247,20 +241,24 @@ private Mono getAsync(String resourceGroupName, String * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String applicationName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, applicationName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationName, accept, context); } /** @@ -269,13 +267,15 @@ public Response getWithResponse(String resourceGroupNa * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -288,7 +288,7 @@ public ApplicationResourceInner get(String resourceGroupName, String clusterName * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -300,35 +300,12 @@ public ApplicationResourceInner get(String resourceGroupName, String clusterName @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), parameters, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -337,47 +314,23 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application resource along with {@link Response} on successful completion of {@link Mono}. + * @return the application resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, String applicationName, ApplicationResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, contentType, accept, + parameters, Context.NONE); } /** @@ -385,23 +338,24 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the application resource. + * @return the application resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApplicationResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, contentType, accept, + parameters, context); } /** @@ -409,11 +363,10 @@ private PollerFlux, ApplicationResourceInne * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -421,13 +374,12 @@ private PollerFlux, ApplicationResourceInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ApplicationResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, context); + this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, + this.client.getContext()); } /** @@ -435,7 +387,7 @@ private PollerFlux, ApplicationResourceInne * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -447,8 +399,10 @@ private PollerFlux, ApplicationResourceInne @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationName, parameters); + return this.client.getLroResult(response, + ApplicationResourceInner.class, ApplicationResourceInner.class, Context.NONE); } /** @@ -456,7 +410,7 @@ public SyncPoller, ApplicationResourceInner * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -470,8 +424,10 @@ public SyncPoller, ApplicationResourceInner public SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationName, parameters, context); + return this.client.getLroResult(response, + ApplicationResourceInner.class, ApplicationResourceInner.class, context); } /** @@ -479,7 +435,7 @@ public SyncPoller, ApplicationResourceInner * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -500,29 +456,7 @@ private Mono createOrUpdateAsync(String resourceGroupN * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param parameters The application resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - String applicationName, ApplicationResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Service Fabric application resource. - * - * Create or update a Service Fabric application resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -534,7 +468,7 @@ private Mono createOrUpdateAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationName, parameters).getFinalResult(); } /** @@ -542,7 +476,7 @@ public ApplicationResourceInner createOrUpdate(String resourceGroupName, String * * Create or update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource. @@ -555,7 +489,8 @@ public ApplicationResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationName, parameters, context) + .getFinalResult(); } /** @@ -563,7 +498,7 @@ public ApplicationResourceInner createOrUpdate(String resourceGroupName, String * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -575,35 +510,12 @@ public ApplicationResourceInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -612,47 +524,23 @@ private Mono>> updateWithResponseAsync(String resource * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application resource along with {@link Response} on successful completion of {@link Mono}. + * @return the application resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, ApplicationResourceUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response updateWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationResourceUpdate parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, contentType, accept, + parameters, Context.NONE); } /** @@ -660,23 +548,24 @@ private Mono>> updateWithResponseAsync(String resource * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the application resource. + * @return the application resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApplicationResourceInner> beginUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + String applicationName, ApplicationResourceUpdate parameters, 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, clusterName, applicationName, contentType, accept, + parameters, context); } /** @@ -684,11 +573,10 @@ private PollerFlux, ApplicationResourceInne * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -696,13 +584,12 @@ private PollerFlux, ApplicationResourceInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ApplicationResourceInner> beginUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, context); + this.client.getHttpPipeline(), ApplicationResourceInner.class, ApplicationResourceInner.class, + this.client.getContext()); } /** @@ -710,7 +597,7 @@ private PollerFlux, ApplicationResourceInne * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -722,7 +609,9 @@ private PollerFlux, ApplicationResourceInne @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ApplicationResourceInner> beginUpdate( String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, applicationName, parameters); + return this.client.getLroResult(response, + ApplicationResourceInner.class, ApplicationResourceInner.class, Context.NONE); } /** @@ -730,7 +619,7 @@ public SyncPoller, ApplicationResourceInner * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -744,8 +633,10 @@ public SyncPoller, ApplicationResourceInner public SyncPoller, ApplicationResourceInner> beginUpdate( String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, clusterName, applicationName, parameters, context); + return this.client.getLroResult(response, + ApplicationResourceInner.class, ApplicationResourceInner.class, context); } /** @@ -753,7 +644,7 @@ public SyncPoller, ApplicationResourceInner * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -774,29 +665,7 @@ private Mono updateAsync(String resourceGroupName, Str * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param parameters The application resource for patch operations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the application resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, - String applicationName, ApplicationResourceUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Service Fabric application resource. - * - * Update a Service Fabric application resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -808,7 +677,7 @@ private Mono updateAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationResourceInner update(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { - return updateAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + return beginUpdate(resourceGroupName, clusterName, applicationName, parameters).getFinalResult(); } /** @@ -816,7 +685,7 @@ public ApplicationResourceInner update(String resourceGroupName, String clusterN * * Update a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param parameters The application resource for patch operations. @@ -829,7 +698,7 @@ public ApplicationResourceInner update(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) public ApplicationResourceInner update(String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, applicationName, parameters, context).block(); + return beginUpdate(resourceGroupName, clusterName, applicationName, parameters, context).getFinalResult(); } /** @@ -837,7 +706,7 @@ public ApplicationResourceInner update(String resourceGroupName, String clusterN * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -848,29 +717,9 @@ public ApplicationResourceInner update(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String applicationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -879,41 +728,19 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, Context.NONE); } /** @@ -921,21 +748,20 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, context); } /** @@ -943,10 +769,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -954,12 +779,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - context = this.client.mergeContext(context); + String applicationName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -967,7 +791,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -978,7 +802,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, applicationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -986,7 +811,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. @@ -998,7 +823,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, applicationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1006,7 +832,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1025,28 +851,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Service Fabric application resource. - * - * Delete a Service Fabric application resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1055,7 +860,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName) { - deleteAsync(resourceGroupName, clusterName, applicationName).block(); + beginDelete(resourceGroupName, clusterName, applicationName).getFinalResult(); } /** @@ -1063,7 +868,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. @@ -1073,7 +878,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { - deleteAsync(resourceGroupName, clusterName, applicationName, context).block(); + beginDelete(resourceGroupName, clusterName, applicationName, context).getFinalResult(); } /** @@ -1081,36 +886,23 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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())); @@ -1121,40 +913,20 @@ private Mono> listSinglePageAsync(String * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1162,18 +934,23 @@ private Mono> listSinglePageAsync(String * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedFlux}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1181,20 +958,25 @@ private PagedFlux listAsync(String resourceGroupName, * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedFlux}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1202,17 +984,20 @@ private PagedFlux listAsync(String resourceGroupName, * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -1220,39 +1005,39 @@ public PagedIterable list(String resourceGroupName, St * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1261,6 +1046,31 @@ private Mono> listNextSinglePageAsync(St } /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the list of application resources created in the specified Service Fabric cluster resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1268,22 +1078,17 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of application resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java index ec8dd8b24ab4..08c430713d9d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, S String applicationName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, clusterName, applicationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationResourceImpl(inner.getValue(), this.manager())); } public ApplicationResource get(String resourceGroupName, String clusterName, String applicationName) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java index d060eab4e481..dc44a491fe32 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java index 310d4ce3b6ef..a975b84cc713 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -239,6 +239,10 @@ public List notifications() { } } + public Boolean enableHttpGatewayExclusiveAuthMode() { + return this.innerModel().enableHttpGatewayExclusiveAuthMode(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -612,7 +616,17 @@ public ClusterImpl withNotifications(List notifications) { } } + public ClusterImpl withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode) { + if (isInCreateMode()) { + this.innerModel().withEnableHttpGatewayExclusiveAuthMode(enableHttpGatewayExclusiveAuthMode); + return this; + } else { + this.updateParameters.withEnableHttpGatewayExclusiveAuthMode(enableHttpGatewayExclusiveAuthMode); + return this; + } + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java index aa211417e28c..9705f4df946a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -55,42 +55,77 @@ public final class ClusterVersionsClientImpl implements ClusterVersionsClient { * The interface defining all the services for ServiceFabricManagementClientClusterVersions to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientClusterVersions") public interface ClusterVersionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("clusterVersion") String clusterVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("clusterVersion") String clusterVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("clusterVersion") String clusterVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByEnvironment(@HostParam("$host") String endpoint, + Mono> getByEnvironment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("environment") ClusterVersionsEnvironment environment, + @PathParam("clusterVersion") String clusterVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByEnvironmentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("environment") ClusterVersionsEnvironment environment, @PathParam("clusterVersion") String clusterVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByEnvironment(@HostParam("$host") String endpoint, + Mono> listByEnvironment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("environment") ClusterVersionsEnvironment environment, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByEnvironmentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("environment") ClusterVersionsEnvironment environment, @HeaderParam("Accept") String accept, Context context); } @@ -99,35 +134,23 @@ Mono> listByEnvironment(@HostParam( * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version along with {@link Response} on - * successful completion of {@link Mono}. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location, String clusterVersion) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (clusterVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), clusterVersion, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, clusterVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -136,50 +159,14 @@ private Mono> getWithResponseAsync( * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, - String clusterVersion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (clusterVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), clusterVersion, accept, context); - } - - /** - * Gets information about a Service Fabric cluster code version available in the specified location. + * @return information about a Service Fabric cluster code version available in the specified location. * - * Gets information about an available Service Fabric cluster code version. - * - * @param location The location for the cluster code versions. This is different from cluster location. - * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version on successful completion of - * {@link Mono}. + * Gets information about an available Service Fabric cluster code version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location, String clusterVersion) { @@ -191,18 +178,22 @@ private Mono getAsync(String location, Strin * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version along with {@link Response}. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String clusterVersion, Context context) { - return getWithResponseAsync(location, clusterVersion, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, clusterVersion, accept, context); } /** @@ -210,12 +201,14 @@ public Response getWithResponse(String locat * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version. */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterCodeVersionsListResultInner get(String location, String clusterVersion) { @@ -227,39 +220,24 @@ public ClusterCodeVersionsListResultInner get(String location, String clusterVer * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment along with + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment along with * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByEnvironmentWithResponseAsync(String location, ClusterVersionsEnvironment environment, String clusterVersion) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (clusterVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByEnvironment(this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), this.client.getSubscriptionId(), clusterVersion, accept, context)) + .withContext(context -> service.getByEnvironment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, environment, clusterVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -268,55 +246,16 @@ private Mono> getByEnvironmentWithR * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByEnvironmentWithResponseAsync(String location, - ClusterVersionsEnvironment environment, String clusterVersion, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (clusterVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByEnvironment(this.client.getEndpoint(), location, environment, this.client.getApiVersion(), - this.client.getSubscriptionId(), clusterVersion, accept, context); - } - - /** - * Gets information about a Service Fabric cluster code version available for the specified environment. - * - * Gets information about an available Service Fabric cluster code version by environment. + * @return information about a Service Fabric cluster code version available for the specified environment. * - * @param location The location for the cluster code versions. This is different from cluster location. - * @param environment The operating system of the cluster. The default means all. - * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment on successful - * completion of {@link Mono}. + * Gets information about an available Service Fabric cluster code version by environment on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByEnvironmentAsync(String location, @@ -330,20 +269,24 @@ private Mono getByEnvironmentAsync(String lo * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment along with + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByEnvironmentWithResponse(String location, ClusterVersionsEnvironment environment, String clusterVersion, Context context) { - return getByEnvironmentWithResponseAsync(location, environment, clusterVersion, context).block(); + final String accept = "application/json"; + return service.getByEnvironmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, environment, clusterVersion, accept, context); } /** @@ -351,13 +294,15 @@ public Response getByEnvironmentWithResponse * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment. + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment. */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterCodeVersionsListResultInner getByEnvironment(String location, ClusterVersionsEnvironment environment, @@ -370,30 +315,21 @@ public ClusterCodeVersionsListResultInner getByEnvironment(String location, Clus * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location along with {@link Response} - * on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -402,43 +338,13 @@ private Mono> listWithResponseAsync * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. - * @param context The context to associate with this operation. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets the list of Service Fabric cluster code versions available for the specified location. + * @return the list of Service Fabric cluster code versions available for the specified location. * - * Gets all available code versions for Service Fabric cluster resources by location. - * - * @param location The location for the cluster code versions. This is different from cluster location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location on successful completion of + * Gets all available code versions for Service Fabric cluster resources by location on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -451,16 +357,20 @@ private Mono listAsync(String location) { * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location along with {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String location, Context context) { - return listWithResponseAsync(location, context).block(); + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context); } /** @@ -468,11 +378,13 @@ public Response listWithResponse(String loca * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location. */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterCodeVersionsListResultInner list(String location) { @@ -484,35 +396,23 @@ public ClusterCodeVersionsListResultInner list(String location) { * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment along with - * {@link Response} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByEnvironmentWithResponseAsync(String location, ClusterVersionsEnvironment environment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByEnvironment(this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByEnvironment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, environment, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -521,50 +421,15 @@ private Mono> listByEnvironmentWith * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByEnvironmentWithResponseAsync(String location, - ClusterVersionsEnvironment environment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByEnvironment(this.client.getEndpoint(), location, environment, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets the list of Service Fabric cluster code versions available for the specified environment. - * - * Gets all available code versions for Service Fabric cluster resources by environment. + * @return the list of Service Fabric cluster code versions available for the specified environment. * - * @param location The location for the cluster code versions. This is different from cluster location. - * @param environment The operating system of the cluster. The default means all. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment on successful completion - * of {@link Mono}. + * Gets all available code versions for Service Fabric cluster resources by environment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listByEnvironmentAsync(String location, @@ -578,19 +443,22 @@ private Mono listByEnvironmentAsync(String l * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment along with - * {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listByEnvironmentWithResponse(String location, ClusterVersionsEnvironment environment, Context context) { - return listByEnvironmentWithResponseAsync(location, environment, context).block(); + final String accept = "application/json"; + return service.listByEnvironmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, environment, accept, context); } /** @@ -598,12 +466,14 @@ public Response listByEnvironmentWithRespons * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment. */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterCodeVersionsListResultInner listByEnvironment(String location, diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java index afb70dfd3b34..d6544937d8e7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String location, Context context) { Response inner = this.serviceClient().getWithResponse(location, clusterVersion, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); } public ClusterCodeVersionsListResult get(String location, String clusterVersion) { @@ -52,12 +48,8 @@ public Response getByEnvironmentWithResponse(Stri ClusterVersionsEnvironment environment, String clusterVersion, Context context) { Response inner = this.serviceClient().getByEnvironmentWithResponse(location, environment, clusterVersion, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); } public ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVersionsEnvironment environment, @@ -73,12 +65,8 @@ public ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVe public Response listWithResponse(String location, Context context) { Response inner = this.serviceClient().listWithResponse(location, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); } public ClusterCodeVersionsListResult list(String location) { @@ -94,12 +82,8 @@ public Response listByEnvironmentWithResponse(Str ClusterVersionsEnvironment environment, Context context) { Response inner = this.serviceClient().listByEnvironmentWithResponse(location, environment, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterCodeVersionsListResultImpl(inner.getValue(), this.manager())); } public ClusterCodeVersionsListResult listByEnvironment(String location, ClusterVersionsEnvironment environment) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java index 62a6657f3270..a8e90a74c4ea 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -36,7 +37,7 @@ import com.azure.resourcemanager.servicefabric.fluent.ClustersClient; import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; import com.azure.resourcemanager.servicefabric.fluent.models.UpgradableVersionPathResultInner; -import com.azure.resourcemanager.servicefabric.models.ClusterListResult; +import com.azure.resourcemanager.servicefabric.implementation.models.ClusterListResult; import com.azure.resourcemanager.servicefabric.models.ClusterUpdateParameters; import com.azure.resourcemanager.servicefabric.models.UpgradableVersionsDescription; import java.nio.ByteBuffer; @@ -71,60 +72,112 @@ public final class ClustersClientImpl implements ClustersClient { * The interface defining all the services for ServiceFabricManagementClientClusters to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientClusters") public interface ClustersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + @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("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdateParameters parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + @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("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdateParameters parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterUpdateParameters parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters") + @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}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -132,19 +185,36 @@ Mono> list(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUpgradableVersions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listUpgradableVersions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpgradableVersionsDescription versionsDescription, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpgradableVersionsDescription versionsDescription, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listUpgradableVersionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpgradableVersionsDescription versionsDescription, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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" }) @@ -152,7 +222,14 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -160,36 +237,23 @@ Mono> listNext(@PathParam(value = "nextLink", encode * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response} on successful completion of {@link Mono}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - clusterName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -198,51 +262,15 @@ private Mono> getByResourceGroupWithResponseAsync(String * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets a Service Fabric cluster resource. + * @return a Service Fabric cluster resource. * - * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group on successful completion of {@link Mono}. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { @@ -255,19 +283,23 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); } /** @@ -275,13 +307,14 @@ public Response getByResourceGroupWithResponse(String resourceGrou * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { @@ -293,7 +326,7 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -304,30 +337,12 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -336,42 +351,22 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the cluster resource along with {@link Response} on successful completion of {@link Mono}. + * @return the cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + Context.NONE); } /** @@ -379,21 +374,22 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the cluster resource. + * @return the cluster resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context); } /** @@ -401,10 +397,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -412,12 +407,11 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, ClusterInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -425,7 +419,7 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -436,7 +430,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -444,7 +440,7 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @param context The context to associate with this operation. @@ -456,7 +452,9 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -464,7 +462,7 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -484,28 +482,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param parameters The cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the cluster resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - ClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Service Fabric cluster resource. - * - * Create or update a Service Fabric cluster resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -515,7 +492,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -523,7 +500,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, * * Create or update a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The cluster resource. * @param context The context to associate with this operation. @@ -535,7 +512,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -543,7 +520,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -555,30 +532,10 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -587,43 +544,23 @@ private Mono>> updateWithResponseAsync(String resource * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the cluster resource along with {@link Response} on successful completion of {@link Mono}. + * @return the cluster resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterUpdateParameters parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + Context.NONE); } /** @@ -631,21 +568,23 @@ private Mono>> updateWithResponseAsync(String resource * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the cluster resource. + * @return the cluster resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String clusterName, ClusterUpdateParameters parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterUpdateParameters parameters, 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, clusterName, contentType, accept, parameters, context); } /** @@ -653,11 +592,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -665,12 +603,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String clusterName, ClusterUpdateParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + String clusterName, ClusterUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -678,7 +614,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -690,7 +626,9 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -698,7 +636,7 @@ public SyncPoller, ClusterInner> beginUpdate(String res * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -711,7 +649,9 @@ public SyncPoller, ClusterInner> beginUpdate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -719,7 +659,7 @@ public SyncPoller, ClusterInner> beginUpdate(String res * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -740,29 +680,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param parameters The parameters which contains the property value and property name which used to update the - * cluster configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the cluster resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, - ClusterUpdateParameters parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the configuration of a Service Fabric cluster resource. - * - * Update the configuration of a Service Fabric cluster resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -773,7 +691,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { - return updateAsync(resourceGroupName, clusterName, parameters).block(); + return beginUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -781,7 +699,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * * Update the configuration of a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param parameters The parameters which contains the property value and property name which used to update the * cluster configuration. @@ -794,7 +712,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -802,7 +720,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -811,25 +729,9 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -838,44 +740,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - - /** - * Deletes a Service Fabric cluster resource. - * - * Delete a Service Fabric cluster resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -892,7 +757,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -902,7 +767,8 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - return deleteWithResponseAsync(resourceGroupName, clusterName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context); } /** @@ -910,7 +776,7 @@ public Response deleteWithResponse(String resourceGroupName, String cluste * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -926,31 +792,21 @@ public void delete(String resourceGroupName, String clusterName) { * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group - * along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -961,36 +817,19 @@ private Mono> listByResourceGroupSinglePageAsync(Str * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group - * along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as + * paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -998,17 +837,22 @@ private Mono> listByResourceGroupSinglePageAsync(Str * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group as - * paginated response with {@link PagedFlux}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group along + * with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @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); } /** @@ -1016,18 +860,23 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the 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 all Service Fabric cluster resources created or in the process of being created in the resource group as - * paginated response with {@link PagedFlux}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group along + * with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private 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); } /** @@ -1035,16 +884,19 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -1052,17 +904,20 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the 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 all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -1072,19 +927,13 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription along + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1099,30 +948,16 @@ private Mono> listSinglePageAsync() { * * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription along - * with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as + * paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1132,12 +967,18 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as - * paginated response with {@link PagedFlux}. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along + * with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1149,13 +990,18 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as - * paginated response with {@link PagedFlux}. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along + * with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1165,12 +1011,14 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -1182,12 +1030,14 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1198,41 +1048,23 @@ public PagedIterable list(Context context) { * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param versionsDescription The upgrade path description with target 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 list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response} on - * successful completion of {@link Mono}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listUpgradableVersionsWithResponseAsync( String resourceGroupName, String clusterName, UpgradableVersionsDescription versionsDescription) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (versionsDescription != null) { - versionsDescription.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listUpgradableVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), versionsDescription, accept, context)) + .withContext(context -> service.listUpgradableVersions(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, + versionsDescription, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1244,59 +1076,13 @@ private Mono> listUpgradableVersionsW * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. - * @param versionsDescription The upgrade path description with target 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 list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUpgradableVersionsWithResponseAsync( - String resourceGroupName, String clusterName, UpgradableVersionsDescription versionsDescription, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (versionsDescription != null) { - versionsDescription.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listUpgradableVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), versionsDescription, accept, context); - } - - /** - * Operation to get the minimum and maximum upgradable version from the current cluster version, or the required - * path to get to the an specific target version. - * - * If a target is not provided, it will get the minimum and maximum versions available from the current cluster - * version. If a target is given, it will provide the required path to get from the current cluster version to the - * target version. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade on successful completion of - * {@link Mono}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listUpgradableVersionsAsync(String resourceGroupName, @@ -1314,20 +1100,22 @@ private Mono listUpgradableVersionsAsync(Strin * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param versionsDescription The upgrade path description with target 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 list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listUpgradableVersionsWithResponse(String resourceGroupName, String clusterName, UpgradableVersionsDescription versionsDescription, Context context) { - return listUpgradableVersionsWithResponseAsync(resourceGroupName, clusterName, versionsDescription, context) - .block(); + final String accept = "application/json"; + return service.listUpgradableVersionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, versionsDescription, context); } /** @@ -1338,12 +1126,13 @@ public Response listUpgradableVersionsWithResp * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpgradableVersionPathResultInner listUpgradableVersions(String resourceGroupName, String clusterName) { @@ -1353,23 +1142,21 @@ public UpgradableVersionPathResultInner listUpgradableVersions(String resourceGr } /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster list results along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -1380,6 +1167,31 @@ private Mono> listByResourceGroupNextSinglePageAsync } /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group 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); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1387,42 +1199,36 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster list results along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group along + * with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster list results along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1431,6 +1237,31 @@ private Mono> listNextSinglePageAsync(String nextLin } /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along + * with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1438,21 +1269,16 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster list results along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription along + * with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java index 75bf85d20bee..1f3553572e7f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -34,12 +34,8 @@ public Response getByResourceGroupWithResponse(String resourceGroupName Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); } public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { @@ -84,12 +80,8 @@ public Response listUpgradableVersionsWithResponse( String clusterName, UpgradableVersionsDescription versionsDescription, Context context) { Response inner = this.serviceClient() .listUpgradableVersionsWithResponse(resourceGroupName, clusterName, versionsDescription, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UpgradableVersionPathResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UpgradableVersionPathResultImpl(inner.getValue(), this.manager())); } public UpgradableVersionPathResult listUpgradableVersions(String resourceGroupName, String clusterName) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java index 446174c9b662..e4dbbff55705 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java index d445fe94866e..315b40c5c103 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; -import com.azure.resourcemanager.servicefabric.models.OperationListResult; +import com.azure.resourcemanager.servicefabric.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ServiceFabricManagementClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ServiceFabric/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ServiceFabric/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +81,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -84,15 +98,11 @@ Mono> listNext(@PathParam(value = "nextLink", enco * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return describes the result of the request to list Service Fabric resource provider operations along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -107,24 +117,14 @@ private Mono> listSinglePageAsync() { * * Get the list of available Service Fabric resource provider API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -134,12 +134,16 @@ private Mono> listSinglePageAsync(Context co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedFlux}. + * @return describes the result of the request to list Service Fabric resource provider operations along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -151,13 +155,16 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedFlux}. + * @return describes the result of the request to list Service Fabric resource provider operations along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -167,12 +174,12 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -184,15 +191,17 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** + * Lists all of the available Service Fabric resource provider API operations. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -204,13 +213,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -219,6 +221,29 @@ private Mono> listNextSinglePageAsync(String } /** + * Lists all of the available Service Fabric resource provider API operations. + * + * 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 describes the result of the request to list Service Fabric resource provider operations along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -227,21 +252,13 @@ private Mono> listNextSinglePageAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the result of the request to list Service Fabric resource provider operations along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java index 1c91c7291890..fb8a53253a51 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ResourceManagerUtils.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ResourceManagerUtils.java index ec8c7f53ec6e..e2f80689a42e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ResourceManagerUtils.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java index a64c98efed07..24ef7e348ff7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { ServiceFabricManagementClientImpl.class }) public final class ServiceFabricManagementClientBuilder { /* - * The customer subscription identifier. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The customer subscription identifier. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the ServiceFabricManagementClientBuilder. */ - public ServiceFabricManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public ServiceFabricManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the ServiceFabricManagementClientBuilder. */ - public ServiceFabricManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public ServiceFabricManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public ServiceFabricManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ServiceFabricManagementClientImpl client = new ServiceFabricManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java index 3e3c3d75fb80..e467a5365713 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -15,12 +15,15 @@ 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.servicefabric.fluent.ApplicationTypeVersionsClient; @@ -31,6 +34,7 @@ import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; import com.azure.resourcemanager.servicefabric.fluent.ServiceFabricManagementClient; import com.azure.resourcemanager.servicefabric.fluent.ServicesClient; +import com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -46,26 +50,12 @@ @ServiceClient(builder = ServiceFabricManagementClientBuilder.class) public final class ServiceFabricManagementClientImpl implements ServiceFabricManagementClient { /** - * The customer subscription identifier. - */ - private final String subscriptionId; - - /** - * Gets The customer subscription identifier. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -74,12 +64,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -87,6 +77,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -130,45 +134,45 @@ public Duration getDefaultPollInterval() { } /** - * The ClustersClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final ClustersClient clusters; + private final OperationsClient operations; /** - * Gets the ClustersClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the OperationsClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public OperationsClient getOperations() { + return this.operations; } /** - * The ClusterVersionsClient object to access its operations. + * The ClustersClient object to access its operations. */ - private final ClusterVersionsClient clusterVersions; + private final ClustersClient clusters; /** - * Gets the ClusterVersionsClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the ClusterVersionsClient object. + * @return the ClustersClient object. */ - public ClusterVersionsClient getClusterVersions() { - return this.clusterVersions; + public ClustersClient getClusters() { + return this.clusters; } /** - * The OperationsClient object to access its operations. + * The UnsupportedVmSizesClient object to access its operations. */ - private final OperationsClient operations; + private final UnsupportedVmSizesClient unsupportedVmSizes; /** - * Gets the OperationsClient object to access its operations. + * Gets the UnsupportedVmSizesClient object to access its operations. * - * @return the OperationsClient object. + * @return the UnsupportedVmSizesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public UnsupportedVmSizesClient getUnsupportedVmSizes() { + return this.unsupportedVmSizes; } /** @@ -227,6 +231,20 @@ public ServicesClient getServices() { return this.services; } + /** + * The ClusterVersionsClient object to access its operations. + */ + private final ClusterVersionsClient clusterVersions; + + /** + * Gets the ClusterVersionsClient object to access its operations. + * + * @return the ClusterVersionsClient object. + */ + public ClusterVersionsClient getClusterVersions() { + return this.clusterVersions; + } + /** * Initializes an instance of ServiceFabricManagementClient client. * @@ -234,24 +252,25 @@ public ServicesClient getServices() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The customer subscription identifier. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ServiceFabricManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-06-01"; - this.clusters = new ClustersClientImpl(this); - this.clusterVersions = new ClusterVersionsClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-03-01-preview"; this.operations = new OperationsClientImpl(this); + this.clusters = new ClustersClientImpl(this); + this.unsupportedVmSizes = new UnsupportedVmSizesClientImpl(this); this.applicationTypes = new ApplicationTypesClientImpl(this); this.applicationTypeVersions = new ApplicationTypeVersionsClientImpl(this); this.applications = new ApplicationsClientImpl(this); this.services = new ServicesClientImpl(this); + this.clusterVersions = new ClusterVersionsClientImpl(this); } /** @@ -291,6 +310,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java index d13e87e63eae..1c3cb93e8bdf 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -181,8 +181,22 @@ public ServiceResourceImpl withProperties(ServiceResourceProperties properties) return this; } + public ServiceResourceImpl withSystemData(SystemData systemData) { + if (isInCreateMode()) { + this.innerModel().withSystemData(systemData); + return this; + } else { + this.updateParameters.withSystemData(systemData); + return this; + } + } + public ServiceResourceImpl withProperties(ServiceResourceUpdateProperties properties) { this.updateParameters.withProperties(properties); return this; } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java index ad4b8a5996c2..470c070f4915 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -28,13 +28,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.servicefabric.fluent.ServicesClient; import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; -import com.azure.resourcemanager.servicefabric.models.ServiceResourceList; +import com.azure.resourcemanager.servicefabric.implementation.models.ServiceResourceList; import com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -68,69 +69,122 @@ public final class ServicesClientImpl implements ServicesClient { * The interface defining all the services for ServiceFabricManagementClientServices to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "ServiceFabricManagem") + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientServices") public interface ServicesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + @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("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceResourceUpdate parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceResourceUpdate parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + @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("clusterName") String clusterName, @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceResourceUpdate parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("applicationName") String applicationName, @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("applicationName") String applicationName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -139,46 +193,26 @@ Mono> listNext(@PathParam(value = "nextLink", enco * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, serviceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -188,62 +222,16 @@ private Mono> getWithResponseAsync(String resourc * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric - * application resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationName, serviceName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a Service Fabric service resource. + * @return a Service Fabric service resource. * * Get a Service Fabric service resource created or in the process of being created in the Service Fabric - * application resource. - * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -259,7 +247,7 @@ private Mono getAsync(String resourceGroupName, String clu * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -267,13 +255,17 @@ private Mono getAsync(String resourceGroupName, String clu * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, applicationName, serviceName, accept, context); } /** @@ -282,14 +274,16 @@ public Response getWithResponse(String resourceGroupName, * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -303,7 +297,7 @@ public ServiceResourceInner get(String resourceGroupName, String clusterName, St * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -316,38 +310,12 @@ public ServiceResourceInner get(String resourceGroupName, String clusterName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, serviceName, this.client.getApiVersion(), parameters, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -356,52 +324,24 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the service resource along with {@link Response} on successful completion of {@link Mono}. + * @return the service resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName, ServiceResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, serviceName, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, contentType, + accept, parameters, Context.NONE); } /** @@ -409,24 +349,25 @@ private Mono>> createOrUpdateWithResponseAsync(String * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the service resource. + * @return the service resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, String serviceName, - ServiceResourceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceResourceInner.class, ServiceResourceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName, ServiceResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, contentType, + accept, parameters, context); } /** @@ -434,12 +375,11 @@ private PollerFlux, ServiceResourceInner> begin * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -448,12 +388,11 @@ private PollerFlux, ServiceResourceInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, String clusterName, String applicationName, String serviceName, - ServiceResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, - applicationName, serviceName, parameters, context); + ServiceResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceResourceInner.class, ServiceResourceInner.class, context); + ServiceResourceInner.class, ServiceResourceInner.class, this.client.getContext()); } /** @@ -461,7 +400,7 @@ private PollerFlux, ServiceResourceInner> begin * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -475,8 +414,10 @@ private PollerFlux, ServiceResourceInner> begin public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters); + return this.client.getLroResult(response, + ServiceResourceInner.class, ServiceResourceInner.class, Context.NONE); } /** @@ -484,7 +425,7 @@ public SyncPoller, ServiceResourceInner> beginC * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -499,9 +440,10 @@ public SyncPoller, ServiceResourceInner> beginC public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, applicationName, + serviceName, parameters, context); + return this.client.getLroResult(response, + ServiceResourceInner.class, ServiceResourceInner.class, context); } /** @@ -509,7 +451,7 @@ public SyncPoller, ServiceResourceInner> beginC * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -531,30 +473,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param parameters The service resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the service resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName, ServiceResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a Service Fabric service resource. - * - * Create or update a Service Fabric service resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -567,7 +486,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public ServiceResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters) + .getFinalResult(); } /** @@ -575,7 +495,7 @@ public ServiceResourceInner createOrUpdate(String resourceGroupName, String clus * * Create or update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -589,8 +509,8 @@ public ServiceResourceInner createOrUpdate(String resourceGroupName, String clus @ServiceMethod(returns = ReturnType.SINGLE) public ServiceResourceInner createOrUpdate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) - .block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) + .getFinalResult(); } /** @@ -598,7 +518,7 @@ public ServiceResourceInner createOrUpdate(String resourceGroupName, String clus * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -611,38 +531,12 @@ public ServiceResourceInner createOrUpdate(String resourceGroupName, String clus @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, serviceName, this.client.getApiVersion(), parameters, - accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -651,51 +545,24 @@ private Mono>> updateWithResponseAsync(String resource * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource for patch operations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the service resource along with {@link Response} on successful completion of {@link Mono}. + * @return the service resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName, ServiceResourceUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response updateWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName, ServiceResourceUpdate parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, serviceName, this.client.getApiVersion(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, contentType, + accept, parameters, Context.NONE); } /** @@ -703,24 +570,25 @@ private Mono>> updateWithResponseAsync(String resource * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource for patch operations. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the service resource. + * @return the service resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ServiceResourceInner> beginUpdateAsync( - String resourceGroupName, String clusterName, String applicationName, String serviceName, - ServiceResourceUpdate parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceResourceInner.class, ServiceResourceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName, ServiceResourceUpdate parameters, 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, clusterName, applicationName, serviceName, contentType, + accept, parameters, context); } /** @@ -728,12 +596,11 @@ private PollerFlux, ServiceResourceInner> begin * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @param parameters The service resource for patch operations. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -742,12 +609,11 @@ private PollerFlux, ServiceResourceInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceResourceInner> beginUpdateAsync( String resourceGroupName, String clusterName, String applicationName, String serviceName, - ServiceResourceUpdate parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, - serviceName, parameters, context); + ServiceResourceUpdate parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ServiceResourceInner.class, ServiceResourceInner.class, context); + ServiceResourceInner.class, ServiceResourceInner.class, this.client.getContext()); } /** @@ -755,7 +621,7 @@ private PollerFlux, ServiceResourceInner> begin * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -768,8 +634,10 @@ private PollerFlux, ServiceResourceInner> begin @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceResourceInner> beginUpdate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdate parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters); + return this.client.getLroResult(response, + ServiceResourceInner.class, ServiceResourceInner.class, Context.NONE); } /** @@ -777,7 +645,7 @@ public SyncPoller, ServiceResourceInner> beginU * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -792,8 +660,10 @@ public SyncPoller, ServiceResourceInner> beginU public SyncPoller, ServiceResourceInner> beginUpdate(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdate parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) - .getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters, context); + return this.client.getLroResult(response, + ServiceResourceInner.class, ServiceResourceInner.class, context); } /** @@ -801,7 +671,7 @@ public SyncPoller, ServiceResourceInner> beginU * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -823,31 +693,7 @@ private Mono updateAsync(String resourceGroupName, String * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param parameters The service resource for patch operations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the service resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, String applicationName, - String serviceName, ServiceResourceUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Service Fabric service resource. - * - * Update a Service Fabric service resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -860,7 +706,7 @@ private Mono updateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public ServiceResourceInner update(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdate parameters) { - return updateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters).block(); + return beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters).getFinalResult(); } /** @@ -868,7 +714,7 @@ public ServiceResourceInner update(String resourceGroupName, String clusterName, * * Update a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -882,7 +728,8 @@ public ServiceResourceInner update(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public ServiceResourceInner update(String resourceGroupName, String clusterName, String applicationName, String serviceName, ServiceResourceUpdate parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context).block(); + return beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) + .getFinalResult(); } /** @@ -890,7 +737,7 @@ public ServiceResourceInner update(String resourceGroupName, String clusterName, * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -902,33 +749,9 @@ public ServiceResourceInner update(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, String serviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, serviceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -937,45 +760,21 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, applicationName, serviceName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, + Context.NONE); } /** @@ -983,22 +782,21 @@ private Mono>> deleteWithResponseAsync(String resource * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, + String applicationName, String serviceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, serviceName, context); } /** @@ -1006,11 +804,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1018,12 +815,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String applicationName, String serviceName, Context context) { - context = this.client.mergeContext(context); + String applicationName, String serviceName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1031,7 +827,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -1043,7 +839,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, applicationName, serviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1051,7 +849,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -1064,8 +862,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName, context) - .getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, clusterName, applicationName, serviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1073,7 +872,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -1094,29 +893,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. - * @param clusterName The name of the cluster resource. - * @param applicationName The name of the application resource. - * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 clusterName, String applicationName, - String serviceName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Service Fabric service resource. - * - * Delete a Service Fabric service resource with the specified name. - * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -1126,7 +903,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { - deleteAsync(resourceGroupName, clusterName, applicationName, serviceName).block(); + beginDelete(resourceGroupName, clusterName, applicationName, serviceName).getFinalResult(); } /** @@ -1134,7 +911,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -1146,7 +923,7 @@ public void delete(String resourceGroupName, String clusterName, String applicat @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { - deleteAsync(resourceGroupName, clusterName, applicationName, serviceName, context).block(); + beginDelete(resourceGroupName, clusterName, applicationName, serviceName, context).getFinalResult(); } /** @@ -1154,41 +931,24 @@ public void delete(String resourceGroupName, String clusterName, String applicat * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, String applicationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, 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())); @@ -1199,45 +959,22 @@ private Mono> listSinglePageAsync(String res * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, - String applicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (applicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - applicationName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, + String applicationName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1245,20 +982,25 @@ private Mono> listSinglePageAsync(String res * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedFlux}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, String applicationName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationName), - nextLink -> listNextSinglePageAsync(nextLink)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1266,21 +1008,26 @@ private PagedFlux listAsync(String resourceGroupName, Stri * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedFlux}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, String applicationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, applicationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1288,19 +1035,22 @@ private PagedFlux listAsync(String resourceGroupName, Stri * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, String applicationName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, applicationName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, applicationName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -1308,40 +1058,41 @@ public PagedIterable list(String resourceGroupName, String * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName, String applicationName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, applicationName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, applicationName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of service resources along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1350,6 +1101,31 @@ private Mono> listNextSinglePageAsync(String } /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the list of service resources created in the specified Service Fabric application resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1357,21 +1133,16 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of service resources along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java index b3b477cef2fb..6229b00f1da0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, Strin String applicationName, String serviceName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, clusterName, applicationName, serviceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceResourceImpl(inner.getValue(), this.manager())); } public ServiceResource get(String resourceGroupName, String clusterName, String applicationName, diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesClientImpl.java new file mode 100644 index 000000000000..41fc41184d23 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesClientImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; +import com.azure.resourcemanager.servicefabric.implementation.models.VMSizesResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UnsupportedVmSizesClient. + */ +public final class UnsupportedVmSizesClientImpl implements UnsupportedVmSizesClient { + /** + * The proxy service used to perform REST calls. + */ + private final UnsupportedVmSizesService service; + + /** + * The service client containing this operation class. + */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of UnsupportedVmSizesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UnsupportedVmSizesClientImpl(ServiceFabricManagementClientImpl client) { + this.service = RestProxy.create(UnsupportedVmSizesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientUnsupportedVmSizes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ServiceFabricManagementClientUnsupportedVmSizes") + public interface UnsupportedVmSizesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/unsupportedVmSizes/{vmSize}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("vmSize") String vmSize, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/unsupportedVmSizes/{vmSize}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("vmSize") String vmSize, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/unsupportedVmSizes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/unsupportedVmSizes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String vmSize) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, vmSize, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String vmSize) { + return getWithResponseAsync(location, vmSize).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String vmSize, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, vmSize, accept, context); + } + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VMSizeResourceInner get(String location, String vmSize) { + return getWithResponse(location, vmSize, Context.NONE).getValue(); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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 lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * 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 lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * 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 lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * 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 lists of unsupported vm sizes for Service Fabric Clusters along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesImpl.java new file mode 100644 index 000000000000..9bb064fa1bb7 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.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.servicefabric.fluent.UnsupportedVmSizesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; +import com.azure.resourcemanager.servicefabric.models.UnsupportedVmSizes; +import com.azure.resourcemanager.servicefabric.models.VMSizeResource; + +public final class UnsupportedVmSizesImpl implements UnsupportedVmSizes { + private static final ClientLogger LOGGER = new ClientLogger(UnsupportedVmSizesImpl.class); + + private final UnsupportedVmSizesClient innerClient; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public UnsupportedVmSizesImpl(UnsupportedVmSizesClient innerClient, + com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String vmSize, Context context) { + Response inner = this.serviceClient().getWithResponse(location, vmSize, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VMSizeResourceImpl(inner.getValue(), this.manager())); + } + + public VMSizeResource get(String location, String vmSize) { + VMSizeResourceInner inner = this.serviceClient().get(location, vmSize); + if (inner != null) { + return new VMSizeResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VMSizeResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VMSizeResourceImpl(inner1, this.manager())); + } + + private UnsupportedVmSizesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UpgradableVersionPathResultImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UpgradableVersionPathResultImpl.java index 58351d7d71a7..f1b8f23f4ec5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UpgradableVersionPathResultImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/UpgradableVersionPathResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/VMSizeResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/VMSizeResourceImpl.java new file mode 100644 index 000000000000..e75bf692ef86 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/VMSizeResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; +import com.azure.resourcemanager.servicefabric.models.VMSize; +import com.azure.resourcemanager.servicefabric.models.VMSizeResource; + +public final class VMSizeResourceImpl implements VMSizeResource { + private VMSizeResourceInner innerObject; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + VMSizeResourceImpl(VMSizeResourceInner innerObject, + com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VMSize properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VMSizeResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceList.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationResourceList.java similarity index 72% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceList.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationResourceList.java index eef25e36ae96..56cc88e1854d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceList.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The list of application resources. */ -@Fluent +@Immutable public final class ApplicationResourceList implements JsonSerializable { /* - * The value property. + * The ApplicationResource items on this page */ private List value; /* - * URL to get the next set of application list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ApplicationResourceList class. */ - public ApplicationResourceList() { + private ApplicationResourceList() { } /** - * Get the value property: The value property. + * Get the value property: The ApplicationResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ApplicationResourceList object itself. - */ - public ApplicationResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of application list results if there are any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApplicationResourceList 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 ApplicationResourceList. */ public static ApplicationResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResourceList.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeResourceList.java similarity index 72% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResourceList.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeResourceList.java index 21d981335e94..b1f332d7c18e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResourceList.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The list of application type names. */ -@Fluent +@Immutable public final class ApplicationTypeResourceList implements JsonSerializable { /* - * The value property. + * The ApplicationTypeResource items on this page */ private List value; /* - * URL to get the next set of application type list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ApplicationTypeResourceList class. */ - public ApplicationTypeResourceList() { + private ApplicationTypeResourceList() { } /** - * Get the value property: The value property. + * Get the value property: The ApplicationTypeResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ApplicationTypeResourceList object itself. - */ - public ApplicationTypeResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of application type list results if there are any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApplicationTypeResourceList 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 ApplicationTypeResourceList. */ public static ApplicationTypeResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResourceList.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeVersionResourceList.java similarity index 72% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResourceList.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeVersionResourceList.java index 7d5896d28f6b..ed0d3fe071ba 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResourceList.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeVersionResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The list of application type version resources for the specified application type name resource. */ -@Fluent +@Immutable public final class ApplicationTypeVersionResourceList implements JsonSerializable { /* - * The value property. + * The ApplicationTypeVersionResource items on this page */ private List value; /* - * URL to get the next set of application type version list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ApplicationTypeVersionResourceList class. */ - public ApplicationTypeVersionResourceList() { + private ApplicationTypeVersionResourceList() { } /** - * Get the value property: The value property. + * Get the value property: The ApplicationTypeVersionResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ApplicationTypeVersionResourceList object itself. - */ - public ApplicationTypeVersionResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of application type version list results if there are any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApplicationTypeVersionResourceList 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 ApplicationTypeVersionResourceList. */ public static ApplicationTypeVersionResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ClusterListResult.java similarity index 65% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterListResult.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ClusterListResult.java index 21884077fa0f..9bf783e544b0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterListResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ClusterListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * Cluster list results. + * The response of a Cluster list operation. */ -@Fluent +@Immutable public final class ClusterListResult implements JsonSerializable { /* - * The value property. + * The Cluster items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ClusterListResult class. */ - public ClusterListResult() { + private ClusterListResult() { } /** - * Get the value property: The value property. + * Get the value property: The Cluster items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ClusterListResult object itself. - */ - public ClusterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ClusterListResult object itself. - */ - public ClusterListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ClusterListResult 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 ClusterListResult. */ public static ClusterListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/OperationListResult.java similarity index 78% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationListResult.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/OperationListResult.java index fa194715b443..ffdc813e5cd5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationListResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/OperationListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Describes the result of the request to list Service Fabric resource provider operations. */ -@Fluent +@Immutable public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the Service Fabric resource provider. @@ -31,7 +31,7 @@ public final class OperationListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: List of operations supported by the Service Fabric resource provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: URL to get the next set of operation list results if there are any. * @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceList.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ServiceResourceList.java similarity index 72% rename from sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceList.java rename to sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ServiceResourceList.java index c35821d7e95e..6ea8b64a1866 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceList.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ServiceResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicefabric.models; +package com.azure.resourcemanager.servicefabric.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The list of service resources. */ -@Fluent +@Immutable public final class ServiceResourceList implements JsonSerializable { /* - * The value property. + * The ServiceResource items on this page */ private List value; /* - * URL to get the next set of service list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ServiceResourceList class. */ - public ServiceResourceList() { + private ServiceResourceList() { } /** - * Get the value property: The value property. + * Get the value property: The ServiceResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ServiceResourceList object itself. - */ - public ServiceResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of service list results if there are any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ServiceResourceList 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 ServiceResourceList. */ public static ServiceResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/VMSizesResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/VMSizesResult.java new file mode 100644 index 000000000000..ff56871cfadd --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/VMSizesResult.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.servicefabric.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.servicefabric.fluent.models.VMSizeResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Describes the result of the request to list VM Sizes for Service Fabric Clusters. + */ +@Immutable +public final class VMSizesResult implements JsonSerializable { + /* + * The VMSizeResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of VMSizesResult class. + */ + private VMSizesResult() { + } + + /** + * Get the value property: The VMSizeResource 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 VMSizesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMSizesResult 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 VMSizesResult. + */ + public static VMSizesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMSizesResult deserializedVMSizesResult = new VMSizesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VMSizeResourceInner.fromJson(reader1)); + deserializedVMSizesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVMSizesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVMSizesResult; + }); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java index 26f185d68a3b..75925bac16c9 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for ServiceFabricManagementClient. - * Service Fabric Management Client. + * Package containing the implementations for ServiceFabric. + * Azure Service Fabric Resource Provider API Client. */ package com.azure.resourcemanager.servicefabric.implementation; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java index 19c7f2940f64..af85c05bbbce 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,22 +12,22 @@ */ public final class AddOnFeatures extends ExpandableStringEnum { /** - * Static value RepairManager for AddOnFeatures. + * Add on RepairManager. */ public static final AddOnFeatures REPAIR_MANAGER = fromString("RepairManager"); /** - * Static value DnsService for AddOnFeatures. + * Add on DnsService. */ public static final AddOnFeatures DNS_SERVICE = fromString("DnsService"); /** - * Static value BackupRestoreService for AddOnFeatures. + * Add on BackupRestoreService. */ public static final AddOnFeatures BACKUP_RESTORE_SERVICE = fromString("BackupRestoreService"); /** - * Static value ResourceMonitorService for AddOnFeatures. + * Add on ResourceMonitorService. */ public static final AddOnFeatures RESOURCE_MONITOR_SERVICE = fromString("ResourceMonitorService"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java index 653177f7af5f..5575bf3744e3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -80,24 +80,6 @@ public Map serviceTypeDeltaHealthPolicies( return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultServiceTypeDeltaHealthPolicy() != null) { - defaultServiceTypeDeltaHealthPolicy().validate(); - } - if (serviceTypeDeltaHealthPolicies() != null) { - serviceTypeDeltaHealthPolicies().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java index 4176c4f6f0fe..856896dd3ed7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -79,24 +79,6 @@ public Map serviceTypeHealthPolicies() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultServiceTypeHealthPolicy() != null) { - defaultServiceTypeHealthPolicy().validate(); - } - if (serviceTypeHealthPolicies() != null) { - serviceTypeHealthPolicies().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java index 74d47de81b0b..c520eff540db 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -177,14 +177,6 @@ public ApplicationMetricDescription withTotalApplicationCapacity(Long totalAppli return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java index 3974b154133c..3c9663b0f12c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -37,7 +37,7 @@ public interface ApplicationResource { String type(); /** - * Gets the identity property: Describes the managed identities for an Azure resource. + * Gets the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -201,7 +201,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, clusterName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @return the next definition stage. */ @@ -212,8 +212,9 @@ interface WithParentResource { * The stage of the ApplicationResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithIdentity, DefinitionStages.WithTypeName, DefinitionStages.WithTypeVersion, + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithSystemData, DefinitionStages.WithTypeName, DefinitionStages.WithTypeVersion, DefinitionStages.WithParameters, DefinitionStages.WithUpgradePolicy, DefinitionStages.WithMinimumNodes, DefinitionStages.WithMaximumNodes, DefinitionStages.WithRemoveApplicationCapacity, DefinitionStages.WithMetrics, DefinitionStages.WithManagedIdentities { @@ -272,14 +273,28 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: Describes the managed identities for an Azure resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Describes the managed identities for an Azure resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedIdentity identity); } + /** + * The stage of the ApplicationResource definition allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } + /** * The stage of the ApplicationResource definition allowing to specify typeName. */ @@ -425,9 +440,9 @@ interface WithManagedIdentities { /** * The template for ApplicationResource update. */ - interface Update extends UpdateStages.WithTypeVersion, UpdateStages.WithParameters, UpdateStages.WithUpgradePolicy, - UpdateStages.WithMinimumNodes, UpdateStages.WithMaximumNodes, UpdateStages.WithRemoveApplicationCapacity, - UpdateStages.WithMetrics, UpdateStages.WithManagedIdentities { + interface Update extends UpdateStages.WithSystemData, UpdateStages.WithTypeVersion, UpdateStages.WithParameters, + UpdateStages.WithUpgradePolicy, UpdateStages.WithMinimumNodes, UpdateStages.WithMaximumNodes, + UpdateStages.WithRemoveApplicationCapacity, UpdateStages.WithMetrics, UpdateStages.WithManagedIdentities { /** * Executes the update request. * @@ -448,6 +463,20 @@ interface Update extends UpdateStages.WithTypeVersion, UpdateStages.WithParamete * The ApplicationResource update stages. */ interface UpdateStages { + /** + * The stage of the ApplicationResource update allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + Update withSystemData(SystemData systemData); + } + /** * The stage of the ApplicationResource update allowing to specify typeVersion. */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java index cdf3010ec157..bc237b86f54a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -133,6 +133,17 @@ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -361,17 +372,6 @@ public ApplicationResourceUpdate withManagedIdentities(List writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java index b13192c20601..8c611804c529 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -123,7 +123,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, clusterName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @return the next definition stage. */ @@ -134,7 +134,8 @@ interface WithParentResource { * The stage of the ApplicationTypeResource 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.WithLocation, DefinitionStages.WithTags { + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithSystemData { /** * Executes the create request. * @@ -184,6 +185,20 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** + * The stage of the ApplicationTypeResource definition allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } } /** @@ -196,7 +211,7 @@ interface WithTags { /** * The template for ApplicationTypeResource update. */ - interface Update { + interface Update extends UpdateStages.WithSystemData { /** * Executes the update request. * @@ -217,6 +232,19 @@ interface Update { * The ApplicationTypeResource update stages. */ interface UpdateStages { + /** + * The stage of the ApplicationTypeResource update allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + Update withSystemData(SystemData systemData); + } } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java index 1cb6ec4aa956..0af91fd2af16 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -138,7 +138,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, clusterName, applicationTypeName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @return the next definition stage. @@ -151,8 +151,8 @@ WithCreate withExistingApplicationType(String resourceGroupName, String clusterN * The stage of the ApplicationTypeVersionResource 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithAppPackageUrl { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithSystemData, DefinitionStages.WithAppPackageUrl { /** * Executes the create request. * @@ -203,6 +203,20 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the ApplicationTypeVersionResource definition allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } + /** * The stage of the ApplicationTypeVersionResource definition allowing to specify appPackageUrl. */ @@ -227,7 +241,7 @@ interface WithAppPackageUrl { /** * The template for ApplicationTypeVersionResource update. */ - interface Update extends UpdateStages.WithAppPackageUrl { + interface Update extends UpdateStages.WithSystemData, UpdateStages.WithAppPackageUrl { /** * Executes the update request. * @@ -248,6 +262,20 @@ interface Update extends UpdateStages.WithAppPackageUrl { * The ApplicationTypeVersionResource update stages. */ interface UpdateStages { + /** + * The stage of the ApplicationTypeVersionResource update allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + Update withSystemData(SystemData systemData); + } + /** * The stage of the ApplicationTypeVersionResource update allowing to specify appPackageUrl. */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java index dd71a54e1b21..c1f0d0bc1a0a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -18,7 +18,7 @@ public interface ApplicationTypeVersions { * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -26,8 +26,10 @@ public interface ApplicationTypeVersions { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); @@ -38,15 +40,17 @@ Response getWithResponse(String resourceGroupNam * Get a Service Fabric application type version resource created or in the process of being created in the Service * Fabric application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type 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 Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource. */ ApplicationTypeVersionResource get(String resourceGroupName, String clusterName, String applicationTypeName, String version); @@ -56,7 +60,7 @@ ApplicationTypeVersionResource get(String resourceGroupName, String clusterName, * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -71,7 +75,7 @@ ApplicationTypeVersionResource get(String resourceGroupName, String clusterName, * * Delete a Service Fabric application type version resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param version The application type version. @@ -90,13 +94,16 @@ void delete(String resourceGroupName, String clusterName, String applicationType * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, @@ -109,14 +116,17 @@ PagedIterable list(String resourceGroupName, Str * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type version resources created or in the process of being created in the Service Fabric + * @return the list of application type version resources created in the specified Service Fabric application type + * name resource. + * + * Gets all application type version resources created or in the process of being created in the Service Fabric * application type name resource as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, @@ -132,8 +142,10 @@ PagedIterable list(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response}. */ ApplicationTypeVersionResource getById(String id); @@ -148,8 +160,10 @@ PagedIterable list(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type version resource created or in the process of being created in the - * Service Fabric application type name resource along with {@link Response}. + * @return a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the process of being created in the Service + * Fabric application type name resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java index c697f0079672..4c4d457535af 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The ApplicationTypeVersionsCleanupPolicy model. + * The policy used to clean up unused versions. */ @Fluent public final class ApplicationTypeVersionsCleanupPolicy @@ -48,14 +48,6 @@ public ApplicationTypeVersionsCleanupPolicy withMaxUnusedVersionsToKeep(long max return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java index 4390c858f0fb..d7bf9979a5a5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -18,14 +18,16 @@ public interface ApplicationTypes { * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String clusterName, @@ -37,13 +39,15 @@ Response getWithResponse(String resourceGroupName, Stri * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource. */ ApplicationTypeResource get(String resourceGroupName, String clusterName, String applicationTypeName); @@ -53,7 +57,7 @@ Response getWithResponse(String resourceGroupName, Stri * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,7 +71,7 @@ Response getWithResponse(String resourceGroupName, Stri * * Delete a Service Fabric application type name resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationTypeName The name of the application type name resource. * @param context The context to associate with this operation. @@ -83,13 +87,15 @@ Response getWithResponse(String resourceGroupName, Stri * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName); @@ -99,14 +105,16 @@ Response getWithResponse(String resourceGroupName, Stri * Gets all application type name resources created or in the process of being created in the Service Fabric cluster * resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application type name resources created or in the process of being created in the Service Fabric - * cluster resource as paginated response with {@link PagedIterable}. + * @return the list of application type name resources created in the specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being created in the Service Fabric cluster + * resource as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, Context context); @@ -120,7 +128,9 @@ Response getWithResponse(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response}. */ ApplicationTypeResource getById(String id); @@ -136,7 +146,9 @@ Response getWithResponse(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application type name resource created or in the process of being created in the Service + * @return a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the process of being created in the Service * Fabric cluster resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java index 584e08daf4a2..2a6d88c29cbb 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -193,20 +193,6 @@ public ApplicationUpgradePolicy withRecreateApplication(Boolean recreateApplicat return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rollingUpgradeMonitoringPolicy() != null) { - rollingUpgradeMonitoringPolicy().validate(); - } - if (applicationHealthPolicy() != null) { - applicationHealthPolicy().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java index 4da9b5d59686..dfdb9103b64a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,7 +12,7 @@ import java.io.IOException; /** - * The ApplicationUserAssignedIdentity model. + * Describes a user assigned identity for the application. */ @Fluent public final class ApplicationUserAssignedIdentity implements JsonSerializable { @@ -73,26 +72,6 @@ public ApplicationUserAssignedIdentity withPrincipalId(String principalId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property name in model ApplicationUserAssignedIdentity")); - } - if (principalId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property principalId in model ApplicationUserAssignedIdentity")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationUserAssignedIdentity.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java index 9bdfb34de2dd..a32141b2ee8b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -18,14 +18,16 @@ public interface Applications { * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String clusterName, String applicationName, @@ -37,13 +39,15 @@ Response getWithResponse(String resourceGroupName, String c * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource. */ ApplicationResource get(String resourceGroupName, String clusterName, String applicationName); @@ -53,7 +57,7 @@ Response getWithResponse(String resourceGroupName, String c * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,7 +71,7 @@ Response getWithResponse(String resourceGroupName, String c * * Delete a Service Fabric application resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. @@ -82,13 +86,15 @@ Response getWithResponse(String resourceGroupName, String c * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName); @@ -97,14 +103,16 @@ Response getWithResponse(String resourceGroupName, String c * * Gets all application resources created or in the process of being created in the Service Fabric cluster resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all application resources created or in the process of being created in the Service Fabric cluster - * resource as paginated response with {@link PagedIterable}. + * @return the list of application resources created in the specified Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in the Service Fabric cluster resource + * as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, Context context); @@ -118,7 +126,9 @@ Response getWithResponse(String resourceGroupName, String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response}. */ ApplicationResource getById(String id); @@ -134,7 +144,9 @@ Response getWithResponse(String resourceGroupName, String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * @return a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric * cluster resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java index fa9bf673ea06..e5e155720eca 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -148,24 +148,6 @@ public Map serviceTypeHealthPolicyMap() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultServiceTypeHealthPolicy() != null) { - defaultServiceTypeHealthPolicy().validate(); - } - if (serviceTypeHealthPolicyMap() != null) { - serviceTypeHealthPolicyMap().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java index c13d7e7a575a..d34b019afee7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -22,37 +22,34 @@ public final class ArmRollingUpgradeMonitoringPolicy implements JsonSerializable private ArmUpgradeFailureAction failureAction; /* - * The amount of time to wait after completing an upgrade domain before applying health policies. It is first - * interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number - * representing the total number of milliseconds. + * The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted + * as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ private String healthCheckWaitDuration; /* * The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next - * upgrade domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is - * interpreted as a number representing the total number of milliseconds. + * upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format + * "hh:mm:ss.fff". */ private String healthCheckStableDuration; /* * The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction - * is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is - * interpreted as a number representing the total number of milliseconds. + * is executed. It is interpreted as a string representing an ISO 8601 duration with following format + * "hh:mm:ss.fff". */ private String healthCheckRetryTimeout; /* - * The amount of time the overall upgrade has to complete before FailureAction is executed. It is first interpreted - * as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the - * total number of milliseconds. + * The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 + * hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ private String upgradeTimeout; /* - * The amount of time each upgrade domain has to complete before FailureAction is executed. It is first interpreted - * as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the - * total number of milliseconds. + * The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 + * hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ private String upgradeDomainTimeout; @@ -84,8 +81,8 @@ public ArmRollingUpgradeMonitoringPolicy withFailureAction(ArmUpgradeFailureActi /** * Get the healthCheckWaitDuration property: The amount of time to wait after completing an upgrade domain before - * applying health policies. It is first interpreted as a string representing an ISO 8601 duration. If that fails, - * then it is interpreted as a number representing the total number of milliseconds. + * applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format + * "hh:mm:ss.fff". * * @return the healthCheckWaitDuration value. */ @@ -95,8 +92,8 @@ public String healthCheckWaitDuration() { /** * Set the healthCheckWaitDuration property: The amount of time to wait after completing an upgrade domain before - * applying health policies. It is first interpreted as a string representing an ISO 8601 duration. If that fails, - * then it is interpreted as a number representing the total number of milliseconds. + * applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format + * "hh:mm:ss.fff". * * @param healthCheckWaitDuration the healthCheckWaitDuration value to set. * @return the ArmRollingUpgradeMonitoringPolicy object itself. @@ -108,9 +105,8 @@ public ArmRollingUpgradeMonitoringPolicy withHealthCheckWaitDuration(String heal /** * Get the healthCheckStableDuration property: The amount of time that the application or cluster must remain - * healthy before the upgrade proceeds to the next upgrade domain. It is first interpreted as a string representing - * an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of - * milliseconds. + * healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO + * 8601 duration with following format "hh:mm:ss.fff". * * @return the healthCheckStableDuration value. */ @@ -120,9 +116,8 @@ public String healthCheckStableDuration() { /** * Set the healthCheckStableDuration property: The amount of time that the application or cluster must remain - * healthy before the upgrade proceeds to the next upgrade domain. It is first interpreted as a string representing - * an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of - * milliseconds. + * healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO + * 8601 duration with following format "hh:mm:ss.fff". * * @param healthCheckStableDuration the healthCheckStableDuration value to set. * @return the ArmRollingUpgradeMonitoringPolicy object itself. @@ -134,8 +129,8 @@ public ArmRollingUpgradeMonitoringPolicy withHealthCheckStableDuration(String he /** * Get the healthCheckRetryTimeout property: The amount of time to retry health evaluation when the application or - * cluster is unhealthy before FailureAction is executed. It is first interpreted as a string representing an ISO - * 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 + * duration with following format "hh:mm:ss.fff". * * @return the healthCheckRetryTimeout value. */ @@ -145,8 +140,8 @@ public String healthCheckRetryTimeout() { /** * Set the healthCheckRetryTimeout property: The amount of time to retry health evaluation when the application or - * cluster is unhealthy before FailureAction is executed. It is first interpreted as a string representing an ISO - * 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 + * duration with following format "hh:mm:ss.fff". * * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set. * @return the ArmRollingUpgradeMonitoringPolicy object itself. @@ -158,8 +153,8 @@ public ArmRollingUpgradeMonitoringPolicy withHealthCheckRetryTimeout(String heal /** * Get the upgradeTimeout property: The amount of time the overall upgrade has to complete before FailureAction is - * executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is - * interpreted as a number representing the total number of milliseconds. + * executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with + * following format "hh:mm:ss.fff". * * @return the upgradeTimeout value. */ @@ -169,8 +164,8 @@ public String upgradeTimeout() { /** * Set the upgradeTimeout property: The amount of time the overall upgrade has to complete before FailureAction is - * executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is - * interpreted as a number representing the total number of milliseconds. + * executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with + * following format "hh:mm:ss.fff". * * @param upgradeTimeout the upgradeTimeout value to set. * @return the ArmRollingUpgradeMonitoringPolicy object itself. @@ -182,8 +177,8 @@ public ArmRollingUpgradeMonitoringPolicy withUpgradeTimeout(String upgradeTimeou /** * Get the upgradeDomainTimeout property: The amount of time each upgrade domain has to complete before - * FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, - * then it is interpreted as a number representing the total number of milliseconds. + * FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 + * duration with following format "hh:mm:ss.fff". * * @return the upgradeDomainTimeout value. */ @@ -193,8 +188,8 @@ public String upgradeDomainTimeout() { /** * Set the upgradeDomainTimeout property: The amount of time each upgrade domain has to complete before - * FailureAction is executed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, - * then it is interpreted as a number representing the total number of milliseconds. + * FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 + * duration with following format "hh:mm:ss.fff". * * @param upgradeDomainTimeout the upgradeDomainTimeout value to set. * @return the ArmRollingUpgradeMonitoringPolicy object itself. @@ -204,14 +199,6 @@ public ArmRollingUpgradeMonitoringPolicy withUpgradeDomainTimeout(String upgrade return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java index 959d285f1186..913ba88451df 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,12 +12,12 @@ */ public final class ArmServicePackageActivationMode extends ExpandableStringEnum { /** - * Static value SharedProcess for ArmServicePackageActivationMode. + * Indicates the application package activation mode will use shared process. */ public static final ArmServicePackageActivationMode SHARED_PROCESS = fromString("SharedProcess"); /** - * Static value ExclusiveProcess for ArmServicePackageActivationMode. + * Indicates the application package activation mode will use exclusive process. */ public static final ArmServicePackageActivationMode EXCLUSIVE_PROCESS = fromString("ExclusiveProcess"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java index 82cf189b1f40..de5c3866ff2e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -107,14 +107,6 @@ public Integer maxPercentUnhealthyReplicasPerPartition() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java index 593f081ada8e..aaa33578a5a3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,12 +12,13 @@ */ public final class ArmUpgradeFailureAction extends ExpandableStringEnum { /** - * Static value Rollback for ArmUpgradeFailureAction. + * Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade fails. */ public static final ArmUpgradeFailureAction ROLLBACK = fromString("Rollback"); /** - * Static value Manual for ArmUpgradeFailureAction. + * Indicates that a manual repair will need to be performed by the administrator if the upgrade fails. Service + * Fabric will not proceed to the next upgrade domain automatically. */ public static final ArmUpgradeFailureAction MANUAL = fromString("Manual"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java index 820f133a2eba..69cc18c14b25 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Operation supported by the Service Fabric resource provider. */ -@Fluent +@Immutable public final class AvailableOperationDisplay implements JsonSerializable { /* * The name of the provider. @@ -39,7 +39,7 @@ public final class AvailableOperationDisplay implements JsonSerializable notifications(); + /** + * Gets the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @return the enableHttpGatewayExclusiveAuthMode value. + */ + Boolean enableHttpGatewayExclusiveAuthMode(); + /** * Gets the region of the resource. * @@ -409,7 +418,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -432,7 +441,8 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithAdd DefinitionStages.WithSfZonalUpgradeMode, DefinitionStages.WithVmssZonalUpgradeMode, DefinitionStages.WithInfrastructureServiceManager, DefinitionStages.WithUpgradeWave, DefinitionStages.WithUpgradePauseStartTimestampUtc, DefinitionStages.WithUpgradePauseEndTimestampUtc, - DefinitionStages.WithWaveUpgradePaused, DefinitionStages.WithNotifications { + DefinitionStages.WithWaveUpgradePaused, DefinitionStages.WithNotifications, + DefinitionStages.WithEnableHttpGatewayExclusiveAuthMode { /** * Executes the create request. * @@ -654,8 +664,7 @@ interface WithReliabilityLevel { * test clusters. * - Silver - Run the System services with a target replica set count of 5. * - Gold - Run the System services with a target replica set count of 7. - * - Platinum - Run the System services with a target replica set count of 9. - * . + * - Platinum - Run the System services with a target replica set count of 9.. * * @param reliabilityLevel The reliability level sets the replica set size of system services. Learn about * [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). @@ -875,6 +884,23 @@ interface WithNotifications { */ WithCreate withNotifications(List notifications); } + + /** + * The stage of the Cluster definition allowing to specify enableHttpGatewayExclusiveAuthMode. + */ + interface WithEnableHttpGatewayExclusiveAuthMode { + /** + * Specifies the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not + * allowed on the HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If + * token-based authentication is used, HttpGatewayTokenAuthEndpointPort must be defined.. + * + * @param enableHttpGatewayExclusiveAuthMode If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based + * authentication is used, HttpGatewayTokenAuthEndpointPort must be defined. + * @return the next definition stage. + */ + WithCreate withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode); + } } /** @@ -896,7 +922,8 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithAddOnFeatures, UpdateStages.WithUpgradeMode, UpdateStages.WithSfZonalUpgradeMode, UpdateStages.WithVmssZonalUpgradeMode, UpdateStages.WithInfrastructureServiceManager, UpdateStages.WithUpgradeWave, UpdateStages.WithUpgradePauseStartTimestampUtc, UpdateStages.WithUpgradePauseEndTimestampUtc, - UpdateStages.WithWaveUpgradePaused, UpdateStages.WithNotifications { + UpdateStages.WithWaveUpgradePaused, UpdateStages.WithNotifications, + UpdateStages.WithEnableHttpGatewayExclusiveAuthMode { /** * Executes the update request. * @@ -1083,8 +1110,7 @@ interface WithReliabilityLevel { * test clusters. * - Silver - Run the System services with a target replica set count of 5. * - Gold - Run the System services with a target replica set count of 7. - * - Platinum - Run the System services with a target replica set count of 9. - * . + * - Platinum - Run the System services with a target replica set count of 9.. * * @param reliabilityLevel The reliability level sets the replica set size of system services. Learn about * [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). @@ -1273,6 +1299,23 @@ interface WithNotifications { */ Update withNotifications(List notifications); } + + /** + * The stage of the Cluster update allowing to specify enableHttpGatewayExclusiveAuthMode. + */ + interface WithEnableHttpGatewayExclusiveAuthMode { + /** + * Specifies the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not + * allowed on the HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If + * token-based authentication is used, HttpGatewayTokenAuthEndpointPort must be defined.. + * + * @param enableHttpGatewayExclusiveAuthMode If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based + * authentication is used, HttpGatewayTokenAuthEndpointPort must be defined. + * @return the next definition stage. + */ + Update withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode); + } } /** @@ -1303,7 +1346,8 @@ interface WithNotifications { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given along with {@link Response}. */ Response listUpgradableVersionsWithResponse(UpgradableVersionsDescription versionsDescription, Context context); @@ -1318,7 +1362,8 @@ interface WithNotifications { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given. */ UpgradableVersionPathResult listUpgradableVersions(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java index b0cec5a8a523..6b0eb63189cc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,14 +12,14 @@ */ public interface ClusterCodeVersionsListResult { /** - * Gets the value property: The value property. + * Gets the value property: The ClusterCodeVersions items on this page. * * @return the value value. */ List value(); /** - * Gets the nextLink property: The URL to use for getting the next set of results. + * Gets the nextLink property: The link to the next page of items. * * @return the nextLink value. */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java index 2bd08d266a7f..6634e32969c4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The result of the Service Fabric runtime versions. */ -@Fluent +@Immutable public final class ClusterCodeVersionsResult implements JsonSerializable { /* * The identification of the result @@ -40,7 +40,7 @@ public final class ClusterCodeVersionsResult implements JsonSerializable { /** - * Static value Windows for ClusterEnvironment. + * Windows operating system. */ public static final ClusterEnvironment WINDOWS = fromString("Windows"); /** - * Static value Linux for ClusterEnvironment. + * Linux operating system. */ public static final ClusterEnvironment LINUX = fromString("Linux"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java index 0026fc28d162..5f3c030f7af1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -165,21 +165,6 @@ public Map applicationHealthPolicies() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (applicationHealthPolicies() != null) { - applicationHealthPolicies().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java index 947fdade9f1e..f3e18b7f81af 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -9,72 +9,61 @@ /** * The current state of the cluster. - * - * - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service - * Fabric VM extension to boot up and report to it. - * - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in - * this state until the cluster boots up and system services are up. - * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is - * automatically initiated when the cluster boots up for the first time. - * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration. - * - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate. - * - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime - * version. This happens only when the **upgradeMode** is set to 'Automatic'. - * - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being - * upgraded to the expected version. - * - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource - * Provider. Clusters in this state cannot be managed by the Resource Provider. - * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted. - * - Ready - Indicates that the cluster is in a stable state. */ public final class ClusterState extends ExpandableStringEnum { /** - * Static value WaitingForNodes for ClusterState. + * Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM + * extension to boot up and report to it. */ public static final ClusterState WAITING_FOR_NODES = fromString("WaitingForNodes"); /** - * Static value Deploying for ClusterState. + * Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state + * until the cluster boots up and system services are up. */ public static final ClusterState DEPLOYING = fromString("Deploying"); /** - * Static value BaselineUpgrade for ClusterState. + * Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically + * initiated when the cluster boots up for the first time. */ public static final ClusterState BASELINE_UPGRADE = fromString("BaselineUpgrade"); /** - * Static value UpdatingUserConfiguration for ClusterState. + * Indicates that the cluster is being upgraded with the user provided configuration. */ public static final ClusterState UPDATING_USER_CONFIGURATION = fromString("UpdatingUserConfiguration"); /** - * Static value UpdatingUserCertificate for ClusterState. + * Indicates that the cluster is being upgraded with the user provided certificate. */ public static final ClusterState UPDATING_USER_CERTIFICATE = fromString("UpdatingUserCertificate"); /** - * Static value UpdatingInfrastructure for ClusterState. + * Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only + * when the **upgradeMode** is set to 'Automatic'. */ public static final ClusterState UPDATING_INFRASTRUCTURE = fromString("UpdatingInfrastructure"); /** - * Static value EnforcingClusterVersion for ClusterState. + * Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected + * version. */ public static final ClusterState ENFORCING_CLUSTER_VERSION = fromString("EnforcingClusterVersion"); /** - * Static value UpgradeServiceUnreachable for ClusterState. + * Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this + * state cannot be managed by the Resource Provider. */ public static final ClusterState UPGRADE_SERVICE_UNREACHABLE = fromString("UpgradeServiceUnreachable"); /** - * Static value AutoScale for ClusterState. + * Indicates that the ReliabilityLevel of the cluster is being adjusted. */ public static final ClusterState AUTO_SCALE = fromString("AutoScale"); /** - * Static value Ready for ClusterState. + * Indicates that the cluster is in a stable state. */ public static final ClusterState READY = fromString("Ready"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java index afdf7e80c359..6d77792ac497 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -626,14 +626,30 @@ public ClusterUpdateParameters withNotifications(List notification } /** - * Validates the instance. + * Get the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the enableHttpGatewayExclusiveAuthMode value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public Boolean enableHttpGatewayExclusiveAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpGatewayExclusiveAuthMode(); + } + + /** + * Set the enableHttpGatewayExclusiveAuthMode property: If true, token-based authentication is not allowed on the + * HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is + * used, HttpGatewayTokenAuthEndpointPort must be defined. + * + * @param enableHttpGatewayExclusiveAuthMode the enableHttpGatewayExclusiveAuthMode value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withEnableHttpGatewayExclusiveAuthMode(Boolean enableHttpGatewayExclusiveAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPropertiesUpdateParameters(); } + this.innerProperties().withEnableHttpGatewayExclusiveAuthMode(enableHttpGatewayExclusiveAuthMode); + return this; } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeCadence.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeCadence.java index c7138bca2777..23b423462db8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeCadence.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeCadence.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,17 +12,17 @@ */ public final class ClusterUpgradeCadence extends ExpandableStringEnum { /** - * Static value Wave0 for ClusterUpgradeCadence. + * Cluster upgrade starts immediately after a new version is rolled out. Recommended for Test/Dev clusters. */ public static final ClusterUpgradeCadence WAVE0 = fromString("Wave0"); /** - * Static value Wave1 for ClusterUpgradeCadence. + * Cluster upgrade starts 7 days after a new version is rolled out. Recommended for Pre-prod clusters. */ public static final ClusterUpgradeCadence WAVE1 = fromString("Wave1"); /** - * Static value Wave2 for ClusterUpgradeCadence. + * Cluster upgrade starts 14 days after a new version is rolled out. Recommended for Production clusters. */ public static final ClusterUpgradeCadence WAVE2 = fromString("Wave2"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java index c41b334a9fa0..6eef1acc682a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -171,21 +171,6 @@ public Map applicationDeltaHealthPolicies( return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (applicationDeltaHealthPolicies() != null) { - applicationDeltaHealthPolicies().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java index b72bdd0efd9c..e1e75b02be7f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -279,56 +278,6 @@ public ClusterUpgradePolicy withDeltaHealthPolicy(ClusterUpgradeDeltaHealthPolic return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (upgradeReplicaSetCheckTimeout() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property upgradeReplicaSetCheckTimeout in model ClusterUpgradePolicy")); - } - if (healthCheckWaitDuration() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property healthCheckWaitDuration in model ClusterUpgradePolicy")); - } - if (healthCheckStableDuration() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property healthCheckStableDuration in model ClusterUpgradePolicy")); - } - if (healthCheckRetryTimeout() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property healthCheckRetryTimeout in model ClusterUpgradePolicy")); - } - if (upgradeTimeout() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property upgradeTimeout in model ClusterUpgradePolicy")); - } - if (upgradeDomainTimeout() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property upgradeDomainTimeout in model ClusterUpgradePolicy")); - } - if (healthPolicy() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property healthPolicy in model ClusterUpgradePolicy")); - } else { - healthPolicy().validate(); - } - if (deltaHealthPolicy() != null) { - deltaHealthPolicy().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ClusterUpgradePolicy.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java index cdd87a5a93f3..88bacc5c2d3f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -16,13 +16,15 @@ public interface ClusterVersions { * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version along with {@link Response}. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version along with {@link Response}. */ Response getWithResponse(String location, String clusterVersion, Context context); @@ -31,12 +33,14 @@ public interface ClusterVersions { * * Gets information about an available Service Fabric cluster code version. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version. + * @return information about a Service Fabric cluster code version available in the specified location. + * + * Gets information about an available Service Fabric cluster code version. */ ClusterCodeVersionsListResult get(String location, String clusterVersion); @@ -45,14 +49,16 @@ public interface ClusterVersions { * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment along with + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment along with * {@link Response}. */ Response getByEnvironmentWithResponse(String location, @@ -63,13 +69,15 @@ Response getByEnvironmentWithResponse(String loca * * Gets information about an available Service Fabric cluster code version by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The name of the Azure region. * @param environment The operating system of the cluster. The default means all. * @param clusterVersion The cluster code 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 information about an available Service Fabric cluster code version by environment. + * @return information about a Service Fabric cluster code version available for the specified environment. + * + * Gets information about an available Service Fabric cluster code version by environment. */ ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVersionsEnvironment environment, String clusterVersion); @@ -79,12 +87,14 @@ ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVersionsE * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location along with {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location along with {@link Response}. */ Response listWithResponse(String location, Context context); @@ -93,11 +103,13 @@ ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVersionsE * * Gets all available code versions for Service Fabric cluster resources by location. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by location. + * @return the list of Service Fabric cluster code versions available for the specified location. + * + * Gets all available code versions for Service Fabric cluster resources by location. */ ClusterCodeVersionsListResult list(String location); @@ -106,14 +118,15 @@ ClusterCodeVersionsListResult getByEnvironment(String location, ClusterVersionsE * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment along with - * {@link Response}. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment along with {@link Response}. */ Response listByEnvironmentWithResponse(String location, ClusterVersionsEnvironment environment, Context context); @@ -123,12 +136,14 @@ Response listByEnvironmentWithResponse(String loc * * Gets all available code versions for Service Fabric cluster resources by environment. * - * @param location The location for the cluster code versions. This is different from cluster location. + * @param location The location name. * @param environment The operating system of the cluster. The default means all. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available code versions for Service Fabric cluster resources by environment. + * @return the list of Service Fabric cluster code versions available for the specified environment. + * + * Gets all available code versions for Service Fabric cluster resources by environment. */ ClusterCodeVersionsListResult listByEnvironment(String location, ClusterVersionsEnvironment environment); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java index 1e772f4ad4c0..723a1725a784 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * Defines values for ClusterVersionsEnvironment. + * The operating system or environment of the cluster version. */ public final class ClusterVersionsEnvironment extends ExpandableStringEnum { /** - * Static value Windows for ClusterVersionsEnvironment. + * Windows operating system. */ public static final ClusterVersionsEnvironment WINDOWS = fromString("Windows"); /** - * Static value Linux for ClusterVersionsEnvironment. + * Linux operating system. */ public static final ClusterVersionsEnvironment LINUX = fromString("Linux"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java index a795e6b9f02c..e1649754f85d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -17,14 +17,16 @@ public interface Clusters { * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); @@ -33,13 +35,14 @@ public interface Clusters { * * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ Cluster getByResourceGroup(String resourceGroupName, String clusterName); @@ -48,7 +51,7 @@ public interface Clusters { * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,7 +66,7 @@ public interface Clusters { * * Delete a Service Fabric cluster resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -76,11 +79,13 @@ public interface Clusters { * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -90,12 +95,14 @@ public interface Clusters { * * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. * - * @param resourceGroupName The name of the 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 all Service Fabric cluster resources created or in the process of being created in the resource group as + * @return the list of Service Fabric cluster resources created in the specified resource group. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group as * paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -107,7 +114,9 @@ public interface Clusters { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -121,7 +130,9 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Service Fabric cluster resources created or in the process of being created in the subscription as + * @return the list of Service Fabric cluster resources created in the specified subscription. + * + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription as * paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -134,14 +145,15 @@ public interface Clusters { * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param versionsDescription The upgrade path description with target 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 list of intermediate cluster code versions for an upgrade or downgrade along with {@link Response}. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given along with {@link Response}. */ Response listUpgradableVersionsWithResponse(String resourceGroupName, String clusterName, UpgradableVersionsDescription versionsDescription, Context context); @@ -154,12 +166,13 @@ Response listUpgradableVersionsWithResponse(String * version. If a target is given, it will provide the required path to get from the current cluster version to the * target version. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of intermediate cluster code versions for an upgrade or downgrade. + * @return the list of intermediate cluster code versions for an upgrade or downgrade, or minimum and maximum + * upgradable version if no target was given. */ UpgradableVersionPathResult listUpgradableVersions(String resourceGroupName, String clusterName); @@ -172,8 +185,10 @@ Response listUpgradableVersionsWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response}. */ Cluster getById(String id); @@ -187,8 +202,10 @@ Response listUpgradableVersionsWithResponse(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric cluster resource created or in the process of being created in the specified resource - * group along with {@link Response}. + * @return a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group + * along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java index 6f8a5f74630a..1fe63e363799 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -176,41 +175,6 @@ public DiagnosticsStorageAccountConfig withTableEndpoint(String tableEndpoint) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageAccountName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property storageAccountName in model DiagnosticsStorageAccountConfig")); - } - if (protectedAccountKeyName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property protectedAccountKeyName in model DiagnosticsStorageAccountConfig")); - } - if (blobEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property blobEndpoint in model DiagnosticsStorageAccountConfig")); - } - if (queueEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property queueEndpoint in model DiagnosticsStorageAccountConfig")); - } - if (tableEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property tableEndpoint in model DiagnosticsStorageAccountConfig")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiagnosticsStorageAccountConfig.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java index 5e2fc024ee25..01f3126d7e88 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -10,25 +10,21 @@ /** * The durability level of the node type. Learn about * [DurabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). - * - * - Bronze - No privileges. This is the default. - * - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD. - * - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only - * on full node VM skus like D15_V2, G5 etc. */ public final class DurabilityLevel extends ExpandableStringEnum { /** - * Static value Bronze for DurabilityLevel. + * No privileges. This is the default. */ public static final DurabilityLevel BRONZE = fromString("Bronze"); /** - * Static value Silver for DurabilityLevel. + * The infrastructure jobs can be paused for a duration of 10 minutes per UD. */ public static final DurabilityLevel SILVER = fromString("Silver"); /** - * Static value Gold for DurabilityLevel. + * The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on + * full node VM skus like D15_V2, G5 etc. */ public static final DurabilityLevel GOLD = fromString("Gold"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java index 977c2a25a1a1..65128b8b4b3d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -72,14 +72,6 @@ public EndpointRangeDescription withEndPort(int endPort) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java index 668d70954564..0cc26ca35cfe 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -110,21 +110,6 @@ public ManagedIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java index 637ae1fd1192..69aae8ddc2b3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -9,22 +9,22 @@ */ public enum ManagedIdentityType { /** - * Enum value SystemAssigned. + * Indicates that system assigned identity is associated with the resource. */ SYSTEM_ASSIGNED("SystemAssigned"), /** - * Enum value UserAssigned. + * Indicates that user assigned identity is associated with the resource. */ USER_ASSIGNED("UserAssigned"), /** - * Enum value SystemAssigned, UserAssigned. + * Indicates that both system assigned and user assigned identity are associated with the resource. */ SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), /** - * Enum value None. + * Indicates that no identity is associated with the resource. */ NONE("None"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java index 138171d982f1..51e208d9c0ae 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,22 +12,22 @@ */ public final class MoveCost extends ExpandableStringEnum { /** - * Static value Zero for MoveCost. + * Zero move cost. This value is zero. */ public static final MoveCost ZERO = fromString("Zero"); /** - * Static value Low for MoveCost. + * Specifies the move cost of the service as Low. The value is 1. */ public static final MoveCost LOW = fromString("Low"); /** - * Static value Medium for MoveCost. + * Specifies the move cost of the service as Medium. The value is 2. */ public static final MoveCost MEDIUM = fromString("Medium"); /** - * Static value High for MoveCost. + * Specifies the move cost of the service as High. The value is 3. */ public static final MoveCost HIGH = fromString("High"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java index febbb1dd309d..3cb505284a58 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -88,22 +87,6 @@ public NamedPartitionSchemeDescription withNames(List names) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (names() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property names in model NamedPartitionSchemeDescription")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NamedPartitionSchemeDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java index 6082c6c6d522..ca644e854b6f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -95,6 +94,12 @@ public final class NodeTypeDescription implements JsonSerializable notificatio return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (notificationCategory() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property notificationCategory in model Notification")); - } - if (notificationLevel() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property notificationLevel in model Notification")); - } - if (notificationTargets() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property notificationTargets in model Notification")); - } else { - notificationTargets().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Notification.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationCategory.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationCategory.java index ba83e42365dd..0a6c6e343db3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationCategory.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,7 +12,7 @@ */ public final class NotificationCategory extends ExpandableStringEnum { /** - * Static value WaveProgress for NotificationCategory. + * Notification will be regarding wave progress. */ public static final NotificationCategory WAVE_PROGRESS = fromString("WaveProgress"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationChannel.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationChannel.java index a063ffa98d3c..dec337183b2a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationChannel.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationChannel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,12 +12,14 @@ */ public final class NotificationChannel extends ExpandableStringEnum { /** - * Static value EmailUser for NotificationChannel. + * For email user receivers. In this case, the parameter receivers should be a list of email addresses that will + * receive the notifications. */ public static final NotificationChannel EMAIL_USER = fromString("EmailUser"); /** - * Static value EmailSubscription for NotificationChannel. + * For subscription receivers. In this case, the parameter receivers should be a list of roles of the subscription + * for the cluster (eg. Owner, AccountAdmin, etc) that will receive the notifications. */ public static final NotificationChannel EMAIL_SUBSCRIPTION = fromString("EmailSubscription"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationLevel.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationLevel.java index 64baff1fadd2..4ef1e15e926b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationLevel.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,12 +12,12 @@ */ public final class NotificationLevel extends ExpandableStringEnum { /** - * Static value Critical for NotificationLevel. + * Receive only critical notifications. */ public static final NotificationLevel CRITICAL = fromString("Critical"); /** - * Static value All for NotificationLevel. + * Receive all notifications. */ public static final NotificationLevel ALL = fromString("All"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationTarget.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationTarget.java index 2b88bea5bfba..889c89ea0799 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationTarget.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationTarget.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -77,25 +76,6 @@ public NotificationTarget withReceivers(List receivers) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (notificationChannel() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property notificationChannel in model NotificationTarget")); - } - if (receivers() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property receivers in model NotificationTarget")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NotificationTarget.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java index a5c39ca4d927..9ab5add1264a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java index d11850124df1..e2c3fda11ae8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -18,8 +18,8 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ PagedIterable list(); @@ -32,8 +32,8 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available Service Fabric resource provider API operations as paginated response with - * {@link PagedIterable}. + * @return describes the result of the request to list Service Fabric resource provider operations as paginated + * response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java index 8fd35c00b8a5..49867172af9f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,22 +12,26 @@ */ public final class PartitionScheme extends ExpandableStringEnum { /** - * Static value Invalid for PartitionScheme. + * Indicates the partition kind is invalid. All Service Fabric enumerations have the invalid type. The value is + * zero. */ public static final PartitionScheme INVALID = fromString("Invalid"); /** - * Static value Singleton for PartitionScheme. + * Indicates that the partition is based on string names, and is a SingletonPartitionSchemeDescription object, The + * value is 1. */ public static final PartitionScheme SINGLETON = fromString("Singleton"); /** - * Static value UniformInt64Range for PartitionScheme. + * Indicates that the partition is based on Int64 key ranges, and is a UniformInt64RangePartitionSchemeDescription + * object. The value is 2. */ public static final PartitionScheme UNIFORM_INT64RANGE = fromString("UniformInt64Range"); /** - * Static value Named for PartitionScheme. + * Indicates that the partition is based on string names, and is a NamedPartitionSchemeDescription object. The value + * is 3. */ public static final PartitionScheme NAMED = fromString("Named"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java index c9b6c6a5f097..f357295f047d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -36,14 +36,6 @@ public PartitionScheme partitionScheme() { return this.partitionScheme; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java index 0afeea066775..e8375c74c9ce 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,22 +12,22 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Updating for ProvisioningState. + * Cluster is updating. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value Succeeded for ProvisioningState. + * Cluster provisioning succeeded. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ProvisioningState. + * Cluster provisioning failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Cluster provisioning was canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java index aa8bea9d4792..4117f93c86fa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -10,36 +10,30 @@ /** * The reliability level sets the replica set size of system services. Learn about * [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). - * - * - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. - * - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. - * - Silver - Run the System services with a target replica set count of 5. - * - Gold - Run the System services with a target replica set count of 7. - * - Platinum - Run the System services with a target replica set count of 9. */ public final class ReliabilityLevel extends ExpandableStringEnum { /** - * Static value None for ReliabilityLevel. + * Run the System services with a target replica set count of 1. This should only be used for test clusters. */ public static final ReliabilityLevel NONE = fromString("None"); /** - * Static value Bronze for ReliabilityLevel. + * Run the System services with a target replica set count of 3. This should only be used for test clusters. */ public static final ReliabilityLevel BRONZE = fromString("Bronze"); /** - * Static value Silver for ReliabilityLevel. + * Run the System services with a target replica set count of 5. */ public static final ReliabilityLevel SILVER = fromString("Silver"); /** - * Static value Gold for ReliabilityLevel. + * Run the System services with a target replica set count of 7. */ public static final ReliabilityLevel GOLD = fromString("Gold"); /** - * Static value Platinum for ReliabilityLevel. + * Run the System services with a target replica set count of 9. */ public static final ReliabilityLevel PLATINUM = fromString("Platinum"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java index 3815820e09e8..ec50b780264b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -13,22 +13,24 @@ */ public final class RollingUpgradeMode extends ExpandableStringEnum { /** - * Static value Invalid for RollingUpgradeMode. + * Indicates the upgrade mode is invalid. All Service Fabric enumerations have the invalid type. The value is zero. */ public static final RollingUpgradeMode INVALID = fromString("Invalid"); /** - * Static value UnmonitoredAuto for RollingUpgradeMode. + * The upgrade will proceed automatically without performing any health monitoring. The value is 1. */ public static final RollingUpgradeMode UNMONITORED_AUTO = fromString("UnmonitoredAuto"); /** - * Static value UnmonitoredManual for RollingUpgradeMode. + * The upgrade will stop after completing each upgrade domain, giving the opportunity to manually monitor health + * before proceeding. The value is 2. */ public static final RollingUpgradeMode UNMONITORED_MANUAL = fromString("UnmonitoredManual"); /** - * Static value Monitored for RollingUpgradeMode. + * The upgrade will stop after completing each upgrade domain and automatically monitor health before proceeding. + * The value is 3. */ public static final RollingUpgradeMode MONITORED = fromString("Monitored"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java index 677be39bd25e..2ca3cc3f16a8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,26 +72,6 @@ public ServerCertificateCommonName withCertificateIssuerThumbprint(String certif return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificateCommonName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property certificateCommonName in model ServerCertificateCommonName")); - } - if (certificateIssuerThumbprint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property certificateIssuerThumbprint in model ServerCertificateCommonName")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ServerCertificateCommonName.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java index c8fd1b11e32b..25f4a724e14d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -75,17 +75,6 @@ public ServerCertificateCommonNames withX509StoreName(StoreName x509StoreName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (commonNames() != null) { - commonNames().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java index fe70ff66db06..6fc8ec09b31c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -24,7 +23,7 @@ public final class ServiceCorrelationDescription implements JsonSerializable { /** - * Static value Invalid for ServiceCorrelationScheme. + * An invalid correlation scheme. Cannot be used. The value is zero. */ public static final ServiceCorrelationScheme INVALID = fromString("Invalid"); /** - * Static value Affinity for ServiceCorrelationScheme. + * Indicates that this service has an affinity relationship with another service. Provided for backwards + * compatibility, consider preferring the Aligned or NonAlignedAffinity options. The value is 1. */ public static final ServiceCorrelationScheme AFFINITY = fromString("Affinity"); /** - * Static value AlignedAffinity for ServiceCorrelationScheme. + * Aligned affinity ensures that the primaries of the partitions of the affinitized services are collocated on the + * same nodes. This is the default and is the same as selecting the Affinity scheme. The value is 2. */ public static final ServiceCorrelationScheme ALIGNED_AFFINITY = fromString("AlignedAffinity"); /** - * Static value NonAlignedAffinity for ServiceCorrelationScheme. + * Non-Aligned affinity guarantees that all replicas of each service will be placed on the same nodes. Unlike + * Aligned Affinity, this does not guarantee that replicas of particular role will be collocated. The value is 3. */ public static final ServiceCorrelationScheme NON_ALIGNED_AFFINITY = fromString("NonAlignedAffinity"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java index 4d6361895f94..42e8f1b7b3cc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,17 +12,17 @@ */ public final class ServiceKind extends ExpandableStringEnum { /** - * Static value Invalid for ServiceKind. + * Indicates the service kind is invalid. All Service Fabric enumerations have the invalid type. The value is zero. */ public static final ServiceKind INVALID = fromString("Invalid"); /** - * Static value Stateless for ServiceKind. + * Does not use Service Fabric to make its state highly available or reliable. The value is 1. */ public static final ServiceKind STATELESS = fromString("Stateless"); /** - * Static value Stateful for ServiceKind. + * Uses Service Fabric to make its state or part of its state highly available and reliable. The value is 2. */ public static final ServiceKind STATEFUL = fromString("Stateful"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java index b7c699773f6b..9edcf43a1f6a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -162,21 +161,6 @@ public ServiceLoadMetricDescription withDefaultLoad(Integer defaultLoad) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property name in model ServiceLoadMetricDescription")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ServiceLoadMetricDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java index d5f397c97464..d2f5046c4110 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -13,22 +13,22 @@ */ public final class ServiceLoadMetricWeight extends ExpandableStringEnum { /** - * Static value Zero for ServiceLoadMetricWeight. + * Disables resource balancing for this metric. This value is zero. */ public static final ServiceLoadMetricWeight ZERO = fromString("Zero"); /** - * Static value Low for ServiceLoadMetricWeight. + * Specifies the metric weight of the service load as Low. The value is 1. */ public static final ServiceLoadMetricWeight LOW = fromString("Low"); /** - * Static value Medium for ServiceLoadMetricWeight. + * Specifies the metric weight of the service load as Medium. The value is 2. */ public static final ServiceLoadMetricWeight MEDIUM = fromString("Medium"); /** - * Static value High for ServiceLoadMetricWeight. + * Specifies the metric weight of the service load as High. The value is 3. */ public static final ServiceLoadMetricWeight HIGH = fromString("High"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java index dde64298056f..713aca2190a7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -38,14 +38,6 @@ public ServicePlacementPolicyType type() { return this.type; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java index e54aebc4c423..9b8b99748518 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,33 +12,44 @@ */ public final class ServicePlacementPolicyType extends ExpandableStringEnum { /** - * Static value Invalid for ServicePlacementPolicyType. + * Indicates the type of the placement policy is invalid. All Service Fabric enumerations have the invalid type. The + * value is zero. */ public static final ServicePlacementPolicyType INVALID = fromString("Invalid"); /** - * Static value InvalidDomain for ServicePlacementPolicyType. + * Indicates that the ServicePlacementPolicyDescription is of type ServicePlacementInvalidDomainPolicyDescription, + * which indicates that a particular fault or upgrade domain cannot be used for placement of this service. The value + * is 1. */ public static final ServicePlacementPolicyType INVALID_DOMAIN = fromString("InvalidDomain"); /** - * Static value RequiredDomain for ServicePlacementPolicyType. + * Indicates that the ServicePlacementPolicyDescription is of type + * ServicePlacementRequireDomainDistributionPolicyDescription indicating that the replicas of the service must be + * placed in a specific domain. The value is 2. */ public static final ServicePlacementPolicyType REQUIRED_DOMAIN = fromString("RequiredDomain"); /** - * Static value PreferredPrimaryDomain for ServicePlacementPolicyType. + * Indicates that the ServicePlacementPolicyDescription is of type + * ServicePlacementPreferPrimaryDomainPolicyDescription, which indicates that if possible the Primary replica for + * the partitions of the service should be located in a particular domain as an optimization. The value is 3. */ public static final ServicePlacementPolicyType PREFERRED_PRIMARY_DOMAIN = fromString("PreferredPrimaryDomain"); /** - * Static value RequiredDomainDistribution for ServicePlacementPolicyType. + * Indicates that the ServicePlacementPolicyDescription is of type + * ServicePlacementRequireDomainDistributionPolicyDescription, indicating that the system will disallow placement of + * any two replicas from the same partition in the same domain at any time. The value is 4. */ public static final ServicePlacementPolicyType REQUIRED_DOMAIN_DISTRIBUTION = fromString("RequiredDomainDistribution"); /** - * Static value NonPartiallyPlaceService for ServicePlacementPolicyType. + * Indicates that the ServicePlacementPolicyDescription is of type + * ServicePlacementNonPartiallyPlaceServicePolicyDescription, which indicates that if possible all replicas of a + * particular partition of the service should be placed atomically. The value is 5. */ public static final ServicePlacementPolicyType NON_PARTIALLY_PLACE_SERVICE = fromString("NonPartiallyPlaceService"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java index 94747d4b5826..44197ca43aaa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -122,7 +122,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, clusterName, applicationName. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @return the next definition stage. @@ -134,8 +134,8 @@ interface WithParentResource { * The stage of the ServiceResource 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithProperties { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithProperties, DefinitionStages.WithSystemData { /** * Executes the create request. * @@ -198,6 +198,20 @@ interface WithProperties { */ WithCreate withProperties(ServiceResourceProperties properties); } + + /** + * The stage of the ServiceResource definition allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } } /** @@ -210,7 +224,7 @@ interface WithProperties { /** * The template for ServiceResource update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithProperties, UpdateStages.WithSystemData { /** * Executes the update request. * @@ -236,13 +250,27 @@ interface UpdateStages { */ interface WithProperties { /** - * Specifies the properties property: The service resource properties for patch operations.. + * Specifies the properties property: The RP-specific properties for this resource.. * - * @param properties The service resource properties for patch operations. + * @param properties The RP-specific properties for this resource. * @return the next definition stage. */ Update withProperties(ServiceResourceUpdateProperties properties); } + + /** + * The stage of the ServiceResource update allowing to specify systemData. + */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + Update withSystemData(SystemData systemData); + } } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java index 9e86bea82681..4e9c9ae8c2d7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -42,8 +42,11 @@ public class ServiceResourceProperties extends ServiceResourcePropertiesBase { private ArmServicePackageActivationMode servicePackageActivationMode; /* - * Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of - * service name. + * Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of + * service endpoints for application layer protocols (e.g., HTTP). + * When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + * When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being + * unresolvable. */ private String serviceDnsName; @@ -146,8 +149,11 @@ public ArmServicePackageActivationMode servicePackageActivationMode() { } /** - * Get the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be - * accessed via its DNS name instead of service name. + * Get the serviceDnsName property: Dns name used for the service. If this is specified, then the DNS name can be + * used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). + * When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + * When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being + * unresolvable. * * @return the serviceDnsName value. */ @@ -156,8 +162,11 @@ public String serviceDnsName() { } /** - * Set the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be - * accessed via its DNS name instead of service name. + * Set the serviceDnsName property: Dns name used for the service. If this is specified, then the DNS name can be + * used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). + * When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + * When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being + * unresolvable. * * @param serviceDnsName the serviceDnsName value to set. * @return the ServiceResourceProperties object itself. @@ -213,27 +222,6 @@ public ServiceResourceProperties withDefaultMoveCost(MoveCost defaultMoveCost) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (partitionDescription() != null) { - partitionDescription().validate(); - } - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java index 57ca984f8ae7..04ddb4db452d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -161,23 +161,6 @@ public ServiceResourcePropertiesBase withDefaultMoveCost(MoveCost defaultMoveCos return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java index 0a13f77e5053..927823c256fc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -19,7 +19,7 @@ @Fluent public final class ServiceResourceUpdate extends ProxyResource { /* - * The service resource properties for patch operations. + * The RP-specific properties for this resource. */ private ServiceResourceUpdateProperties properties; @@ -65,7 +65,7 @@ public ServiceResourceUpdate() { } /** - * Get the properties property: The service resource properties for patch operations. + * Get the properties property: The RP-specific properties for this resource. * * @return the properties value. */ @@ -74,7 +74,7 @@ public ServiceResourceUpdateProperties properties() { } /** - * Set the properties property: The service resource properties for patch operations. + * Set the properties property: The RP-specific properties for this resource. * * @param properties the properties value to set. * @return the ServiceResourceUpdate object itself. @@ -142,6 +142,17 @@ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -172,17 +183,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @@ -192,6 +192,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeStringField("location", this.location); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("systemData", this.systemData); return jsonWriter.writeEndObject(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java index 71fd0fd16eb9..1168d30643aa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -84,24 +84,6 @@ public ServiceResourceUpdateProperties withDefaultMoveCost(MoveCost defaultMoveC return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java index 5521acdb2e7d..edceff43b975 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -62,14 +62,6 @@ public ServiceTypeDeltaHealthPolicy withMaxPercentDeltaUnhealthyServices(Integer return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java index 1f6f897b7bc3..e5221def97c3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -49,14 +49,6 @@ public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercen return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java index 6d220d925420..bb598cba83b3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -18,7 +18,7 @@ public interface Services { * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -26,7 +26,9 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String clusterName, String applicationName, @@ -38,14 +40,16 @@ Response getWithResponse(String resourceGroupName, String clust * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource. */ ServiceResource get(String resourceGroupName, String clusterName, String applicationName, String serviceName); @@ -55,7 +59,7 @@ Response getWithResponse(String resourceGroupName, String clust * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -70,7 +74,7 @@ Response getWithResponse(String resourceGroupName, String clust * * Delete a Service Fabric service resource with the specified name. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. @@ -87,14 +91,16 @@ void delete(String resourceGroupName, String clusterName, String applicationName * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, String applicationName); @@ -103,15 +109,17 @@ void delete(String resourceGroupName, String clusterName, String applicationName * * Gets all service resources created or in the process of being created in the Service Fabric application resource. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. * @param applicationName The name of the application resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all service resources created or in the process of being created in the Service Fabric application - * resource as paginated response with {@link PagedIterable}. + * @return the list of service resources created in the specified Service Fabric application resource. + * + * Gets all service resources created or in the process of being created in the Service Fabric application resource + * as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, String applicationName, Context context); @@ -126,7 +134,9 @@ PagedIterable list(String resourceGroupName, String clusterName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response}. */ ServiceResource getById(String id); @@ -142,7 +152,9 @@ PagedIterable list(String resourceGroupName, String clusterName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * @return a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric * application resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java index 189db3332b01..87aa1ccb3c72 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,26 +72,6 @@ public SettingsParameterDescription withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property name in model SettingsParameterDescription")); - } - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model SettingsParameterDescription")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SettingsParameterDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java index c31d76ee2afd..598c858b542d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -74,28 +73,6 @@ public SettingsSectionDescription withParameters(List e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SettingsSectionDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SfZonalUpgradeMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SfZonalUpgradeMode.java index 990a2a065452..50e19dfaf461 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SfZonalUpgradeMode.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SfZonalUpgradeMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -13,12 +13,17 @@ */ public final class SfZonalUpgradeMode extends ExpandableStringEnum { /** - * Static value Parallel for SfZonalUpgradeMode. + * VMs under the node type are grouped into UDs and ignore the zone info in five UDs. This setting causes UDs across + * all zones to be upgraded at the same time. This deployment mode is faster for upgrades, we don't recommend it + * because it goes against the SDP guidelines, which state that the updates should be applied to one zone at a time. */ public static final SfZonalUpgradeMode PARALLEL = fromString("Parallel"); /** - * Static value Hierarchical for SfZonalUpgradeMode. + * If this value is omitted or set to Hierarchical, VMs are grouped to reflect the zonal distribution in up to 15 + * UDs. Each of the three zones has five UDs. This ensures that the zones are updated one at a time, moving to next + * zone only after completing five UDs within the first zone. This update process is safer for the cluster and the + * user application. */ public static final SfZonalUpgradeMode HIERARCHICAL = fromString("Hierarchical"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java index 6480c14e8cc0..1e09046e35ab 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -11,7 +11,7 @@ import java.io.IOException; /** - * SingletonPartitionSchemeDescription. + * Describes the partition scheme of a singleton-partitioned, or non-partitioned service. */ @Immutable public final class SingletonPartitionSchemeDescription extends PartitionSchemeDescription { @@ -36,15 +36,6 @@ public PartitionScheme partitionScheme() { return this.partitionScheme; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java index 0498ac596aa7..69cd8726f08c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -285,27 +285,6 @@ public StatefulServiceProperties withDefaultMoveCost(MoveCost defaultMoveCost) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - if (partitionDescription() != null) { - partitionDescription().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java index 184e7a43ec55..67a3c0f30f65 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -222,24 +222,6 @@ public StatefulServiceUpdateProperties withDefaultMoveCost(MoveCost defaultMoveC return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java index f4d64030ee8c..96979c431605 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -36,6 +37,24 @@ public final class StatelessServiceProperties extends ServiceResourceProperties */ private String instanceCloseDelayDuration; + /* + * MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check + * during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( + * MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount + * computation -1 is first converted into the number of nodes on which the instances are allowed to be placed + * according to the placement constraints on the service. + */ + private Integer minInstanceCount; + + /* + * MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability + * safety check during operations like upgrade or deactivate node. The actual number that is used is max( + * MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, + * during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances + * are allowed to be placed according to the placement constraints on the service. + */ + private byte[] minInstancePercentage; + /** * Creates an instance of StatelessServiceProperties class. */ @@ -100,6 +119,62 @@ public StatelessServiceProperties withInstanceCloseDelayDuration(String instance return this; } + /** + * Get the minInstanceCount property: MinInstanceCount is the minimum number of instances that must be up to meet + * the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is + * used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is + * set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the + * instances are allowed to be placed according to the placement constraints on the service. + * + * @return the minInstanceCount value. + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minInstanceCount property: MinInstanceCount is the minimum number of instances that must be up to meet + * the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is + * used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is + * set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the + * instances are allowed to be placed according to the placement constraints on the service. + * + * @param minInstanceCount the minInstanceCount value to set. + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the minInstancePercentage property: MinInstancePercentage is the minimum percentage of InstanceCount that + * must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The + * actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, + * if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of + * nodes on which the instances are allowed to be placed according to the placement constraints on the service. + * + * @return the minInstancePercentage value. + */ + public byte[] minInstancePercentage() { + return CoreUtils.clone(this.minInstancePercentage); + } + + /** + * Set the minInstancePercentage property: MinInstancePercentage is the minimum percentage of InstanceCount that + * must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The + * actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, + * if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of + * nodes on which the instances are allowed to be placed according to the placement constraints on the service. + * + * @param minInstancePercentage the minInstancePercentage value to set. + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withMinInstancePercentage(byte[] minInstancePercentage) { + this.minInstancePercentage = CoreUtils.clone(minInstancePercentage); + return this; + } + /** * {@inheritDoc} */ @@ -183,27 +258,6 @@ public StatelessServiceProperties withDefaultMoveCost(MoveCost defaultMoveCost) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - if (partitionDescription() != null) { - partitionDescription().validate(); - } - } - /** * {@inheritDoc} */ @@ -226,6 +280,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("serviceKind", this.serviceKind == null ? null : this.serviceKind.toString()); jsonWriter.writeNumberField("instanceCount", this.instanceCount); jsonWriter.writeStringField("instanceCloseDelayDuration", this.instanceCloseDelayDuration); + jsonWriter.writeNumberField("minInstanceCount", this.minInstanceCount); + jsonWriter.writeBinaryField("minInstancePercentage", this.minInstancePercentage); return jsonWriter.writeEndObject(); } @@ -278,6 +334,10 @@ public static StatelessServiceProperties fromJson(JsonReader jsonReader) throws deserializedStatelessServiceProperties.instanceCount = reader.getNullable(JsonReader::getInt); } else if ("instanceCloseDelayDuration".equals(fieldName)) { deserializedStatelessServiceProperties.instanceCloseDelayDuration = reader.getString(); + } else if ("minInstanceCount".equals(fieldName)) { + deserializedStatelessServiceProperties.minInstanceCount = reader.getNullable(JsonReader::getInt); + } else if ("minInstancePercentage".equals(fieldName)) { + deserializedStatelessServiceProperties.minInstancePercentage = reader.getBinary(); } else { reader.skipChildren(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java index ff869bab06a5..9db8a4662a0f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -31,8 +31,8 @@ public final class StatelessServiceUpdateProperties extends ServiceResourceUpdat * removed before the delay starts prior to closing the instance. This delay enables existing requests to drain * gracefully before the instance actually goes down * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid- - * connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string - * representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). + * connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format + * (hh:mm:ss.s). */ private String instanceCloseDelayDuration; @@ -77,8 +77,7 @@ public StatelessServiceUpdateProperties withInstanceCount(Integer instanceCount) * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay * enables existing requests to drain gracefully before the instance actually goes down * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). - * It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format - * (hh:mm:ss.s). + * It is represented in ISO 8601 format (hh:mm:ss.s). * * @return the instanceCloseDelayDuration value. */ @@ -91,8 +90,7 @@ public String instanceCloseDelayDuration() { * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay * enables existing requests to drain gracefully before the instance actually goes down * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). - * It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format - * (hh:mm:ss.s). + * It is represented in ISO 8601 format (hh:mm:ss.s). * * @param instanceCloseDelayDuration the instanceCloseDelayDuration value to set. * @return the StatelessServiceUpdateProperties object itself. @@ -150,24 +148,6 @@ public StatelessServiceUpdateProperties withDefaultMoveCost(MoveCost defaultMove return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (correlationScheme() != null) { - correlationScheme().forEach(e -> e.validate()); - } - if (serviceLoadMetrics() != null) { - serviceLoadMetrics().forEach(e -> e.validate()); - } - if (servicePlacementPolicies() != null) { - servicePlacementPolicies().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java index fe1975abd112..885ba7ab2b33 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,42 +12,42 @@ */ public final class StoreName extends ExpandableStringEnum { /** - * Static value AddressBook for StoreName. + * Static value for AddressBook. */ public static final StoreName ADDRESS_BOOK = fromString("AddressBook"); /** - * Static value AuthRoot for StoreName. + * Static value for AuthRoot. */ public static final StoreName AUTH_ROOT = fromString("AuthRoot"); /** - * Static value CertificateAuthority for StoreName. + * Static value for CertificateAuthority. */ public static final StoreName CERTIFICATE_AUTHORITY = fromString("CertificateAuthority"); /** - * Static value Disallowed for StoreName. + * Static value for Disallowed. */ public static final StoreName DISALLOWED = fromString("Disallowed"); /** - * Static value My for StoreName. + * Static value for My. */ public static final StoreName MY = fromString("My"); /** - * Static value Root for StoreName. + * Static value for Root. */ public static final StoreName ROOT = fromString("Root"); /** - * Static value TrustedPeople for StoreName. + * Static value for TrustedPeople. */ public static final StoreName TRUSTED_PEOPLE = fromString("TrustedPeople"); /** - * Static value TrustedPublisher for StoreName. + * Static value for TrustedPublisher. */ public static final StoreName TRUSTED_PUBLISHER = fromString("TrustedPublisher"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java index fc697b157b41..f832070a7801 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -118,27 +117,6 @@ public UniformInt64RangePartitionSchemeDescription withHighKey(String highKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (lowKey() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property lowKey in model UniformInt64RangePartitionSchemeDescription")); - } - if (highKey() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property highKey in model UniformInt64RangePartitionSchemeDescription")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UniformInt64RangePartitionSchemeDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UnsupportedVmSizes.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UnsupportedVmSizes.java new file mode 100644 index 000000000000..6316733ad792 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UnsupportedVmSizes.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.servicefabric.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 UnsupportedVmSizes. + */ +public interface UnsupportedVmSizes { + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters along with {@link Response}. + */ + Response getWithResponse(String location, String vmSize, Context context); + + /** + * Get unsupported vm size for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param vmSize VM Size name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return unsupported vm size for Service Fabric Clusters. + */ + VMSizeResource get(String location, String vmSize); + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Get the lists of unsupported vm sizes for Service Fabric Clusters. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lists of unsupported vm sizes for Service Fabric Clusters as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionPathResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionPathResult.java index 82f369abcd0a..3e1f4e1f0fa0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionPathResult.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionPathResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,7 +12,7 @@ */ public interface UpgradableVersionPathResult { /** - * Gets the supportedPath property: The supportedPath property. + * Gets the supportedPath property: The list of intermediate cluster code versions for an upgrade or downgrade. * * @return the supportedPath value. */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionsDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionsDescription.java index a7134e92f244..29d04ffb671c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionsDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionsDescription.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,7 +12,7 @@ import java.io.IOException; /** - * The UpgradableVersionsDescription model. + * The upgrade path description with target version. */ @Fluent public final class UpgradableVersionsDescription implements JsonSerializable { @@ -48,21 +47,6 @@ public UpgradableVersionsDescription withTargetVersion(String targetVersion) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetVersion() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property targetVersion in model UpgradableVersionsDescription")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UpgradableVersionsDescription.class); - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java index 7ebf9919038c..edd6bab0abb6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,12 +12,14 @@ */ public final class UpgradeMode extends ExpandableStringEnum { /** - * Static value Automatic for UpgradeMode. + * The cluster will be automatically upgraded to the latest Service Fabric runtime version, **upgradeWave** will + * determine when the upgrade starts after the new version becomes available. */ public static final UpgradeMode AUTOMATIC = fromString("Automatic"); /** - * Static value Manual for UpgradeMode. + * The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is + * upgraded by setting the **clusterCodeVersion** property in the cluster resource. */ public static final UpgradeMode MANUAL = fromString("Manual"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java index 33aeb9e8275a..2376e3a6b21c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The UserAssignedIdentity model. + * Describes a user assigned identity. */ @Immutable public final class UserAssignedIdentity implements JsonSerializable { @@ -50,14 +50,6 @@ public String clientId() { return this.clientId; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSize.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSize.java new file mode 100644 index 000000000000..f3f66048b702 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSize.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.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; + +/** + * VM Sizes properties. + */ +@Immutable +public final class VMSize implements JsonSerializable { + /* + * VM Size name. + */ + private String size; + + /** + * Creates an instance of VMSize class. + */ + private VMSize() { + } + + /** + * Get the size property: VM Size name. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMSize if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the VMSize. + */ + public static VMSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMSize deserializedVMSize = new VMSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedVMSize.size = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVMSize; + }); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSizeResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSizeResource.java new file mode 100644 index 000000000000..2b4cb4016655 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VMSizeResource.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.servicefabric.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; + +/** + * An immutable client-side representation of VMSizeResource. + */ +public interface VMSizeResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: VM Size properties. + * + * @return the properties value. + */ + VMSize properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner object. + * + * @return the inner object. + */ + VMSizeResourceInner innerModel(); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssZonalUpgradeMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssZonalUpgradeMode.java index c6d8bfd9878b..290fd181d43d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssZonalUpgradeMode.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssZonalUpgradeMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.models; @@ -13,12 +13,14 @@ */ public final class VmssZonalUpgradeMode extends ExpandableStringEnum { /** - * Static value Parallel for VmssZonalUpgradeMode. + * Updates will happen in all Availability Zones at once for the virtual machine scale sets. */ public static final VmssZonalUpgradeMode PARALLEL = fromString("Parallel"); /** - * Static value Hierarchical for VmssZonalUpgradeMode. + * VMs are grouped to reflect the zonal distribution in up to 15 UDs. Each of the three zones has five UDs. This + * ensures that the zones are updated one at a time, moving to next zone only after completing five UDs within the + * first zone. */ public static final VmssZonalUpgradeMode HIERARCHICAL = fromString("Hierarchical"); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java index 40b0d94164cc..36fd9ccd14c3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for ServiceFabricManagementClient. - * Service Fabric Management Client. + * Package containing the data models for ServiceFabric. + * Azure Service Fabric Resource Provider API Client. */ package com.azure.resourcemanager.servicefabric.models; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java index 8af3b621c9ea..0bed3fdb45b3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for ServiceFabricManagementClient. - * Service Fabric Management Client. + * Package containing the classes for ServiceFabric. + * Azure Service Fabric Resource Provider API Client. */ package com.azure.resourcemanager.servicefabric; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java index 3ef001213625..42f88eb01783 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.servicefabric { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.servicefabric.fluent.models to com.azure.core; opens com.azure.resourcemanager.servicefabric.models to com.azure.core; + opens com.azure.resourcemanager.servicefabric.implementation.models to com.azure.core; } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/azure-resourcemanager-servicefabric_metadata.json b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/azure-resourcemanager-servicefabric_metadata.json new file mode 100644 index 000000000000..74e5c9a70203 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/azure-resourcemanager-servicefabric_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.ServiceFabric":"2026-03-01-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.beginCreateOrUpdate":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.beginDelete":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.createOrUpdate":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.delete":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.get":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.getWithResponse":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient.list":"Microsoft.ServiceFabric.ApplicationTypeVersionResources.list","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.beginDelete":"Microsoft.ServiceFabric.ApplicationTypeResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.createOrUpdate":"Microsoft.ServiceFabric.ApplicationTypeResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.createOrUpdateWithResponse":"Microsoft.ServiceFabric.ApplicationTypeResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.delete":"Microsoft.ServiceFabric.ApplicationTypeResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.get":"Microsoft.ServiceFabric.ApplicationTypeResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.getWithResponse":"Microsoft.ServiceFabric.ApplicationTypeResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient.list":"Microsoft.ServiceFabric.ApplicationTypeResources.list","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.beginCreateOrUpdate":"Microsoft.ServiceFabric.ApplicationResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.beginDelete":"Microsoft.ServiceFabric.ApplicationResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.beginUpdate":"Microsoft.ServiceFabric.ApplicationResources.update","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.createOrUpdate":"Microsoft.ServiceFabric.ApplicationResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.delete":"Microsoft.ServiceFabric.ApplicationResources.delete","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.get":"Microsoft.ServiceFabric.ApplicationResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.getWithResponse":"Microsoft.ServiceFabric.ApplicationResources.get","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.list":"Microsoft.ServiceFabric.ApplicationResources.list","com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient.update":"Microsoft.ServiceFabric.ApplicationResources.update","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.get":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.get","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.getByEnvironment":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.getByEnvironment","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.getByEnvironmentWithResponse":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.getByEnvironment","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.getWithResponse":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.get","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.list":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.list","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.listByEnvironment":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.listByEnvironment","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.listByEnvironmentWithResponse":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.listByEnvironment","com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient.listWithResponse":"Microsoft.ServiceFabric.ClusterVersionsOperationGroup.list","com.azure.resourcemanager.servicefabric.fluent.ClustersClient":"Microsoft.ServiceFabric.Clusters","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.beginCreateOrUpdate":"Microsoft.ServiceFabric.Clusters.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.beginUpdate":"Microsoft.ServiceFabric.Clusters.update","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.createOrUpdate":"Microsoft.ServiceFabric.Clusters.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.delete":"Microsoft.ServiceFabric.Clusters.delete","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.deleteWithResponse":"Microsoft.ServiceFabric.Clusters.delete","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.getByResourceGroup":"Microsoft.ServiceFabric.Clusters.get","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.getByResourceGroupWithResponse":"Microsoft.ServiceFabric.Clusters.get","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.list":"Microsoft.ServiceFabric.Clusters.list","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.listByResourceGroup":"Microsoft.ServiceFabric.Clusters.listByResourceGroup","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.listUpgradableVersions":"Microsoft.ServiceFabric.Clusters.listUpgradableVersions","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.listUpgradableVersionsWithResponse":"Microsoft.ServiceFabric.Clusters.listUpgradableVersions","com.azure.resourcemanager.servicefabric.fluent.ClustersClient.update":"Microsoft.ServiceFabric.Clusters.update","com.azure.resourcemanager.servicefabric.fluent.OperationsClient":"Microsoft.ServiceFabric.Operations","com.azure.resourcemanager.servicefabric.fluent.OperationsClient.list":"Azure.ResourceManager.Legacy.Operations.list","com.azure.resourcemanager.servicefabric.fluent.ServiceFabricManagementClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ServicesClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.beginCreateOrUpdate":"Microsoft.ServiceFabric.ServiceResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.beginDelete":"Microsoft.ServiceFabric.ServiceResources.delete","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.beginUpdate":"Microsoft.ServiceFabric.ServiceResources.update","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.createOrUpdate":"Microsoft.ServiceFabric.ServiceResources.createOrUpdate","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.delete":"Microsoft.ServiceFabric.ServiceResources.delete","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.get":"Microsoft.ServiceFabric.ServiceResources.get","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.getWithResponse":"Microsoft.ServiceFabric.ServiceResources.get","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.list":"Microsoft.ServiceFabric.ServiceResources.list","com.azure.resourcemanager.servicefabric.fluent.ServicesClient.update":"Microsoft.ServiceFabric.ServiceResources.update","com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient.get":"Microsoft.ServiceFabric.VMSizeResources.get","com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient.getWithResponse":"Microsoft.ServiceFabric.VMSizeResources.get","com.azure.resourcemanager.servicefabric.fluent.UnsupportedVmSizesClient.list":"Microsoft.ServiceFabric.VMSizeResources.list","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner":"Microsoft.ServiceFabric.ApplicationResource","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceProperties":"Microsoft.ServiceFabric.ApplicationResourceProperties","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceUpdateProperties":"Microsoft.ServiceFabric.ApplicationResourceUpdateProperties","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner":"Microsoft.ServiceFabric.ApplicationTypeResource","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceProperties":"Microsoft.ServiceFabric.ApplicationTypeResourceProperties","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner":"Microsoft.ServiceFabric.ApplicationTypeVersionResource","com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceProperties":"Microsoft.ServiceFabric.ApplicationTypeVersionResourceProperties","com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner":"Microsoft.ServiceFabric.Cluster","com.azure.resourcemanager.servicefabric.fluent.models.ClusterProperties":"Microsoft.ServiceFabric.ClusterProperties","com.azure.resourcemanager.servicefabric.fluent.models.ClusterPropertiesUpdateParameters":"Microsoft.ServiceFabric.ClusterPropertiesUpdateParameters","com.azure.resourcemanager.servicefabric.fluent.models.ClusterVersionDetails":"Microsoft.ServiceFabric.ClusterVersionDetails","com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner":"Microsoft.ServiceFabric.OperationResult","com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner":"Microsoft.ServiceFabric.ServiceResource","com.azure.resourcemanager.servicefabric.fluent.models.UpgradableVersionPathResultInner":"Microsoft.ServiceFabric.UpgradableVersionPathResult","com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner":"Microsoft.ServiceFabric.VMSizeResource","com.azure.resourcemanager.servicefabric.implementation.ServiceFabricManagementClientBuilder":"Microsoft.ServiceFabric","com.azure.resourcemanager.servicefabric.implementation.models.ApplicationResourceList":"Microsoft.ServiceFabric.ApplicationResourceList","com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeResourceList":"Microsoft.ServiceFabric.ApplicationTypeResourceList","com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeVersionResourceList":"Microsoft.ServiceFabric.ApplicationTypeVersionResourceList","com.azure.resourcemanager.servicefabric.implementation.models.ClusterListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.servicefabric.implementation.models.OperationListResult":"Microsoft.ServiceFabric.OperationListResult","com.azure.resourcemanager.servicefabric.implementation.models.ServiceResourceList":"Microsoft.ServiceFabric.ServiceResourceList","com.azure.resourcemanager.servicefabric.implementation.models.VMSizesResult":"Microsoft.ServiceFabric.VMSizesResult","com.azure.resourcemanager.servicefabric.models.AddOnFeatures":"Microsoft.ServiceFabric.AddOnFeatures","com.azure.resourcemanager.servicefabric.models.ApplicationDeltaHealthPolicy":"Microsoft.ServiceFabric.ApplicationDeltaHealthPolicy","com.azure.resourcemanager.servicefabric.models.ApplicationHealthPolicy":"Microsoft.ServiceFabric.ApplicationHealthPolicy","com.azure.resourcemanager.servicefabric.models.ApplicationMetricDescription":"Microsoft.ServiceFabric.ApplicationMetricDescription","com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate":"Microsoft.ServiceFabric.ApplicationResourceUpdate","com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionsCleanupPolicy":"Microsoft.ServiceFabric.ApplicationTypeVersionsCleanupPolicy","com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy":"Microsoft.ServiceFabric.ApplicationUpgradePolicy","com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity":"Microsoft.ServiceFabric.ApplicationUserAssignedIdentity","com.azure.resourcemanager.servicefabric.models.ArmApplicationHealthPolicy":"Microsoft.ServiceFabric.ArmApplicationHealthPolicy","com.azure.resourcemanager.servicefabric.models.ArmRollingUpgradeMonitoringPolicy":"Microsoft.ServiceFabric.ArmRollingUpgradeMonitoringPolicy","com.azure.resourcemanager.servicefabric.models.ArmServicePackageActivationMode":"Microsoft.ServiceFabric.ArmServicePackageActivationMode","com.azure.resourcemanager.servicefabric.models.ArmServiceTypeHealthPolicy":"Microsoft.ServiceFabric.ArmServiceTypeHealthPolicy","com.azure.resourcemanager.servicefabric.models.ArmUpgradeFailureAction":"Microsoft.ServiceFabric.ArmUpgradeFailureAction","com.azure.resourcemanager.servicefabric.models.AvailableOperationDisplay":"Microsoft.ServiceFabric.AvailableOperationDisplay","com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory":"Microsoft.ServiceFabric.AzureActiveDirectory","com.azure.resourcemanager.servicefabric.models.CertificateDescription":"Microsoft.ServiceFabric.CertificateDescription","com.azure.resourcemanager.servicefabric.models.ClientCertificateCommonName":"Microsoft.ServiceFabric.ClientCertificateCommonName","com.azure.resourcemanager.servicefabric.models.ClientCertificateThumbprint":"Microsoft.ServiceFabric.ClientCertificateThumbprint","com.azure.resourcemanager.servicefabric.models.ClusterCodeVersionsResult":"Microsoft.ServiceFabric.ClusterCodeVersions","com.azure.resourcemanager.servicefabric.models.ClusterEnvironment":"Microsoft.ServiceFabric.ClusterEnvironment","com.azure.resourcemanager.servicefabric.models.ClusterHealthPolicy":"Microsoft.ServiceFabric.ClusterHealthPolicy","com.azure.resourcemanager.servicefabric.models.ClusterState":"Microsoft.ServiceFabric.ClusterState","com.azure.resourcemanager.servicefabric.models.ClusterUpdateParameters":"Microsoft.ServiceFabric.ClusterUpdateParameters","com.azure.resourcemanager.servicefabric.models.ClusterUpgradeCadence":"Microsoft.ServiceFabric.ClusterUpgradeCadence","com.azure.resourcemanager.servicefabric.models.ClusterUpgradeDeltaHealthPolicy":"Microsoft.ServiceFabric.ClusterUpgradeDeltaHealthPolicy","com.azure.resourcemanager.servicefabric.models.ClusterUpgradePolicy":"Microsoft.ServiceFabric.ClusterUpgradePolicy","com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment":"Microsoft.ServiceFabric.ClusterVersionsEnvironment","com.azure.resourcemanager.servicefabric.models.DiagnosticsStorageAccountConfig":"Microsoft.ServiceFabric.DiagnosticsStorageAccountConfig","com.azure.resourcemanager.servicefabric.models.DurabilityLevel":"Microsoft.ServiceFabric.DurabilityLevel","com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription":"Microsoft.ServiceFabric.EndpointRangeDescription","com.azure.resourcemanager.servicefabric.models.ManagedIdentity":"Microsoft.ServiceFabric.ManagedIdentity","com.azure.resourcemanager.servicefabric.models.ManagedIdentityType":"Microsoft.ServiceFabric.ManagedIdentityType","com.azure.resourcemanager.servicefabric.models.MoveCost":"Microsoft.ServiceFabric.MoveCost","com.azure.resourcemanager.servicefabric.models.NamedPartitionSchemeDescription":"Microsoft.ServiceFabric.NamedPartitionSchemeDescription","com.azure.resourcemanager.servicefabric.models.NodeTypeDescription":"Microsoft.ServiceFabric.NodeTypeDescription","com.azure.resourcemanager.servicefabric.models.Notification":"Microsoft.ServiceFabric.Notification","com.azure.resourcemanager.servicefabric.models.NotificationCategory":"Microsoft.ServiceFabric.NotificationCategory","com.azure.resourcemanager.servicefabric.models.NotificationChannel":"Microsoft.ServiceFabric.NotificationChannel","com.azure.resourcemanager.servicefabric.models.NotificationLevel":"Microsoft.ServiceFabric.NotificationLevel","com.azure.resourcemanager.servicefabric.models.NotificationTarget":"Microsoft.ServiceFabric.NotificationTarget","com.azure.resourcemanager.servicefabric.models.PartitionScheme":"Microsoft.ServiceFabric.PartitionScheme","com.azure.resourcemanager.servicefabric.models.PartitionSchemeDescription":"Microsoft.ServiceFabric.PartitionSchemeDescription","com.azure.resourcemanager.servicefabric.models.ProvisioningState":"Microsoft.ServiceFabric.ProvisioningState","com.azure.resourcemanager.servicefabric.models.ReliabilityLevel":"Microsoft.ServiceFabric.ReliabilityLevel","com.azure.resourcemanager.servicefabric.models.RollingUpgradeMode":"Microsoft.ServiceFabric.RollingUpgradeMode","com.azure.resourcemanager.servicefabric.models.ServerCertificateCommonName":"Microsoft.ServiceFabric.ServerCertificateCommonName","com.azure.resourcemanager.servicefabric.models.ServerCertificateCommonNames":"Microsoft.ServiceFabric.ServerCertificateCommonNames","com.azure.resourcemanager.servicefabric.models.ServiceCorrelationDescription":"Microsoft.ServiceFabric.ServiceCorrelationDescription","com.azure.resourcemanager.servicefabric.models.ServiceCorrelationScheme":"Microsoft.ServiceFabric.ServiceCorrelationScheme","com.azure.resourcemanager.servicefabric.models.ServiceKind":"Microsoft.ServiceFabric.ServiceKind","com.azure.resourcemanager.servicefabric.models.ServiceLoadMetricDescription":"Microsoft.ServiceFabric.ServiceLoadMetricDescription","com.azure.resourcemanager.servicefabric.models.ServiceLoadMetricWeight":"Microsoft.ServiceFabric.ServiceLoadMetricWeight","com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyDescription":"Microsoft.ServiceFabric.ServicePlacementPolicyDescription","com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyType":"Microsoft.ServiceFabric.ServicePlacementPolicyType","com.azure.resourcemanager.servicefabric.models.ServiceResourceProperties":"Microsoft.ServiceFabric.ServiceResourceProperties","com.azure.resourcemanager.servicefabric.models.ServiceResourcePropertiesBase":"Microsoft.ServiceFabric.ServiceResourcePropertiesBase","com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdate":"Microsoft.ServiceFabric.ServiceResourceUpdate","com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdateProperties":"Microsoft.ServiceFabric.ServiceResourceUpdateProperties","com.azure.resourcemanager.servicefabric.models.ServiceTypeDeltaHealthPolicy":"Microsoft.ServiceFabric.ServiceTypeDeltaHealthPolicy","com.azure.resourcemanager.servicefabric.models.ServiceTypeHealthPolicy":"Microsoft.ServiceFabric.ServiceTypeHealthPolicy","com.azure.resourcemanager.servicefabric.models.SettingsParameterDescription":"Microsoft.ServiceFabric.SettingsParameterDescription","com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription":"Microsoft.ServiceFabric.SettingsSectionDescription","com.azure.resourcemanager.servicefabric.models.SfZonalUpgradeMode":"Microsoft.ServiceFabric.SfZonalUpgradeMode","com.azure.resourcemanager.servicefabric.models.SingletonPartitionSchemeDescription":"Microsoft.ServiceFabric.SingletonPartitionSchemeDescription","com.azure.resourcemanager.servicefabric.models.StatefulServiceProperties":"Microsoft.ServiceFabric.StatefulServiceProperties","com.azure.resourcemanager.servicefabric.models.StatefulServiceUpdateProperties":"Microsoft.ServiceFabric.StatefulServiceUpdateProperties","com.azure.resourcemanager.servicefabric.models.StatelessServiceProperties":"Microsoft.ServiceFabric.StatelessServiceProperties","com.azure.resourcemanager.servicefabric.models.StatelessServiceUpdateProperties":"Microsoft.ServiceFabric.StatelessServiceUpdateProperties","com.azure.resourcemanager.servicefabric.models.StoreName":"Microsoft.ServiceFabric.StoreName","com.azure.resourcemanager.servicefabric.models.UniformInt64RangePartitionSchemeDescription":"Microsoft.ServiceFabric.UniformInt64RangePartitionSchemeDescription","com.azure.resourcemanager.servicefabric.models.UpgradableVersionsDescription":"Microsoft.ServiceFabric.UpgradableVersionsDescription","com.azure.resourcemanager.servicefabric.models.UpgradeMode":"Microsoft.ServiceFabric.UpgradeMode","com.azure.resourcemanager.servicefabric.models.UserAssignedIdentity":"Microsoft.ServiceFabric.UserAssignedIdentity","com.azure.resourcemanager.servicefabric.models.VMSize":"Microsoft.ServiceFabric.VMSize","com.azure.resourcemanager.servicefabric.models.VmssZonalUpgradeMode":"Microsoft.ServiceFabric.VmssZonalUpgradeMode"},"generatedFiles":["src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/UnsupportedVmSizesClient.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterPropertiesUpdateParameters.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterVersionDetails.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/OperationResultInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/UpgradableVersionPathResultInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/VMSizeResourceInner.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesClientImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/UnsupportedVmSizesImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/UpgradableVersionPathResultImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/VMSizeResourceImpl.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationResourceList.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeResourceList.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ApplicationTypeVersionResourceList.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ClusterListResult.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/ServiceResourceList.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/models/VMSizesResult.java","src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java","src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java","src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java","src/main/java/com/azure/resourcemanager/servicefabric/models/AzureActiveDirectory.java","src/main/java/com/azure/resourcemanager/servicefabric/models/CertificateDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateCommonName.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateThumbprint.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterEnvironment.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeCadence.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java","src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java","src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java","src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java","src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Notification.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationCategory.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationChannel.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationLevel.java","src/main/java/com/azure/resourcemanager/servicefabric/models/NotificationTarget.java","src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java","src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java","src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java","src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationScheme.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java","src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java","src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/SfZonalUpgradeMode.java","src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java","src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UnsupportedVmSizes.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionPathResult.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradableVersionsDescription.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java","src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/servicefabric/models/VMSize.java","src/main/java/com/azure/resourcemanager/servicefabric/models/VMSizeResource.java","src/main/java/com/azure/resourcemanager/servicefabric/models/VmssZonalUpgradeMode.java","src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java","src/main/java/com/azure/resourcemanager/servicefabric/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicefabric/proxy-config.json b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicefabric/proxy-config.json index e651b794871b..03f7ef5ac69b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicefabric/proxy-config.json +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicefabric/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.servicefabric.implementation.ApplicationTypeVersionsClientImpl$ApplicationTypeVersionsService"],["com.azure.resourcemanager.servicefabric.implementation.ApplicationTypesClientImpl$ApplicationTypesService"],["com.azure.resourcemanager.servicefabric.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.servicefabric.implementation.ClusterVersionsClientImpl$ClusterVersionsService"],["com.azure.resourcemanager.servicefabric.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.servicefabric.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.servicefabric.implementation.ServicesClientImpl$ServicesService"]] \ No newline at end of file +[["com.azure.resourcemanager.servicefabric.implementation.ApplicationTypeVersionsClientImpl$ApplicationTypeVersionsService"],["com.azure.resourcemanager.servicefabric.implementation.ApplicationTypesClientImpl$ApplicationTypesService"],["com.azure.resourcemanager.servicefabric.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.servicefabric.implementation.ClusterVersionsClientImpl$ClusterVersionsService"],["com.azure.resourcemanager.servicefabric.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.servicefabric.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.servicefabric.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.servicefabric.implementation.UnsupportedVmSizesClientImpl$UnsupportedVmSizesService"]] \ No newline at end of file diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/azure-resourcemanager-servicefabric.properties b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/azure-resourcemanager-servicefabric.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/resources/azure-resourcemanager-servicefabric.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCreateOrUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCreateOrUpdateSamples.java index f1e7ac1e5297..ca62d998a29f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCreateOrUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,9 +12,7 @@ */ public final class ApplicationTypeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionPutOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionPutOperation_example.json */ /** * Sample code: Put an application type version. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsDeleteSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsDeleteSamples.java index 20c32f417efa..490a69428081 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsDeleteSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypeVersionsDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionDeleteOperation_example.json */ /** * Sample code: Delete an application type version. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetSamples.java index 12ea5a33b9f3..cca8a6d35fe8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypeVersionsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionGetOperation_example.json */ /** * Sample code: Get an application type version. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListSamples.java index 974655078c79..a67b214eaeb5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypeVersionsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeVersionListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeVersionListOperation_example.json */ /** * Sample code: Get a list of application type version resources. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateSamples.java index 03ca4ef60246..833fdf88c7c6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,9 +12,7 @@ */ public final class ApplicationTypesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNamePutOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNamePutOperation_example.json */ /** * Sample code: Put an application type. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesDeleteSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesDeleteSamples.java index f94da09d6bdb..4bce16945c51 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesDeleteSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypesDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameDeleteOperation_example.json */ /** * Sample code: Delete an application type. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetSamples.java index ab7d95620a6d..75efa0ae3fe4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypesGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameGetOperation_example.json */ /** * Sample code: Get an application type. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListSamples.java index 53ae90368264..cc5e0e2e32c1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationTypesListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationTypeNameListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationTypeNameListOperation_example.json */ /** * Sample code: Get a list of application type name resources. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsCreateOrUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsCreateOrUpdateSamples.java index d7a5e3c8f719..d0f4a56b4a79 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsCreateOrUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -20,9 +20,7 @@ */ public final class ApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_example_max.json */ /** * Sample code: Put an application with maximum parameters. @@ -65,9 +63,7 @@ public final class ApplicationsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_example_min.json */ /** * Sample code: Put an application with minimum parameters. @@ -88,9 +84,7 @@ public final class ApplicationsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPutOperation_recreate_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPutOperation_recreate_example.json */ /** * Sample code: Put an application with recreate option. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsDeleteSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsDeleteSamples.java index 0e33488851dc..4d74e9eeb1c2 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsDeleteSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationsDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationDeleteOperation_example.json */ /** * Sample code: Delete an application. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetSamples.java index 51feec5bbae4..72f5b9684436 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationGetOperation_example.json */ /** * Sample code: Get an application. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListSamples.java index d7d5e591986b..d20210368b4d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationListOperation_example.json */ /** * Sample code: Get a list of application resources. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsUpdateSamples.java index 6722138d716a..be4ce14aaa74 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,9 +13,7 @@ */ public final class ApplicationsUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ApplicationPatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ApplicationPatchOperation_example.json */ /** * Sample code: Patch an application. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetByEnvironmentSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetByEnvironmentSamples.java index 6659b724c7e4..965a255214fe 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetByEnvironmentSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetByEnvironmentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,9 +11,7 @@ */ public final class ClusterVersionsGetByEnvironmentSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsGetByEnvironment_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsGetByEnvironment_example.json */ /** * Sample code: Get cluster version by environment. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetSamples.java index ce30437b6c8f..b808e72c4dc3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClusterVersionsGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsGet_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsGet_example.json */ /** * Sample code: Get cluster version. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListByEnvironmentSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListByEnvironmentSamples.java index b745ee0473ab..382fd69e7c8e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListByEnvironmentSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListByEnvironmentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,9 +11,7 @@ */ public final class ClusterVersionsListByEnvironmentSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsListByEnvironment.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsListByEnvironment.json */ /** * Sample code: List cluster versions by environment. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListSamples.java index 89ef2416b5e2..5a483a620a78 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClusterVersionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClusterVersionsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterVersionsList_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterVersionsList_example.json */ /** * Sample code: List cluster versions. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersCreateOrUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersCreateOrUpdateSamples.java index 8bc390459f42..587cb8a0cb52 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -45,9 +45,7 @@ */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ClusterPutOperation_example_max.json */ /** * Sample code: Put a cluster with maximum parameters. @@ -95,7 +93,8 @@ public final class ClustersCreateOrUpdateSamples { .withIsPrimary(true) .withVmInstanceCount(5) .withIsStateless(false) - .withMultipleAvailabilityZones(true))) + .withMultipleAvailabilityZones(true) + .withHttpGatewayTokenAuthEndpointPort(19081))) .withReliabilityLevel(ReliabilityLevel.PLATINUM) .withReverseProxyCertificateCommonNames(new ServerCertificateCommonNames() .withCommonNames(Arrays.asList(new ServerCertificateCommonName().withCertificateCommonName("abc.com") @@ -152,13 +151,12 @@ public final class ClustersCreateOrUpdateSamples { .withReceivers(Arrays.asList("****@microsoft.com", "****@microsoft.com")), new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_SUBSCRIPTION) .withReceivers(Arrays.asList("Owner", "AccountAdmin")))))) + .withEnableHttpGatewayExclusiveAuthMode(true) .create(); } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ClusterPutOperation_example_min.json */ /** * Sample code: Put a cluster with minimum parameters. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteSamples.java index f72e6d13ef06..46336cf5c74a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterDeleteOperation_example.json */ /** * Sample code: Delete a cluster. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersGetByResourceGroupSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersGetByResourceGroupSamples.java index 42cf5657663a..de17a45ae5f2 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterGetOperation_example.json */ /** * Sample code: Get a cluster. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListByResourceGroupSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListByResourceGroupSamples.java index bec3ee419bca..55f31efd957d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterListByResourceGroupOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterListByResourceGroupOperation_example.json */ /** * Sample code: List cluster by resource group. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListSamples.java index f9384675acc5..eefedb82e27d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ClustersListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterListOperation_example.json */ /** * Sample code: List clusters. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsSamples.java index 08b7db56b8cc..333220c175b4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,9 +11,7 @@ */ public final class ClustersListUpgradableVersionsSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ListUpgradableVersionsMinMax_example.json + * x-ms-original-file: 2026-03-01-preview/ListUpgradableVersionsMinMax_example.json */ /** * Sample code: Get minimum and maximum code versions. @@ -27,9 +25,7 @@ public final class ClustersListUpgradableVersionsSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ListUpgradableVersionsPath_example.json + * x-ms-original-file: 2026-03-01-preview/ListUpgradableVersionsPath_example.json */ /** * Sample code: Get upgrade path. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersUpdateSamples.java index ec1ca85eec9d..2fb1595614b4 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ClustersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -21,9 +21,7 @@ */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ClusterPatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ClusterPatchOperation_example.json */ /** * Sample code: Patch a cluster. @@ -48,7 +46,8 @@ public static void patchACluster(com.azure.resourcemanager.servicefabric.Service new EndpointRangeDescription().withStartPort(20000).withEndPort(30000)) .withEphemeralPorts(new EndpointRangeDescription().withStartPort(49000).withEndPort(64000)) .withIsPrimary(true) - .withVmInstanceCount(5), + .withVmInstanceCount(5) + .withHttpGatewayTokenAuthEndpointPort(19081), new NodeTypeDescription().withName("testnt1") .withClientConnectionEndpointPort(0) .withHttpGatewayEndpointPort(0) @@ -56,12 +55,14 @@ public static void patchACluster(com.azure.resourcemanager.servicefabric.Service .withApplicationPorts(new EndpointRangeDescription().withStartPort(1000).withEndPort(2000)) .withEphemeralPorts(new EndpointRangeDescription().withStartPort(3000).withEndPort(4000)) .withIsPrimary(false) - .withVmInstanceCount(3))) + .withVmInstanceCount(3) + .withHttpGatewayTokenAuthEndpointPort(19081))) .withReliabilityLevel(ReliabilityLevel.BRONZE) .withUpgradeMode(UpgradeMode.AUTOMATIC) .withUpgradeWave(ClusterUpgradeCadence.fromString("Wave")) .withUpgradePauseStartTimestampUtc(OffsetDateTime.parse("2021-06-21T22:00:00Z")) .withUpgradePauseEndTimestampUtc(OffsetDateTime.parse("2021-06-25T22:00:00Z")) + .withEnableHttpGatewayExclusiveAuthMode(true) .apply(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/OperationsListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/OperationsListSamples.java index f989aa5ed9c9..79fd00db2462 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/OperationsListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,16 +9,14 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListOperations. - * json + * x-ms-original-file: 2026-03-01-preview/Operations_example.json */ /** - * Sample code: ListOperations. + * Sample code: List available operations. * * @param manager Entry point to ServiceFabricManager. */ - public static void listOperations(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + public static void listAvailableOperations(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesCreateOrUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesCreateOrUpdateSamples.java index d3b817822a1d..c16035b86863 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesCreateOrUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -21,9 +21,7 @@ */ public final class ServicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePutOperation_example_min.json + * x-ms-original-file: 2026-03-01-preview/ServicePutOperation_example_min.json */ /** * Sample code: Put a service with minimum parameters. @@ -43,9 +41,7 @@ public final class ServicesCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePutOperation_example_max.json + * x-ms-original-file: 2026-03-01-preview/ServicePutOperation_example_max.json */ /** * Sample code: Put a service with maximum parameters. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesDeleteSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesDeleteSamples.java index 70ca68efc173..f2712a778275 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesDeleteSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ServicesDeleteSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceDeleteOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceDeleteOperation_example.json */ /** * Sample code: Delete a service. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetSamples.java index 1701148a2bcb..147732a8ae66 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceGetOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceGetOperation_example.json */ /** * Sample code: Get a service. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesListSamples.java index 5326f6fa5246..714b33fc5713 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesListSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -9,9 +9,7 @@ */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServiceListOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServiceListOperation_example.json */ /** * Sample code: Get a list of service resources. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesUpdateSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesUpdateSamples.java index f64845d5741d..3ee427a6fdc3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesUpdateSamples.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/ServicesUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -15,9 +15,7 @@ */ public final class ServicesUpdateSamples { /* - * x-ms-original-file: - * specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ - * ServicePatchOperation_example.json + * x-ms-original-file: 2026-03-01-preview/ServicePatchOperation_example.json */ /** * Sample code: Patch a service. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetSamples.java new file mode 100644 index 000000000000..1ca9e6b79438 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetSamples.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.servicefabric.generated; + +/** + * Samples for UnsupportedVmSizes Get. + */ +public final class UnsupportedVmSizesGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/UnsupportedVMSizesGet_example.json + */ + /** + * Sample code: Get unsupported vm sizes. + * + * @param manager Entry point to ServiceFabricManager. + */ + public static void getUnsupportedVmSizes(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + manager.unsupportedVmSizes().getWithResponse("eastus", "Standard_B1ls1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListSamples.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListSamples.java new file mode 100644 index 000000000000..ba97d9e6b38d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/samples/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListSamples.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.servicefabric.generated; + +/** + * Samples for UnsupportedVmSizes List. + */ +public final class UnsupportedVmSizesListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/UnsupportedVMSizesList_example.json + */ + /** + * Sample code: List unsupported vm sizes. + * + * @param manager Entry point to ServiceFabricManager. + */ + public static void listUnsupportedVmSizes(com.azure.resourcemanager.servicefabric.ServiceFabricManager manager) { + manager.unsupportedVmSizes().list("eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationDeltaHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationDeltaHealthPolicyTests.java index 36cfc902c33c..2d3199bf59e3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationDeltaHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationDeltaHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -15,27 +15,26 @@ public final class ApplicationDeltaHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationDeltaHealthPolicy model = BinaryData.fromString( - "{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":233179905},\"serviceTypeDeltaHealthPolicies\":{\"lniwpwcukjfkgiaw\":{\"maxPercentDeltaUnhealthyServices\":900623903},\"ryplwckbasyypn\":{\"maxPercentDeltaUnhealthyServices\":1214753692}}}") + "{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":491677014},\"serviceTypeDeltaHealthPolicies\":{\"xsqwpgrjbznorc\":{\"maxPercentDeltaUnhealthyServices\":748845194}}}") .toObject(ApplicationDeltaHealthPolicy.class); - Assertions.assertEquals(233179905, + Assertions.assertEquals(491677014, model.defaultServiceTypeDeltaHealthPolicy().maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(900623903, - model.serviceTypeDeltaHealthPolicies().get("lniwpwcukjfkgiaw").maxPercentDeltaUnhealthyServices()); + Assertions.assertEquals(748845194, + model.serviceTypeDeltaHealthPolicies().get("xsqwpgrjbznorc").maxPercentDeltaUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationDeltaHealthPolicy model = new ApplicationDeltaHealthPolicy() .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(233179905)) - .withServiceTypeDeltaHealthPolicies(mapOf("lniwpwcukjfkgiaw", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(900623903), "ryplwckbasyypn", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1214753692))); + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(491677014)) + .withServiceTypeDeltaHealthPolicies(mapOf("xsqwpgrjbznorc", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(748845194))); model = BinaryData.fromObject(model).toObject(ApplicationDeltaHealthPolicy.class); - Assertions.assertEquals(233179905, + Assertions.assertEquals(491677014, model.defaultServiceTypeDeltaHealthPolicy().maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(900623903, - model.serviceTypeDeltaHealthPolicies().get("lniwpwcukjfkgiaw").maxPercentDeltaUnhealthyServices()); + Assertions.assertEquals(748845194, + model.serviceTypeDeltaHealthPolicies().get("xsqwpgrjbznorc").maxPercentDeltaUnhealthyServices()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationHealthPolicyTests.java index e7a81595f2d8..fc95fdf62cdd 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -15,27 +15,25 @@ public final class ApplicationHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationHealthPolicy model = BinaryData.fromString( - "{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":186594005},\"serviceTypeHealthPolicies\":{\"bkzgcwrwclx\":{\"maxPercentUnhealthyServices\":2049117618},\"ljdousk\":{\"maxPercentUnhealthyServices\":562899344},\"kocrcjdkwtnhx\":{\"maxPercentUnhealthyServices\":874345897},\"biksq\":{\"maxPercentUnhealthyServices\":1299495603}}}") + "{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":101465987},\"serviceTypeHealthPolicies\":{\"uckyf\":{\"maxPercentUnhealthyServices\":1785230840},\"fidfvzw\":{\"maxPercentUnhealthyServices\":279638935}}}") .toObject(ApplicationHealthPolicy.class); - Assertions.assertEquals(186594005, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(2049117618, - model.serviceTypeHealthPolicies().get("bkzgcwrwclx").maxPercentUnhealthyServices()); + Assertions.assertEquals(101465987, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); + Assertions.assertEquals(1785230840, + model.serviceTypeHealthPolicies().get("uckyf").maxPercentUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationHealthPolicy model = new ApplicationHealthPolicy() .withDefaultServiceTypeHealthPolicy( - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(186594005)) + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(101465987)) .withServiceTypeHealthPolicies( - mapOf("bkzgcwrwclx", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2049117618), - "ljdousk", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(562899344), - "kocrcjdkwtnhx", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(874345897), "biksq", - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1299495603))); + mapOf("uckyf", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1785230840), "fidfvzw", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(279638935))); model = BinaryData.fromObject(model).toObject(ApplicationHealthPolicy.class); - Assertions.assertEquals(186594005, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(2049117618, - model.serviceTypeHealthPolicies().get("bkzgcwrwclx").maxPercentUnhealthyServices()); + Assertions.assertEquals(101465987, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); + Assertions.assertEquals(1785230840, + model.serviceTypeHealthPolicies().get("uckyf").maxPercentUnhealthyServices()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationMetricDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationMetricDescriptionTests.java index 6de736a0530c..3249f7f19ae1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationMetricDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationMetricDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,24 +12,24 @@ public final class ApplicationMetricDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationMetricDescription model = BinaryData.fromString( - "{\"name\":\"qig\",\"maximumCapacity\":1427620858530935166,\"reservationCapacity\":8642059696861181136,\"totalApplicationCapacity\":5173080348817508321}") + "{\"name\":\"dbh\",\"maximumCapacity\":4869129234818624936,\"reservationCapacity\":2718310291361024894,\"totalApplicationCapacity\":4128477649983650964}") .toObject(ApplicationMetricDescription.class); - Assertions.assertEquals("qig", model.name()); - Assertions.assertEquals(1427620858530935166L, model.maximumCapacity()); - Assertions.assertEquals(8642059696861181136L, model.reservationCapacity()); - Assertions.assertEquals(5173080348817508321L, model.totalApplicationCapacity()); + Assertions.assertEquals("dbh", model.name()); + Assertions.assertEquals(4869129234818624936L, model.maximumCapacity()); + Assertions.assertEquals(2718310291361024894L, model.reservationCapacity()); + Assertions.assertEquals(4128477649983650964L, model.totalApplicationCapacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationMetricDescription model = new ApplicationMetricDescription().withName("qig") - .withMaximumCapacity(1427620858530935166L) - .withReservationCapacity(8642059696861181136L) - .withTotalApplicationCapacity(5173080348817508321L); + ApplicationMetricDescription model = new ApplicationMetricDescription().withName("dbh") + .withMaximumCapacity(4869129234818624936L) + .withReservationCapacity(2718310291361024894L) + .withTotalApplicationCapacity(4128477649983650964L); model = BinaryData.fromObject(model).toObject(ApplicationMetricDescription.class); - Assertions.assertEquals("qig", model.name()); - Assertions.assertEquals(1427620858530935166L, model.maximumCapacity()); - Assertions.assertEquals(8642059696861181136L, model.reservationCapacity()); - Assertions.assertEquals(5173080348817508321L, model.totalApplicationCapacity()); + Assertions.assertEquals("dbh", model.name()); + Assertions.assertEquals(4869129234818624936L, model.maximumCapacity()); + Assertions.assertEquals(2718310291361024894L, model.reservationCapacity()); + Assertions.assertEquals(4128477649983650964L, model.totalApplicationCapacity()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceInnerTests.java index bb1f2e83fe5d..090564d6e11c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -26,191 +26,214 @@ public final class ApplicationResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationResourceInner model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"tsthsucocm\",\"tenantId\":\"yazttbtwwrqpue\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zyoxaepdkzjan\":{\"principalId\":\"biexzfeyu\",\"clientId\":\"xibxujwbhqwalm\"},\"ytxhp\":{\"principalId\":\"xrhdwbavxbniwdjs\",\"clientId\":\"tsdbpgn\"},\"wtctyqi\":{\"principalId\":\"bzpfzab\",\"clientId\":\"cuh\"},\"kfplgmgsxnk\":{\"principalId\":\"bbovplwzbhvgyugu\",\"clientId\":\"vmkfssxqu\"}}},\"properties\":{\"provisioningState\":\"deslp\",\"typeName\":\"opwi\",\"typeVersion\":\"ghxpkdw\",\"parameters\":{\"upedeojnabckhs\":\"iuebbaumny\",\"ie\":\"txp\",\"jdhtldwkyzxu\":\"tfhvpesapskrdqmh\",\"svlxotogtwrup\":\"tkncwsc\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"vnm\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"o\",\"healthCheckStableDuration\":\"ilovnot\",\"healthCheckRetryTimeout\":\"jfcn\",\"upgradeTimeout\":\"k\",\"upgradeDomainTimeout\":\"x\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":657781919,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1754671531,\"maxPercentUnhealthyPartitionsPerService\":1501927720,\"maxPercentUnhealthyReplicasPerPartition\":1284749235},\"serviceTypeHealthPolicyMap\":{\"clfp\":{\"maxPercentUnhealthyServices\":1633235296,\"maxPercentUnhealthyPartitionsPerService\":1979421186,\"maxPercentUnhealthyReplicasPerPartition\":1468269047}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false},\"minimumNodes\":6303383872663340344,\"maximumNodes\":8770120849185576658,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"sbj\",\"maximumCapacity\":1292231161047660234,\"reservationCapacity\":8913573077828001292,\"totalApplicationCapacity\":8623440575477757964},{\"name\":\"ueefjzwfqkqu\",\"maximumCapacity\":3292485781669976103,\"reservationCapacity\":7570837536586623824,\"totalApplicationCapacity\":4310608753987324485},{\"name\":\"laocqxtccmg\",\"maximumCapacity\":4531156159452032810,\"reservationCapacity\":6928065700546189319,\"totalApplicationCapacity\":8937450445167889405}],\"managedIdentities\":[{\"name\":\"vwfudwpzntxhd\",\"principalId\":\"hl\"}]},\"location\":\"jbhckfrlhr\",\"tags\":{\"ycanuzbpzkafku\":\"kyv\",\"rnwb\":\"b\"},\"etag\":\"hhseyv\",\"id\":\"srtslhspkdeem\",\"name\":\"ofmxagkvtmelmqkr\",\"type\":\"ahvljuaha\"}") + "{\"properties\":{\"provisioningState\":\"tsdbpgn\",\"typeName\":\"txhp\",\"typeVersion\":\"bzpfzab\",\"parameters\":{\"lwzbhvgyugu\":\"uhxwtctyqiklbbov\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"mkfssxqukkfplgm\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"kde\",\"healthCheckStableDuration\":\"pvlopwiyighxpkd\",\"healthCheckRetryTimeout\":\"baiuebbaumny\",\"upgradeTimeout\":\"ped\",\"upgradeDomainTimeout\":\"jn\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":52556598,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1104061727,\"maxPercentUnhealthyPartitionsPerService\":2144077110,\"maxPercentUnhealthyReplicasPerPartition\":726916833},\"serviceTypeHealthPolicyMap\":{\"apskrdqm\":{\"maxPercentUnhealthyServices\":1146165631,\"maxPercentUnhealthyPartitionsPerService\":1543115619,\"maxPercentUnhealthyReplicasPerPartition\":1435266777},\"dwkyzxuu\":{\"maxPercentUnhealthyServices\":1058725142,\"maxPercentUnhealthyPartitionsPerService\":1444957859,\"maxPercentUnhealthyReplicasPerPartition\":1056627326},\"wsvlxotogtwrupqs\":{\"maxPercentUnhealthyServices\":1210562441,\"maxPercentUnhealthyPartitionsPerService\":276161293,\"maxPercentUnhealthyReplicasPerPartition\":355088461},\"kvceoveilovnotyf\":{\"maxPercentUnhealthyServices\":823053391,\"maxPercentUnhealthyPartitionsPerService\":208644200,\"maxPercentUnhealthyReplicasPerPartition\":335871101}}},\"upgradeMode\":\"UnmonitoredManual\",\"recreateApplication\":true},\"minimumNodes\":850251594969235277,\"maximumNodes\":319665118186558655,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"phywpnvj\",\"maximumCapacity\":7014692184557191333,\"reservationCapacity\":4139812271767683575,\"totalApplicationCapacity\":4975149413219088486},{\"name\":\"lphox\",\"maximumCapacity\":4973738946403996356,\"reservationCapacity\":4392160629829565824,\"totalApplicationCapacity\":1781523879629973808},{\"name\":\"sbj\",\"maximumCapacity\":1292231161047660234,\"reservationCapacity\":8913573077828001292,\"totalApplicationCapacity\":8623440575477757964},{\"name\":\"ueefjzwfqkqu\",\"maximumCapacity\":3292485781669976103,\"reservationCapacity\":7570837536586623824,\"totalApplicationCapacity\":4310608753987324485}],\"managedIdentities\":[{\"name\":\"aocqxtccmgy\",\"principalId\":\"dxyt\"},{\"name\":\"moyrxvwfudwpz\",\"principalId\":\"txhdzh\"},{\"name\":\"rqjbhckfrl\",\"principalId\":\"rxsbkyvp\"}]},\"identity\":{\"principalId\":\"n\",\"tenantId\":\"bpzkafkuwbc\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ofmxagkvtmelmqkr\":{\"principalId\":\"hhseyv\",\"clientId\":\"srtslhspkdeem\"},\"aex\":{\"principalId\":\"hvljuahaquh\",\"clientId\":\"hmdua\"},\"vxpvgomz\":{\"principalId\":\"vfadmws\",\"clientId\":\"r\"},\"auhashsfwx\":{\"principalId\":\"misgwbnb\",\"clientId\":\"ldawkzbaliourqha\"}}},\"location\":\"owzxcu\",\"tags\":{\"ucww\":\"jooxdjebw\",\"bvmeuecivy\":\"vo\",\"ueiotwmcdyt\":\"zceuojgjrw\",\"it\":\"x\"},\"etag\":\"rjaw\",\"id\":\"wgxhn\",\"name\":\"skxfbk\",\"type\":\"y\"}") .toObject(ApplicationResourceInner.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("jbhckfrlhr", model.location()); - Assertions.assertEquals("kyv", model.tags().get("ycanuzbpzkafku")); - Assertions.assertEquals("opwi", model.typeName()); - Assertions.assertEquals("ghxpkdw", model.typeVersion()); - Assertions.assertEquals("iuebbaumny", model.parameters().get("upedeojnabckhs")); - Assertions.assertEquals("vnm", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("owzxcu", model.location()); + Assertions.assertEquals("jooxdjebw", model.tags().get("ucww")); + Assertions.assertEquals("txhp", model.typeName()); + Assertions.assertEquals("bzpfzab", model.typeVersion()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.parameters().get("lwzbhvgyugu")); + Assertions.assertEquals("mkfssxqukkfplgm", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("o", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("ilovnot", + Assertions.assertEquals("kde", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); + Assertions.assertEquals("pvlopwiyighxpkd", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jfcn", + Assertions.assertEquals("baiuebbaumny", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("k", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("x", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(657781919, + Assertions.assertEquals("ped", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("jn", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertTrue(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(52556598, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1754671531, + Assertions.assertEquals(1104061727, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1501927720, + Assertions.assertEquals(2144077110, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1284749235, + Assertions.assertEquals(726916833, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1633235296, + Assertions.assertEquals(1146165631, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1979421186, + Assertions.assertEquals(1543115619, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1468269047, + Assertions.assertEquals(1435266777, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(false, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(6303383872663340344L, model.minimumNodes()); - Assertions.assertEquals(8770120849185576658L, model.maximumNodes()); - Assertions.assertEquals(false, model.removeApplicationCapacity()); - Assertions.assertEquals("sbj", model.metrics().get(0).name()); - Assertions.assertEquals(1292231161047660234L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(8913573077828001292L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(8623440575477757964L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("vwfudwpzntxhd", model.managedIdentities().get(0).name()); - Assertions.assertEquals("hl", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_MANUAL, model.upgradePolicy().upgradeMode()); + Assertions.assertTrue(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(850251594969235277L, model.minimumNodes()); + Assertions.assertEquals(319665118186558655L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("phywpnvj", model.metrics().get(0).name()); + Assertions.assertEquals(7014692184557191333L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(4139812271767683575L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(4975149413219088486L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("aocqxtccmgy", model.managedIdentities().get(0).name()); + Assertions.assertEquals("dxyt", model.managedIdentities().get(0).principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationResourceInner model = new ApplicationResourceInner() - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("zyoxaepdkzjan", new UserAssignedIdentity(), "ytxhp", new UserAssignedIdentity(), "wtctyqi", - new UserAssignedIdentity(), "kfplgmgsxnk", new UserAssignedIdentity()))) - .withLocation("jbhckfrlhr") - .withTags(mapOf("ycanuzbpzkafku", "kyv", "rnwb", "b")) - .withTypeName("opwi") - .withTypeVersion("ghxpkdw") - .withParameters(mapOf("upedeojnabckhs", "iuebbaumny", "ie", "txp", "jdhtldwkyzxu", "tfhvpesapskrdqmh", - "svlxotogtwrup", "tkncwsc")) - .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("vnm") - .withForceRestart(true) - .withRollingUpgradeMonitoringPolicy( - new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) - .withHealthCheckWaitDuration("o") - .withHealthCheckStableDuration("ilovnot") - .withHealthCheckRetryTimeout("jfcn") - .withUpgradeTimeout("k") - .withUpgradeDomainTimeout("x")) - .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(657781919) - .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1754671531) - .withMaxPercentUnhealthyPartitionsPerService(1501927720) - .withMaxPercentUnhealthyReplicasPerPartition(1284749235)) - .withServiceTypeHealthPolicyMap(mapOf("clfp", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1633235296) - .withMaxPercentUnhealthyPartitionsPerService(1979421186) - .withMaxPercentUnhealthyReplicasPerPartition(1468269047)))) - .withUpgradeMode(RollingUpgradeMode.UNMONITORED_AUTO) - .withRecreateApplication(false)) - .withMinimumNodes(6303383872663340344L) - .withMaximumNodes(8770120849185576658L) - .withRemoveApplicationCapacity(false) - .withMetrics(Arrays.asList( - new ApplicationMetricDescription().withName("sbj") - .withMaximumCapacity(1292231161047660234L) - .withReservationCapacity(8913573077828001292L) - .withTotalApplicationCapacity(8623440575477757964L), - new ApplicationMetricDescription().withName("ueefjzwfqkqu") - .withMaximumCapacity(3292485781669976103L) - .withReservationCapacity(7570837536586623824L) - .withTotalApplicationCapacity(4310608753987324485L), - new ApplicationMetricDescription().withName("laocqxtccmg") - .withMaximumCapacity(4531156159452032810L) - .withReservationCapacity(6928065700546189319L) - .withTotalApplicationCapacity(8937450445167889405L))) - .withManagedIdentities( - Arrays.asList(new ApplicationUserAssignedIdentity().withName("vwfudwpzntxhd").withPrincipalId("hl"))); + ApplicationResourceInner model + = new ApplicationResourceInner() + .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf("ofmxagkvtmelmqkr", new UserAssignedIdentity(), "aex", new UserAssignedIdentity(), + "vxpvgomz", new UserAssignedIdentity(), "auhashsfwx", new UserAssignedIdentity()))) + .withLocation("owzxcu") + .withTags(mapOf("ucww", "jooxdjebw", "bvmeuecivy", "vo", "ueiotwmcdyt", "zceuojgjrw", "it", "x")) + .withTypeName("txhp") + .withTypeVersion("bzpfzab") + .withParameters(mapOf("lwzbhvgyugu", "uhxwtctyqiklbbov")) + .withUpgradePolicy( + new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("mkfssxqukkfplgm") + .withForceRestart(true) + .withRollingUpgradeMonitoringPolicy( + new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) + .withHealthCheckWaitDuration("kde") + .withHealthCheckStableDuration("pvlopwiyighxpkd") + .withHealthCheckRetryTimeout("baiuebbaumny") + .withUpgradeTimeout("ped") + .withUpgradeDomainTimeout("jn")) + .withApplicationHealthPolicy( + new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) + .withMaxPercentUnhealthyDeployedApplications(52556598) + .withDefaultServiceTypeHealthPolicy( + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1104061727) + .withMaxPercentUnhealthyPartitionsPerService(2144077110) + .withMaxPercentUnhealthyReplicasPerPartition(726916833)) + .withServiceTypeHealthPolicyMap( + mapOf("apskrdqm", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1146165631) + .withMaxPercentUnhealthyPartitionsPerService(1543115619) + .withMaxPercentUnhealthyReplicasPerPartition(1435266777), + "dwkyzxuu", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1058725142) + .withMaxPercentUnhealthyPartitionsPerService(1444957859) + .withMaxPercentUnhealthyReplicasPerPartition(1056627326), + "wsvlxotogtwrupqs", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1210562441) + .withMaxPercentUnhealthyPartitionsPerService(276161293) + .withMaxPercentUnhealthyReplicasPerPartition(355088461), + "kvceoveilovnotyf", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(823053391) + .withMaxPercentUnhealthyPartitionsPerService(208644200) + .withMaxPercentUnhealthyReplicasPerPartition(335871101)))) + .withUpgradeMode(RollingUpgradeMode.UNMONITORED_MANUAL) + .withRecreateApplication(true)) + .withMinimumNodes(850251594969235277L) + .withMaximumNodes(319665118186558655L) + .withRemoveApplicationCapacity(false) + .withMetrics(Arrays.asList( + new ApplicationMetricDescription().withName("phywpnvj") + .withMaximumCapacity(7014692184557191333L) + .withReservationCapacity(4139812271767683575L) + .withTotalApplicationCapacity(4975149413219088486L), + new ApplicationMetricDescription().withName("lphox") + .withMaximumCapacity(4973738946403996356L) + .withReservationCapacity(4392160629829565824L) + .withTotalApplicationCapacity(1781523879629973808L), + new ApplicationMetricDescription().withName("sbj") + .withMaximumCapacity(1292231161047660234L) + .withReservationCapacity(8913573077828001292L) + .withTotalApplicationCapacity(8623440575477757964L), + new ApplicationMetricDescription().withName("ueefjzwfqkqu") + .withMaximumCapacity(3292485781669976103L) + .withReservationCapacity(7570837536586623824L) + .withTotalApplicationCapacity(4310608753987324485L))) + .withManagedIdentities( + Arrays.asList(new ApplicationUserAssignedIdentity().withName("aocqxtccmgy").withPrincipalId("dxyt"), + new ApplicationUserAssignedIdentity().withName("moyrxvwfudwpz").withPrincipalId("txhdzh"), + new ApplicationUserAssignedIdentity().withName("rqjbhckfrl").withPrincipalId("rxsbkyvp"))); model = BinaryData.fromObject(model).toObject(ApplicationResourceInner.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("jbhckfrlhr", model.location()); - Assertions.assertEquals("kyv", model.tags().get("ycanuzbpzkafku")); - Assertions.assertEquals("opwi", model.typeName()); - Assertions.assertEquals("ghxpkdw", model.typeVersion()); - Assertions.assertEquals("iuebbaumny", model.parameters().get("upedeojnabckhs")); - Assertions.assertEquals("vnm", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("owzxcu", model.location()); + Assertions.assertEquals("jooxdjebw", model.tags().get("ucww")); + Assertions.assertEquals("txhp", model.typeName()); + Assertions.assertEquals("bzpfzab", model.typeVersion()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.parameters().get("lwzbhvgyugu")); + Assertions.assertEquals("mkfssxqukkfplgm", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("o", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("ilovnot", + Assertions.assertEquals("kde", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); + Assertions.assertEquals("pvlopwiyighxpkd", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jfcn", + Assertions.assertEquals("baiuebbaumny", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("k", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("x", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(657781919, + Assertions.assertEquals("ped", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("jn", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertTrue(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(52556598, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1754671531, + Assertions.assertEquals(1104061727, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1501927720, + Assertions.assertEquals(2144077110, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1284749235, + Assertions.assertEquals(726916833, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1633235296, + Assertions.assertEquals(1146165631, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1979421186, + Assertions.assertEquals(1543115619, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1468269047, + Assertions.assertEquals(1435266777, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("clfp") + .get("apskrdqm") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(false, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(6303383872663340344L, model.minimumNodes()); - Assertions.assertEquals(8770120849185576658L, model.maximumNodes()); - Assertions.assertEquals(false, model.removeApplicationCapacity()); - Assertions.assertEquals("sbj", model.metrics().get(0).name()); - Assertions.assertEquals(1292231161047660234L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(8913573077828001292L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(8623440575477757964L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("vwfudwpzntxhd", model.managedIdentities().get(0).name()); - Assertions.assertEquals("hl", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_MANUAL, model.upgradePolicy().upgradeMode()); + Assertions.assertTrue(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(850251594969235277L, model.minimumNodes()); + Assertions.assertEquals(319665118186558655L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("phywpnvj", model.metrics().get(0).name()); + Assertions.assertEquals(7014692184557191333L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(4139812271767683575L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(4975149413219088486L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("aocqxtccmgy", model.managedIdentities().get(0).name()); + Assertions.assertEquals("dxyt", model.managedIdentities().get(0).principalId()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceListTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceListTests.java index 304927bf2083..ed0901f08861 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceListTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceListTests.java @@ -1,226 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationMetricDescription; -import com.azure.resourcemanager.servicefabric.models.ApplicationResourceList; -import com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy; -import com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity; -import com.azure.resourcemanager.servicefabric.models.ArmApplicationHealthPolicy; -import com.azure.resourcemanager.servicefabric.models.ArmRollingUpgradeMonitoringPolicy; -import com.azure.resourcemanager.servicefabric.models.ArmServiceTypeHealthPolicy; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationResourceList; import com.azure.resourcemanager.servicefabric.models.ArmUpgradeFailureAction; -import com.azure.resourcemanager.servicefabric.models.ManagedIdentity; import com.azure.resourcemanager.servicefabric.models.ManagedIdentityType; import com.azure.resourcemanager.servicefabric.models.RollingUpgradeMode; -import com.azure.resourcemanager.servicefabric.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ApplicationResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationResourceList model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"tiiswacffg\",\"tenantId\":\"zzewkfvhqcrai\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nedgfbc\":{\"principalId\":\"fuflrwdmhdlx\",\"clientId\":\"rxsagafcnihgwqa\"},\"pcjwv\":{\"principalId\":\"cvqvpkeqdcv\",\"clientId\":\"hvoodsotbobzd\"}}},\"properties\":{\"provisioningState\":\"ld\",\"typeName\":\"gx\",\"typeVersion\":\"rslpmutwuoeg\",\"parameters\":{\"dggkzzlvmbmpa\":\"hjwniyqsluic\",\"yhrfouyftaakcpw\":\"modfvuefywsbpfvm\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"vqtmnub\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"mond\",\"healthCheckStableDuration\":\"quxvypomgkop\",\"healthCheckRetryTimeout\":\"hojvpajqgxysmocm\",\"upgradeTimeout\":\"fqvm\",\"upgradeDomainTimeout\":\"xozap\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":1480663750,\"defaultServiceTypeHealthPolicy\":{},\"serviceTypeHealthPolicyMap\":{\"yat\":{}}},\"upgradeMode\":\"Invalid\",\"recreateApplication\":true},\"minimumNodes\":1605920653761823709,\"maximumNodes\":7850386713816708447,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"qibrhosxsdqrhzoy\",\"maximumCapacity\":3759620620672585271,\"reservationCapacity\":4538636180382407268,\"totalApplicationCapacity\":5977240495404401854},{\"name\":\"wfluszdt\",\"maximumCapacity\":2447311563304363726,\"reservationCapacity\":2614637191948743156,\"totalApplicationCapacity\":5459563894986340273},{\"name\":\"qacpiex\",\"maximumCapacity\":1588065972663705215,\"reservationCapacity\":4540666018291396484,\"totalApplicationCapacity\":8211205854755134512}],\"managedIdentities\":[{\"name\":\"ashrt\",\"principalId\":\"tkcnqxwb\"},{\"name\":\"okulpiujwa\",\"principalId\":\"sipqii\"}]},\"location\":\"yuq\",\"tags\":{\"bdbutauvf\":\"qlpqwcciuq\",\"afnn\":\"tkuwhhmhykojo\"},\"etag\":\"pichkoymkcdy\",\"id\":\"pkkpw\",\"name\":\"reqnovvqfov\",\"type\":\"jxywsuws\"},{\"identity\":{\"principalId\":\"ndsytgadg\",\"tenantId\":\"aeaeneqnzarrw\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ibwwiftohqkv\":{\"principalId\":\"fqka\",\"clientId\":\"wiipfpub\"},\"ntorzihleosjswsr\":{\"principalId\":\"vksgplsaknynfsy\",\"clientId\":\"jphuopxodlqi\"},\"zynkedya\":{\"principalId\":\"lyzrpzbchckqqzqi\",\"clientId\":\"iysui\"},\"pcdpumnz\":{\"principalId\":\"wyhqmibzyhwits\",\"clientId\":\"pyy\"}}},\"properties\":{\"provisioningState\":\"z\",\"typeName\":\"abikns\",\"typeVersion\":\"gj\",\"parameters\":{\"kdmtncvokotll\":\"ldtlwwr\",\"h\":\"d\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"ocogj\",\"forceRestart\":false,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"hadoocrk\",\"healthCheckStableDuration\":\"ikhnvpamqgxqq\",\"healthCheckRetryTimeout\":\"zikywgg\",\"upgradeTimeout\":\"allatmelwuipic\",\"upgradeDomainTimeout\":\"zkzivgvvcnay\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":1925040131,\"defaultServiceTypeHealthPolicy\":{},\"serviceTypeHealthPolicyMap\":{\"eedndrdvstkwqqtc\":{},\"ealmfmtdaaygdvwv\":{},\"piohgwxrtfu\":{}}},\"upgradeMode\":\"UnmonitoredManual\",\"recreateApplication\":false},\"minimumNodes\":8172843567981740181,\"maximumNodes\":2498438211029299669,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"k\",\"maximumCapacity\":8969085063650197756,\"reservationCapacity\":3507174744748509441,\"totalApplicationCapacity\":2732082136167741922},{\"name\":\"wi\",\"maximumCapacity\":4495232285451293451,\"reservationCapacity\":7729076180734759194,\"totalApplicationCapacity\":6240929679987561692},{\"name\":\"zk\",\"maximumCapacity\":7589435135200737860,\"reservationCapacity\":1171909706909522221,\"totalApplicationCapacity\":8338807266312513089},{\"name\":\"kf\",\"maximumCapacity\":6566365320530486008,\"reservationCapacity\":488040231209258224,\"totalApplicationCapacity\":2753110503115800438}],\"managedIdentities\":[{\"name\":\"elpcirelsfeaenwa\",\"principalId\":\"fatkld\"}]},\"location\":\"bjhwuaan\",\"tags\":{\"jrvxaglrv\":\"osphyoul\"},\"etag\":\"jwosytxitcskfck\",\"id\":\"umiekkezzi\",\"name\":\"hlyfjhdgqgg\",\"type\":\"bdunygaeqid\"}],\"nextLink\":\"fatpxllrxcyjmoa\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"uicpd\",\"typeName\":\"kzzlvmbmpaxmodf\",\"typeVersion\":\"efyw\",\"parameters\":{\"rfouyftaakcpw\":\"fvmwy\",\"nubexk\":\"yzvqt\",\"quxvypomgkop\":\"zksmondj\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"ojvpa\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"ocmbqfqvmkcxoza\",\"healthCheckStableDuration\":\"helxprglya\",\"healthCheckRetryTimeout\":\"dckcbc\",\"upgradeTimeout\":\"jrjxgciqibrhosx\",\"upgradeDomainTimeout\":\"qrhzoymibmrqyib\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":898647722,\"defaultServiceTypeHealthPolicy\":{},\"serviceTypeHealthPolicyMap\":{\"tmhrkwofyyvoqacp\":{},\"expbtg\":{},\"wbwo\":{},\"nwashrtd\":{}}},\"upgradeMode\":\"Monitored\",\"recreateApplication\":true},\"minimumNodes\":8545363856594134553,\"maximumNodes\":2025396993774877433,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"jwaa\",\"maximumCapacity\":1202571290361403211,\"reservationCapacity\":4704412525137839440,\"totalApplicationCapacity\":2901020239591748865},{\"name\":\"erpqlpqwcciuqg\",\"maximumCapacity\":8266840378456200507,\"reservationCapacity\":7190603076442530209,\"totalApplicationCapacity\":4381546425309848486}],\"managedIdentities\":[{\"name\":\"uwhhmhykojoxafn\",\"principalId\":\"dlpichkoymkcdyhb\"},{\"name\":\"kkpwdreqnovvq\",\"principalId\":\"ovljxywsu\"}]},\"identity\":{\"principalId\":\"rsndsytgadgvra\",\"tenantId\":\"en\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"e\":{\"principalId\":\"rwlqu\",\"clientId\":\"jfqka\"},\"qkvpuvksgplsakn\":{\"principalId\":\"ipfpubji\",\"clientId\":\"wifto\"}}},\"location\":\"fsynljphuop\",\"tags\":{\"osjswsr\":\"lqiyntorzihl\",\"qioxi\":\"slyzrpzbchckqq\",\"wyhqmibzyhwits\":\"suiizynkedyat\"},\"etag\":\"pyy\",\"id\":\"cdpu\",\"name\":\"nzgmwznmabik\",\"type\":\"sorgj\"},{\"properties\":{\"provisioningState\":\"ldtlwwr\",\"typeName\":\"dmtnc\",\"typeVersion\":\"kotl\",\"parameters\":{\"cogjltdtbn\":\"yhgsy\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"d\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"ikhnvpamqgxqq\",\"healthCheckStableDuration\":\"zikywgg\",\"healthCheckRetryTimeout\":\"allatmelwuipic\",\"upgradeTimeout\":\"zkzivgvvcnay\",\"upgradeDomainTimeout\":\"yrnxxmueedn\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":817024636,\"defaultServiceTypeHealthPolicy\":{},\"serviceTypeHealthPolicyMap\":{\"qtc\":{},\"ealmfmtdaaygdvwv\":{}}},\"upgradeMode\":\"UnmonitoredManual\",\"recreateApplication\":true},\"minimumNodes\":4193737199619746585,\"maximumNodes\":9199034685951751946,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"xg\",\"maximumCapacity\":2932477024589855825,\"reservationCapacity\":8204459365601972318,\"totalApplicationCapacity\":4744038705838577883},{\"name\":\"ukghimdblxgw\",\"maximumCapacity\":7611617377471579634,\"reservationCapacity\":4226937584221368790,\"totalApplicationCapacity\":2192828191882361978},{\"name\":\"szkkfoqre\",\"maximumCapacity\":8338807266312513089,\"reservationCapacity\":2185206310902116436,\"totalApplicationCapacity\":2140423423373896312}],\"managedIdentities\":[{\"name\":\"a\",\"principalId\":\"vxwc\"},{\"name\":\"elpcirelsfeaenwa\",\"principalId\":\"fatkld\"},{\"name\":\"xbjhwuaanozjosph\",\"principalId\":\"oulpjrv\"}]},\"identity\":{\"principalId\":\"l\",\"tenantId\":\"imjwosyt\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"yf\":{\"principalId\":\"fcktqumiekke\",\"clientId\":\"ikh\"}}},\"location\":\"dgqggebdu\",\"tags\":{\"xcyjmoadsuvarmy\":\"aeqidbqfatpxll\"},\"etag\":\"mjsjqb\",\"id\":\"hyxxrwlycoduhpk\",\"name\":\"kgymareqnajxqug\",\"type\":\"hky\"}],\"nextLink\":\"beddgssofw\"}") .toObject(ApplicationResourceList.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("yuq", model.value().get(0).location()); - Assertions.assertEquals("qlpqwcciuq", model.value().get(0).tags().get("bdbutauvf")); - Assertions.assertEquals("gx", model.value().get(0).typeName()); - Assertions.assertEquals("rslpmutwuoeg", model.value().get(0).typeVersion()); - Assertions.assertEquals("hjwniyqsluic", model.value().get(0).parameters().get("dggkzzlvmbmpa")); - Assertions.assertEquals("vqtmnub", model.value().get(0).upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.value().get(0).upgradePolicy().forceRestart()); + Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("fsynljphuop", model.value().get(0).location()); + Assertions.assertEquals("lqiyntorzihl", model.value().get(0).tags().get("osjswsr")); + Assertions.assertEquals("kzzlvmbmpaxmodf", model.value().get(0).typeName()); + Assertions.assertEquals("efyw", model.value().get(0).typeVersion()); + Assertions.assertEquals("fvmwy", model.value().get(0).parameters().get("rfouyftaakcpw")); + Assertions.assertEquals("ojvpa", model.value().get(0).upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.value().get(0).upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("mond", + Assertions.assertEquals("ocmbqfqvmkcxoza", model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("quxvypomgkop", + Assertions.assertEquals("helxprglya", model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("hojvpajqgxysmocm", + Assertions.assertEquals("dckcbc", model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fqvm", + Assertions.assertEquals("jrjxgciqibrhosx", model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("xozap", + Assertions.assertEquals("qrhzoymibmrqyib", model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, - model.value().get(0).upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(1480663750, + Assertions.assertFalse(model.value().get(0).upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(898647722, model.value().get(0).upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.value().get(0).upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.value().get(0).upgradePolicy().recreateApplication()); - Assertions.assertEquals(1605920653761823709L, model.value().get(0).minimumNodes()); - Assertions.assertEquals(7850386713816708447L, model.value().get(0).maximumNodes()); - Assertions.assertEquals(false, model.value().get(0).removeApplicationCapacity()); - Assertions.assertEquals("qibrhosxsdqrhzoy", model.value().get(0).metrics().get(0).name()); - Assertions.assertEquals(3759620620672585271L, model.value().get(0).metrics().get(0).maximumCapacity()); - Assertions.assertEquals(4538636180382407268L, model.value().get(0).metrics().get(0).reservationCapacity()); - Assertions.assertEquals(5977240495404401854L, model.value().get(0).metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("ashrt", model.value().get(0).managedIdentities().get(0).name()); - Assertions.assertEquals("tkcnqxwb", model.value().get(0).managedIdentities().get(0).principalId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationResourceList model - = new ApplicationResourceList() - .withValue( - Arrays - .asList( - new ApplicationResourceInner() - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("nedgfbc", new UserAssignedIdentity(), "pcjwv", - new UserAssignedIdentity()))) - .withLocation("yuq") - .withTags(mapOf("bdbutauvf", "qlpqwcciuq", "afnn", "tkuwhhmhykojo")) - .withTypeName("gx") - .withTypeVersion("rslpmutwuoeg") - .withParameters( - mapOf("dggkzzlvmbmpa", "hjwniyqsluic", "yhrfouyftaakcpw", "modfvuefywsbpfvm")) - .withUpgradePolicy(new ApplicationUpgradePolicy() - .withUpgradeReplicaSetCheckTimeout("vqtmnub") - .withForceRestart(true) - .withRollingUpgradeMonitoringPolicy(new ArmRollingUpgradeMonitoringPolicy() - .withFailureAction(ArmUpgradeFailureAction.ROLLBACK) - .withHealthCheckWaitDuration("mond") - .withHealthCheckStableDuration("quxvypomgkop") - .withHealthCheckRetryTimeout("hojvpajqgxysmocm") - .withUpgradeTimeout("fqvm") - .withUpgradeDomainTimeout("xozap")) - .withApplicationHealthPolicy(new ArmApplicationHealthPolicy() - .withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(1480663750) - .withDefaultServiceTypeHealthPolicy(new ArmServiceTypeHealthPolicy()) - .withServiceTypeHealthPolicyMap(mapOf("yat", new ArmServiceTypeHealthPolicy()))) - .withUpgradeMode(RollingUpgradeMode.INVALID) - .withRecreateApplication(true)) - .withMinimumNodes(1605920653761823709L) - .withMaximumNodes(7850386713816708447L) - .withRemoveApplicationCapacity(false) - .withMetrics(Arrays.asList( - new ApplicationMetricDescription().withName("qibrhosxsdqrhzoy") - .withMaximumCapacity(3759620620672585271L) - .withReservationCapacity(4538636180382407268L) - .withTotalApplicationCapacity(5977240495404401854L), - new ApplicationMetricDescription().withName("wfluszdt") - .withMaximumCapacity(2447311563304363726L) - .withReservationCapacity(2614637191948743156L) - .withTotalApplicationCapacity(5459563894986340273L), - new ApplicationMetricDescription().withName("qacpiex") - .withMaximumCapacity(1588065972663705215L) - .withReservationCapacity(4540666018291396484L) - .withTotalApplicationCapacity(8211205854755134512L))) - .withManagedIdentities(Arrays.asList( - new ApplicationUserAssignedIdentity().withName("ashrt").withPrincipalId("tkcnqxwb"), - new ApplicationUserAssignedIdentity() - .withName("okulpiujwa") - .withPrincipalId("sipqii"))), - new ApplicationResourceInner() - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("ibwwiftohqkv", new UserAssignedIdentity(), - "ntorzihleosjswsr", new UserAssignedIdentity(), "zynkedya", - new UserAssignedIdentity(), "pcdpumnz", new UserAssignedIdentity()))) - .withLocation("bjhwuaan") - .withTags(mapOf("jrvxaglrv", "osphyoul")) - .withTypeName("abikns") - .withTypeVersion("gj") - .withParameters(mapOf("kdmtncvokotll", "ldtlwwr", "h", "d")) - .withUpgradePolicy( - new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("ocogj") - .withForceRestart(false) - .withRollingUpgradeMonitoringPolicy(new ArmRollingUpgradeMonitoringPolicy() - .withFailureAction(ArmUpgradeFailureAction.ROLLBACK) - .withHealthCheckWaitDuration("hadoocrk") - .withHealthCheckStableDuration("ikhnvpamqgxqq") - .withHealthCheckRetryTimeout("zikywgg") - .withUpgradeTimeout("allatmelwuipic") - .withUpgradeDomainTimeout("zkzivgvvcnay")) - .withApplicationHealthPolicy( - new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(1925040131) - .withDefaultServiceTypeHealthPolicy(new ArmServiceTypeHealthPolicy()) - .withServiceTypeHealthPolicyMap( - mapOf("eedndrdvstkwqqtc", new ArmServiceTypeHealthPolicy(), - "ealmfmtdaaygdvwv", new ArmServiceTypeHealthPolicy(), - "piohgwxrtfu", new ArmServiceTypeHealthPolicy()))) - .withUpgradeMode(RollingUpgradeMode.UNMONITORED_MANUAL) - .withRecreateApplication(false)) - .withMinimumNodes(8172843567981740181L) - .withMaximumNodes(2498438211029299669L) - .withRemoveApplicationCapacity(true) - .withMetrics(Arrays.asList( - new ApplicationMetricDescription().withName("k") - .withMaximumCapacity(8969085063650197756L) - .withReservationCapacity(3507174744748509441L) - .withTotalApplicationCapacity(2732082136167741922L), - new ApplicationMetricDescription().withName("wi") - .withMaximumCapacity(4495232285451293451L) - .withReservationCapacity(7729076180734759194L) - .withTotalApplicationCapacity(6240929679987561692L), - new ApplicationMetricDescription().withName("zk") - .withMaximumCapacity(7589435135200737860L) - .withReservationCapacity(1171909706909522221L) - .withTotalApplicationCapacity(8338807266312513089L), - new ApplicationMetricDescription().withName("kf") - .withMaximumCapacity(6566365320530486008L) - .withReservationCapacity(488040231209258224L) - .withTotalApplicationCapacity(2753110503115800438L))) - .withManagedIdentities( - Arrays.asList(new ApplicationUserAssignedIdentity().withName("elpcirelsfeaenwa") - .withPrincipalId("fatkld"))))); - model = BinaryData.fromObject(model).toObject(ApplicationResourceList.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("yuq", model.value().get(0).location()); - Assertions.assertEquals("qlpqwcciuq", model.value().get(0).tags().get("bdbutauvf")); - Assertions.assertEquals("gx", model.value().get(0).typeName()); - Assertions.assertEquals("rslpmutwuoeg", model.value().get(0).typeVersion()); - Assertions.assertEquals("hjwniyqsluic", model.value().get(0).parameters().get("dggkzzlvmbmpa")); - Assertions.assertEquals("vqtmnub", model.value().get(0).upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.value().get(0).upgradePolicy().forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("mond", - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("quxvypomgkop", - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("hojvpajqgxysmocm", - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fqvm", - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("xozap", - model.value().get(0).upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, - model.value().get(0).upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(1480663750, - model.value().get(0).upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.value().get(0).upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.value().get(0).upgradePolicy().recreateApplication()); - Assertions.assertEquals(1605920653761823709L, model.value().get(0).minimumNodes()); - Assertions.assertEquals(7850386713816708447L, model.value().get(0).maximumNodes()); - Assertions.assertEquals(false, model.value().get(0).removeApplicationCapacity()); - Assertions.assertEquals("qibrhosxsdqrhzoy", model.value().get(0).metrics().get(0).name()); - Assertions.assertEquals(3759620620672585271L, model.value().get(0).metrics().get(0).maximumCapacity()); - Assertions.assertEquals(4538636180382407268L, model.value().get(0).metrics().get(0).reservationCapacity()); - Assertions.assertEquals(5977240495404401854L, model.value().get(0).metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("ashrt", model.value().get(0).managedIdentities().get(0).name()); - Assertions.assertEquals("tkcnqxwb", model.value().get(0).managedIdentities().get(0).principalId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals(RollingUpgradeMode.MONITORED, model.value().get(0).upgradePolicy().upgradeMode()); + Assertions.assertTrue(model.value().get(0).upgradePolicy().recreateApplication()); + Assertions.assertEquals(8545363856594134553L, model.value().get(0).minimumNodes()); + Assertions.assertEquals(2025396993774877433L, model.value().get(0).maximumNodes()); + Assertions.assertFalse(model.value().get(0).removeApplicationCapacity()); + Assertions.assertEquals("jwaa", model.value().get(0).metrics().get(0).name()); + Assertions.assertEquals(1202571290361403211L, model.value().get(0).metrics().get(0).maximumCapacity()); + Assertions.assertEquals(4704412525137839440L, model.value().get(0).metrics().get(0).reservationCapacity()); + Assertions.assertEquals(2901020239591748865L, model.value().get(0).metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("uwhhmhykojoxafn", model.value().get(0).managedIdentities().get(0).name()); + Assertions.assertEquals("dlpichkoymkcdyhb", model.value().get(0).managedIdentities().get(0).principalId()); + Assertions.assertEquals("beddgssofw", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourcePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourcePropertiesTests.java index f11c9c0f6d49..e1b6f8949070 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourcePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourcePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -23,177 +23,200 @@ public final class ApplicationResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationResourceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"cugicjoox\",\"typeName\":\"ebwpucwwfvo\",\"typeVersion\":\"vmeueci\",\"parameters\":{\"ueiotwmcdyt\":\"zceuojgjrw\",\"it\":\"x\",\"hniskxfbkpyc\":\"nrjawgqwg\",\"l\":\"klwndnhjdauwhv\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"tdhxujznbmpowuwp\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"alupjm\",\"healthCheckStableDuration\":\"fxobbcsws\",\"healthCheckRetryTimeout\":\"jriplrbpbewtghf\",\"upgradeTimeout\":\"lcgwxzvlvqh\",\"upgradeDomainTimeout\":\"begibtnmxiebwwa\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":193613480,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1214313613,\"maxPercentUnhealthyPartitionsPerService\":1999029226,\"maxPercentUnhealthyReplicasPerPartition\":350152394},\"serviceTypeHealthPolicyMap\":{\"xongmtsavjcbpwxq\":{\"maxPercentUnhealthyServices\":580617744,\"maxPercentUnhealthyPartitionsPerService\":1773507503,\"maxPercentUnhealthyReplicasPerPartition\":957944639},\"guvriuhprwmd\":{\"maxPercentUnhealthyServices\":2036529105,\"maxPercentUnhealthyPartitionsPerService\":899256068,\"maxPercentUnhealthyReplicasPerPartition\":168456950}}},\"upgradeMode\":\"UnmonitoredManual\",\"recreateApplication\":true},\"minimumNodes\":2034996394765032908,\"maximumNodes\":1536045625796396557,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"exrmcqibycnojvk\",\"maximumCapacity\":35726863806871709,\"reservationCapacity\":5974438687973844921,\"totalApplicationCapacity\":2641489064592308886}],\"managedIdentities\":[{\"name\":\"pjyzhpv\",\"principalId\":\"qzcjrvxdj\"}]}") + "{\"provisioningState\":\"klwndnhjdauwhv\",\"typeName\":\"wzbtdhxu\",\"typeVersion\":\"nbmpowuwprzq\",\"parameters\":{\"xobbcswsrt\":\"ualupjmkh\",\"fgb\":\"riplrbpbewtg\",\"wxzvlvqhjkb\":\"c\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"btn\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"aloayqcgwrtzju\",\"healthCheckStableDuration\":\"wyzmhtxon\",\"healthCheckRetryTimeout\":\"ts\",\"upgradeTimeout\":\"jcbpwxqpsrknft\",\"upgradeDomainTimeout\":\"vriuhprwmdyvx\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":1285325454,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":438099264,\"maxPercentUnhealthyPartitionsPerService\":1692678524,\"maxPercentUnhealthyReplicasPerPartition\":1731999756},\"serviceTypeHealthPolicyMap\":{\"ycnojvknmefqsg\":{\"maxPercentUnhealthyServices\":591654502,\"maxPercentUnhealthyPartitionsPerService\":1070859381,\"maxPercentUnhealthyReplicasPerPartition\":75631080},\"y\":{\"maxPercentUnhealthyServices\":488274582,\"maxPercentUnhealthyPartitionsPerService\":673503494,\"maxPercentUnhealthyReplicasPerPartition\":2048055130},\"cjrvxdjzlmwlxkv\":{\"maxPercentUnhealthyServices\":1715507551,\"maxPercentUnhealthyPartitionsPerService\":1436102139,\"maxPercentUnhealthyReplicasPerPartition\":1600165537},\"awjvzunluthnnp\":{\"maxPercentUnhealthyServices\":2069794521,\"maxPercentUnhealthyPartitionsPerService\":2083539395,\"maxPercentUnhealthyReplicasPerPartition\":367747592}}},\"upgradeMode\":\"Monitored\",\"recreateApplication\":true},\"minimumNodes\":5932800953363791028,\"maximumNodes\":9175582925413911806,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"dultskz\",\"maximumCapacity\":4081350992268546174,\"reservationCapacity\":7634406477561723692,\"totalApplicationCapacity\":1034020554196499109},{\"name\":\"gpw\",\"maximumCapacity\":1337598975315689836,\"reservationCapacity\":3149301159489801914,\"totalApplicationCapacity\":7379382176055534977},{\"name\":\"ofd\",\"maximumCapacity\":2231495557958341680,\"reservationCapacity\":9034742248359542998,\"totalApplicationCapacity\":6111502538155343708},{\"name\":\"aboekqv\",\"maximumCapacity\":2699583635820054770,\"reservationCapacity\":2597163492495193220,\"totalApplicationCapacity\":1351796954280851707}],\"managedIdentities\":[{\"name\":\"sflhhca\",\"principalId\":\"lnjixisxya\"},{\"name\":\"joya\",\"principalId\":\"cslyjpk\"},{\"name\":\"idzyexznelixhnr\",\"principalId\":\"tfolhbnx\"},{\"name\":\"nalaulppg\",\"principalId\":\"dtpnapnyiropuhp\"}]}") .toObject(ApplicationResourceProperties.class); - Assertions.assertEquals("vmeueci", model.typeVersion()); - Assertions.assertEquals("zceuojgjrw", model.parameters().get("ueiotwmcdyt")); - Assertions.assertEquals("tdhxujznbmpowuwp", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); + Assertions.assertEquals("nbmpowuwprzq", model.typeVersion()); + Assertions.assertEquals("ualupjmkh", model.parameters().get("xobbcswsrt")); + Assertions.assertEquals("btn", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("alupjm", + Assertions.assertEquals("aloayqcgwrtzju", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("fxobbcsws", + Assertions.assertEquals("wyzmhtxon", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jriplrbpbewtghf", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("lcgwxzvlvqh", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("begibtnmxiebwwa", + Assertions.assertEquals("ts", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); + Assertions.assertEquals("jcbpwxqpsrknft", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("vriuhprwmdyvx", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(193613480, + Assertions.assertTrue(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(1285325454, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1214313613, + Assertions.assertEquals(438099264, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1999029226, + Assertions.assertEquals(1692678524, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(350152394, + Assertions.assertEquals(1731999756, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(580617744, + Assertions.assertEquals(591654502, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1773507503, + Assertions.assertEquals(1070859381, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(957944639, + Assertions.assertEquals(75631080, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_MANUAL, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(2034996394765032908L, model.minimumNodes()); - Assertions.assertEquals(1536045625796396557L, model.maximumNodes()); - Assertions.assertEquals(false, model.removeApplicationCapacity()); - Assertions.assertEquals("exrmcqibycnojvk", model.metrics().get(0).name()); - Assertions.assertEquals(35726863806871709L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(5974438687973844921L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(2641489064592308886L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("pjyzhpv", model.managedIdentities().get(0).name()); - Assertions.assertEquals("qzcjrvxdj", model.managedIdentities().get(0).principalId()); - Assertions.assertEquals("ebwpucwwfvo", model.typeName()); + Assertions.assertEquals(RollingUpgradeMode.MONITORED, model.upgradePolicy().upgradeMode()); + Assertions.assertTrue(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(5932800953363791028L, model.minimumNodes()); + Assertions.assertEquals(9175582925413911806L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("dultskz", model.metrics().get(0).name()); + Assertions.assertEquals(4081350992268546174L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(7634406477561723692L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(1034020554196499109L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("sflhhca", model.managedIdentities().get(0).name()); + Assertions.assertEquals("lnjixisxya", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals("wzbtdhxu", model.typeName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationResourceProperties model = new ApplicationResourceProperties().withTypeVersion("vmeueci") - .withParameters( - mapOf("ueiotwmcdyt", "zceuojgjrw", "it", "x", "hniskxfbkpyc", "nrjawgqwg", "l", "klwndnhjdauwhv")) - .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("tdhxujznbmpowuwp") + ApplicationResourceProperties model = new ApplicationResourceProperties().withTypeVersion("nbmpowuwprzq") + .withParameters(mapOf("xobbcswsrt", "ualupjmkh", "fgb", "riplrbpbewtg", "wxzvlvqhjkb", "c")) + .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("btn") .withForceRestart(true) .withRollingUpgradeMonitoringPolicy( new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) - .withHealthCheckWaitDuration("alupjm") - .withHealthCheckStableDuration("fxobbcsws") - .withHealthCheckRetryTimeout("jriplrbpbewtghf") - .withUpgradeTimeout("lcgwxzvlvqh") - .withUpgradeDomainTimeout("begibtnmxiebwwa")) + .withHealthCheckWaitDuration("aloayqcgwrtzju") + .withHealthCheckStableDuration("wyzmhtxon") + .withHealthCheckRetryTimeout("ts") + .withUpgradeTimeout("jcbpwxqpsrknft") + .withUpgradeDomainTimeout("vriuhprwmdyvx")) .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(193613480) + .withMaxPercentUnhealthyDeployedApplications(1285325454) .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1214313613) - .withMaxPercentUnhealthyPartitionsPerService(1999029226) - .withMaxPercentUnhealthyReplicasPerPartition(350152394)) - .withServiceTypeHealthPolicyMap(mapOf("xongmtsavjcbpwxq", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(580617744) - .withMaxPercentUnhealthyPartitionsPerService(1773507503) - .withMaxPercentUnhealthyReplicasPerPartition(957944639), - "guvriuhprwmd", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2036529105) - .withMaxPercentUnhealthyPartitionsPerService(899256068) - .withMaxPercentUnhealthyReplicasPerPartition(168456950)))) - .withUpgradeMode(RollingUpgradeMode.UNMONITORED_MANUAL) + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(438099264) + .withMaxPercentUnhealthyPartitionsPerService(1692678524) + .withMaxPercentUnhealthyReplicasPerPartition(1731999756)) + .withServiceTypeHealthPolicyMap(mapOf("ycnojvknmefqsg", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(591654502) + .withMaxPercentUnhealthyPartitionsPerService(1070859381) + .withMaxPercentUnhealthyReplicasPerPartition(75631080), + "y", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(488274582) + .withMaxPercentUnhealthyPartitionsPerService(673503494) + .withMaxPercentUnhealthyReplicasPerPartition(2048055130), + "cjrvxdjzlmwlxkv", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1715507551) + .withMaxPercentUnhealthyPartitionsPerService(1436102139) + .withMaxPercentUnhealthyReplicasPerPartition(1600165537), + "awjvzunluthnnp", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2069794521) + .withMaxPercentUnhealthyPartitionsPerService(2083539395) + .withMaxPercentUnhealthyReplicasPerPartition(367747592)))) + .withUpgradeMode(RollingUpgradeMode.MONITORED) .withRecreateApplication(true)) - .withMinimumNodes(2034996394765032908L) - .withMaximumNodes(1536045625796396557L) + .withMinimumNodes(5932800953363791028L) + .withMaximumNodes(9175582925413911806L) .withRemoveApplicationCapacity(false) - .withMetrics(Arrays.asList(new ApplicationMetricDescription().withName("exrmcqibycnojvk") - .withMaximumCapacity(35726863806871709L) - .withReservationCapacity(5974438687973844921L) - .withTotalApplicationCapacity(2641489064592308886L))) + .withMetrics(Arrays.asList( + new ApplicationMetricDescription().withName("dultskz") + .withMaximumCapacity(4081350992268546174L) + .withReservationCapacity(7634406477561723692L) + .withTotalApplicationCapacity(1034020554196499109L), + new ApplicationMetricDescription().withName("gpw") + .withMaximumCapacity(1337598975315689836L) + .withReservationCapacity(3149301159489801914L) + .withTotalApplicationCapacity(7379382176055534977L), + new ApplicationMetricDescription().withName("ofd") + .withMaximumCapacity(2231495557958341680L) + .withReservationCapacity(9034742248359542998L) + .withTotalApplicationCapacity(6111502538155343708L), + new ApplicationMetricDescription().withName("aboekqv") + .withMaximumCapacity(2699583635820054770L) + .withReservationCapacity(2597163492495193220L) + .withTotalApplicationCapacity(1351796954280851707L))) .withManagedIdentities( - Arrays.asList(new ApplicationUserAssignedIdentity().withName("pjyzhpv").withPrincipalId("qzcjrvxdj"))) - .withTypeName("ebwpucwwfvo"); + Arrays.asList(new ApplicationUserAssignedIdentity().withName("sflhhca").withPrincipalId("lnjixisxya"), + new ApplicationUserAssignedIdentity().withName("joya").withPrincipalId("cslyjpk"), + new ApplicationUserAssignedIdentity().withName("idzyexznelixhnr").withPrincipalId("tfolhbnx"), + new ApplicationUserAssignedIdentity().withName("nalaulppg").withPrincipalId("dtpnapnyiropuhp"))) + .withTypeName("wzbtdhxu"); model = BinaryData.fromObject(model).toObject(ApplicationResourceProperties.class); - Assertions.assertEquals("vmeueci", model.typeVersion()); - Assertions.assertEquals("zceuojgjrw", model.parameters().get("ueiotwmcdyt")); - Assertions.assertEquals("tdhxujznbmpowuwp", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); + Assertions.assertEquals("nbmpowuwprzq", model.typeVersion()); + Assertions.assertEquals("ualupjmkh", model.parameters().get("xobbcswsrt")); + Assertions.assertEquals("btn", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("alupjm", + Assertions.assertEquals("aloayqcgwrtzju", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("fxobbcsws", + Assertions.assertEquals("wyzmhtxon", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jriplrbpbewtghf", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("lcgwxzvlvqh", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("begibtnmxiebwwa", + Assertions.assertEquals("ts", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); + Assertions.assertEquals("jcbpwxqpsrknft", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("vriuhprwmdyvx", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(193613480, + Assertions.assertTrue(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(1285325454, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1214313613, + Assertions.assertEquals(438099264, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1999029226, + Assertions.assertEquals(1692678524, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(350152394, + Assertions.assertEquals(1731999756, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(580617744, + Assertions.assertEquals(591654502, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1773507503, + Assertions.assertEquals(1070859381, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(957944639, + Assertions.assertEquals(75631080, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("xongmtsavjcbpwxq") + .get("ycnojvknmefqsg") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_MANUAL, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(2034996394765032908L, model.minimumNodes()); - Assertions.assertEquals(1536045625796396557L, model.maximumNodes()); - Assertions.assertEquals(false, model.removeApplicationCapacity()); - Assertions.assertEquals("exrmcqibycnojvk", model.metrics().get(0).name()); - Assertions.assertEquals(35726863806871709L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(5974438687973844921L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(2641489064592308886L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("pjyzhpv", model.managedIdentities().get(0).name()); - Assertions.assertEquals("qzcjrvxdj", model.managedIdentities().get(0).principalId()); - Assertions.assertEquals("ebwpucwwfvo", model.typeName()); + Assertions.assertEquals(RollingUpgradeMode.MONITORED, model.upgradePolicy().upgradeMode()); + Assertions.assertTrue(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(5932800953363791028L, model.minimumNodes()); + Assertions.assertEquals(9175582925413911806L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("dultskz", model.metrics().get(0).name()); + Assertions.assertEquals(4081350992268546174L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(7634406477561723692L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(1034020554196499109L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("sflhhca", model.managedIdentities().get(0).name()); + Assertions.assertEquals("lnjixisxya", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals("wzbtdhxu", model.typeName()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdatePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdatePropertiesTests.java index ae73722da4e2..2de71066f518 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdatePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -23,185 +23,185 @@ public final class ApplicationResourceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationResourceUpdateProperties model = BinaryData.fromString( - "{\"typeVersion\":\"mwlxk\",\"parameters\":{\"n\":\"fhzovawjvzunluth\",\"pjzu\":\"rnxipei\",\"xdult\":\"e\",\"umveekgpwozuhkf\":\"kzbbtd\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"jyofdxluusdtto\",\"forceRestart\":false,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"qvkelnsm\",\"healthCheckStableDuration\":\"xwyjsflhhc\",\"healthCheckRetryTimeout\":\"lnjixisxya\",\"upgradeTimeout\":\"oyaqcslyjpkiid\",\"upgradeDomainTimeout\":\"exznelixhnr\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":434458515,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":681203122,\"maxPercentUnhealthyPartitionsPerService\":245214837,\"maxPercentUnhealthyReplicasPerPartition\":1615716441},\"serviceTypeHealthPolicyMap\":{\"tpnapnyiropuhpig\":{\"maxPercentUnhealthyServices\":703973266,\"maxPercentUnhealthyPartitionsPerService\":1181953038,\"maxPercentUnhealthyReplicasPerPartition\":1784168921},\"git\":{\"maxPercentUnhealthyServices\":2140009722,\"maxPercentUnhealthyPartitionsPerService\":882329549,\"maxPercentUnhealthyReplicasPerPartition\":2050375248},\"slynqwwnc\":{\"maxPercentUnhealthyServices\":613009021,\"maxPercentUnhealthyPartitionsPerService\":793940530,\"maxPercentUnhealthyReplicasPerPartition\":119641642},\"trmgucnapkte\":{\"maxPercentUnhealthyServices\":960001198,\"maxPercentUnhealthyPartitionsPerService\":668336306,\"maxPercentUnhealthyReplicasPerPartition\":953152084}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false},\"minimumNodes\":890292148209334382,\"maximumNodes\":6017861895471041953,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"ac\",\"maximumCapacity\":5643404182194544806,\"reservationCapacity\":5106866103000080845,\"totalApplicationCapacity\":8003552029695467607}],\"managedIdentities\":[{\"name\":\"pppcqeqxo\",\"principalId\":\"z\"},{\"name\":\"ahzxctobgbk\",\"principalId\":\"moizpos\"}]}") + "{\"typeVersion\":\"vpgylgqgitxmed\",\"parameters\":{\"zzhxgktrm\":\"slynqwwnc\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"napkteoellw\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"fqbuaceopzf\",\"healthCheckStableDuration\":\"hhuao\",\"healthCheckRetryTimeout\":\"pcqeqx\",\"upgradeTimeout\":\"z\",\"upgradeDomainTimeout\":\"hzxct\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":541806665,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1356840761,\"maxPercentUnhealthyPartitionsPerService\":1358257343,\"maxPercentUnhealthyReplicasPerPartition\":2046724372},\"serviceTypeHealthPolicyMap\":{\"nrmfqjhhk\":{\"maxPercentUnhealthyServices\":1928399629,\"maxPercentUnhealthyPartitionsPerService\":1065588244,\"maxPercentUnhealthyReplicasPerPartition\":1002036598},\"jhxxjyn\":{\"maxPercentUnhealthyServices\":1199001730,\"maxPercentUnhealthyPartitionsPerService\":478088407,\"maxPercentUnhealthyReplicasPerPartition\":685095993}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false},\"minimumNodes\":1111219125512367618,\"maximumNodes\":3673335295650455284,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"zjf\",\"maximumCapacity\":5609959872592066147,\"reservationCapacity\":5651552711145690194,\"totalApplicationCapacity\":8265803148006565496},{\"name\":\"tvtc\",\"maximumCapacity\":3989982721308647052,\"reservationCapacity\":6414157962649478285,\"totalApplicationCapacity\":4668269847268047385},{\"name\":\"vwvxyslqbhsfx\",\"maximumCapacity\":2977681561409094554,\"reservationCapacity\":417427937976699125,\"totalApplicationCapacity\":3681757867502856948},{\"name\":\"wwwfbkr\",\"maximumCapacity\":3908578506994645119,\"reservationCapacity\":4006336074042634608,\"totalApplicationCapacity\":9156021725393296882}],\"managedIdentities\":[{\"name\":\"crsbfovasr\",\"principalId\":\"uvwbhsqfs\"}]}") .toObject(ApplicationResourceUpdateProperties.class); - Assertions.assertEquals("mwlxk", model.typeVersion()); - Assertions.assertEquals("fhzovawjvzunluth", model.parameters().get("n")); - Assertions.assertEquals("jyofdxluusdtto", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(false, model.upgradePolicy().forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, + Assertions.assertEquals("vpgylgqgitxmed", model.typeVersion()); + Assertions.assertEquals("slynqwwnc", model.parameters().get("zzhxgktrm")); + Assertions.assertEquals("napkteoellw", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("qvkelnsm", + Assertions.assertEquals("fqbuaceopzf", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("xwyjsflhhc", + Assertions.assertEquals("hhuao", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("lnjixisxya", + Assertions.assertEquals("pcqeqx", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("oyaqcslyjpkiid", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("exznelixhnr", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(false, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(434458515, + Assertions.assertEquals("z", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("hzxct", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertFalse(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(541806665, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(681203122, + Assertions.assertEquals(1356840761, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(245214837, + Assertions.assertEquals(1358257343, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1615716441, + Assertions.assertEquals(2046724372, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(703973266, + Assertions.assertEquals(1928399629, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1181953038, + Assertions.assertEquals(1065588244, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1784168921, + Assertions.assertEquals(1002036598, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyReplicasPerPartition()); Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(false, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(890292148209334382L, model.minimumNodes()); - Assertions.assertEquals(6017861895471041953L, model.maximumNodes()); - Assertions.assertEquals(true, model.removeApplicationCapacity()); - Assertions.assertEquals("ac", model.metrics().get(0).name()); - Assertions.assertEquals(5643404182194544806L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(5106866103000080845L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(8003552029695467607L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("pppcqeqxo", model.managedIdentities().get(0).name()); - Assertions.assertEquals("z", model.managedIdentities().get(0).principalId()); + Assertions.assertFalse(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(1111219125512367618L, model.minimumNodes()); + Assertions.assertEquals(3673335295650455284L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("zjf", model.metrics().get(0).name()); + Assertions.assertEquals(5609959872592066147L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(5651552711145690194L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(8265803148006565496L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("crsbfovasr", model.managedIdentities().get(0).name()); + Assertions.assertEquals("uvwbhsqfs", model.managedIdentities().get(0).principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationResourceUpdateProperties model = new ApplicationResourceUpdateProperties().withTypeVersion("mwlxk") - .withParameters( - mapOf("n", "fhzovawjvzunluth", "pjzu", "rnxipei", "xdult", "e", "umveekgpwozuhkf", "kzbbtd")) - .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("jyofdxluusdtto") - .withForceRestart(false) - .withRollingUpgradeMonitoringPolicy( - new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.ROLLBACK) - .withHealthCheckWaitDuration("qvkelnsm") - .withHealthCheckStableDuration("xwyjsflhhc") - .withHealthCheckRetryTimeout("lnjixisxya") - .withUpgradeTimeout("oyaqcslyjpkiid") - .withUpgradeDomainTimeout("exznelixhnr")) - .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(false) - .withMaxPercentUnhealthyDeployedApplications(434458515) - .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(681203122) - .withMaxPercentUnhealthyPartitionsPerService(245214837) - .withMaxPercentUnhealthyReplicasPerPartition(1615716441)) - .withServiceTypeHealthPolicyMap(mapOf("tpnapnyiropuhpig", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(703973266) - .withMaxPercentUnhealthyPartitionsPerService(1181953038) - .withMaxPercentUnhealthyReplicasPerPartition(1784168921), - "git", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2140009722) - .withMaxPercentUnhealthyPartitionsPerService(882329549) - .withMaxPercentUnhealthyReplicasPerPartition(2050375248), - "slynqwwnc", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(613009021) - .withMaxPercentUnhealthyPartitionsPerService(793940530) - .withMaxPercentUnhealthyReplicasPerPartition(119641642), - "trmgucnapkte", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(960001198) - .withMaxPercentUnhealthyPartitionsPerService(668336306) - .withMaxPercentUnhealthyReplicasPerPartition(953152084)))) - .withUpgradeMode(RollingUpgradeMode.UNMONITORED_AUTO) - .withRecreateApplication(false)) - .withMinimumNodes(890292148209334382L) - .withMaximumNodes(6017861895471041953L) - .withRemoveApplicationCapacity(true) - .withMetrics(Arrays.asList(new ApplicationMetricDescription().withName("ac") - .withMaximumCapacity(5643404182194544806L) - .withReservationCapacity(5106866103000080845L) - .withTotalApplicationCapacity(8003552029695467607L))) - .withManagedIdentities( - Arrays.asList(new ApplicationUserAssignedIdentity().withName("pppcqeqxo").withPrincipalId("z"), - new ApplicationUserAssignedIdentity().withName("ahzxctobgbk").withPrincipalId("moizpos"))); + ApplicationResourceUpdateProperties model + = new ApplicationResourceUpdateProperties().withTypeVersion("vpgylgqgitxmed") + .withParameters(mapOf("zzhxgktrm", "slynqwwnc")) + .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("napkteoellw") + .withForceRestart(true) + .withRollingUpgradeMonitoringPolicy( + new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) + .withHealthCheckWaitDuration("fqbuaceopzf") + .withHealthCheckStableDuration("hhuao") + .withHealthCheckRetryTimeout("pcqeqx") + .withUpgradeTimeout("z") + .withUpgradeDomainTimeout("hzxct")) + .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(false) + .withMaxPercentUnhealthyDeployedApplications(541806665) + .withDefaultServiceTypeHealthPolicy( + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1356840761) + .withMaxPercentUnhealthyPartitionsPerService(1358257343) + .withMaxPercentUnhealthyReplicasPerPartition(2046724372)) + .withServiceTypeHealthPolicyMap(mapOf("nrmfqjhhk", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1928399629) + .withMaxPercentUnhealthyPartitionsPerService(1065588244) + .withMaxPercentUnhealthyReplicasPerPartition(1002036598), + "jhxxjyn", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1199001730) + .withMaxPercentUnhealthyPartitionsPerService(478088407) + .withMaxPercentUnhealthyReplicasPerPartition(685095993)))) + .withUpgradeMode(RollingUpgradeMode.UNMONITORED_AUTO) + .withRecreateApplication(false)) + .withMinimumNodes(1111219125512367618L) + .withMaximumNodes(3673335295650455284L) + .withRemoveApplicationCapacity(false) + .withMetrics(Arrays.asList( + new ApplicationMetricDescription().withName("zjf") + .withMaximumCapacity(5609959872592066147L) + .withReservationCapacity(5651552711145690194L) + .withTotalApplicationCapacity(8265803148006565496L), + new ApplicationMetricDescription().withName("tvtc") + .withMaximumCapacity(3989982721308647052L) + .withReservationCapacity(6414157962649478285L) + .withTotalApplicationCapacity(4668269847268047385L), + new ApplicationMetricDescription().withName("vwvxyslqbhsfx") + .withMaximumCapacity(2977681561409094554L) + .withReservationCapacity(417427937976699125L) + .withTotalApplicationCapacity(3681757867502856948L), + new ApplicationMetricDescription().withName("wwwfbkr") + .withMaximumCapacity(3908578506994645119L) + .withReservationCapacity(4006336074042634608L) + .withTotalApplicationCapacity(9156021725393296882L))) + .withManagedIdentities(Arrays + .asList(new ApplicationUserAssignedIdentity().withName("crsbfovasr").withPrincipalId("uvwbhsqfs"))); model = BinaryData.fromObject(model).toObject(ApplicationResourceUpdateProperties.class); - Assertions.assertEquals("mwlxk", model.typeVersion()); - Assertions.assertEquals("fhzovawjvzunluth", model.parameters().get("n")); - Assertions.assertEquals("jyofdxluusdtto", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(false, model.upgradePolicy().forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, + Assertions.assertEquals("vpgylgqgitxmed", model.typeVersion()); + Assertions.assertEquals("slynqwwnc", model.parameters().get("zzhxgktrm")); + Assertions.assertEquals("napkteoellw", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("qvkelnsm", + Assertions.assertEquals("fqbuaceopzf", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("xwyjsflhhc", + Assertions.assertEquals("hhuao", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("lnjixisxya", + Assertions.assertEquals("pcqeqx", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("oyaqcslyjpkiid", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("exznelixhnr", - model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(false, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(434458515, + Assertions.assertEquals("z", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("hzxct", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertFalse(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(541806665, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(681203122, + Assertions.assertEquals(1356840761, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(245214837, + Assertions.assertEquals(1358257343, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1615716441, + Assertions.assertEquals(2046724372, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(703973266, + Assertions.assertEquals(1928399629, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1181953038, + Assertions.assertEquals(1065588244, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1784168921, + Assertions.assertEquals(1002036598, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("tpnapnyiropuhpig") + .get("nrmfqjhhk") .maxPercentUnhealthyReplicasPerPartition()); Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(false, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(890292148209334382L, model.minimumNodes()); - Assertions.assertEquals(6017861895471041953L, model.maximumNodes()); - Assertions.assertEquals(true, model.removeApplicationCapacity()); - Assertions.assertEquals("ac", model.metrics().get(0).name()); - Assertions.assertEquals(5643404182194544806L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(5106866103000080845L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(8003552029695467607L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("pppcqeqxo", model.managedIdentities().get(0).name()); - Assertions.assertEquals("z", model.managedIdentities().get(0).principalId()); + Assertions.assertFalse(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(1111219125512367618L, model.minimumNodes()); + Assertions.assertEquals(3673335295650455284L, model.maximumNodes()); + Assertions.assertFalse(model.removeApplicationCapacity()); + Assertions.assertEquals("zjf", model.metrics().get(0).name()); + Assertions.assertEquals(5609959872592066147L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(5651552711145690194L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(8265803148006565496L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("crsbfovasr", model.managedIdentities().get(0).name()); + Assertions.assertEquals("uvwbhsqfs", model.managedIdentities().get(0).principalId()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdateTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdateTests.java index 540d79b79ab6..8f5310fcbbbc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdateTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationResourceUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -23,193 +23,179 @@ public final class ApplicationResourceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationResourceUpdate model = BinaryData.fromString( - "{\"properties\":{\"typeVersion\":\"cym\",\"parameters\":{\"ssl\":\"l\",\"d\":\"lfmmdnbbglzpswi\",\"bzmnvdfznud\":\"cwyhzdxssa\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"vxzbncb\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"bhhxsrzdzuc\",\"healthCheckStableDuration\":\"scdntnevf\",\"healthCheckRetryTimeout\":\"jmygtdsslswtmwer\",\"upgradeTimeout\":\"fzp\",\"upgradeDomainTimeout\":\"semwabnet\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":199039203,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1422875618,\"maxPercentUnhealthyPartitionsPerService\":1522056639,\"maxPercentUnhealthyReplicasPerPartition\":1384508080},\"serviceTypeHealthPolicyMap\":{\"sldnkwwtppjflcxo\":{\"maxPercentUnhealthyServices\":1386333367,\"maxPercentUnhealthyPartitionsPerService\":1072723853,\"maxPercentUnhealthyReplicasPerPartition\":720725723},\"m\":{\"maxPercentUnhealthyServices\":1632551729,\"maxPercentUnhealthyPartitionsPerService\":584568005,\"maxPercentUnhealthyReplicasPerPartition\":204366319},\"qzeqqkdltfzxm\":{\"maxPercentUnhealthyServices\":696489313,\"maxPercentUnhealthyPartitionsPerService\":1995245792,\"maxPercentUnhealthyReplicasPerPartition\":1013346228}}},\"upgradeMode\":\"Invalid\",\"recreateApplication\":true},\"minimumNodes\":290569327537915175,\"maximumNodes\":820800207830190162,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"gxtibqdxbxw\",\"maximumCapacity\":5943284282565637663,\"reservationCapacity\":2666849186413454157,\"totalApplicationCapacity\":1899793527406427487},{\"name\":\"zgx\",\"maximumCapacity\":4187834271496207519,\"reservationCapacity\":822687425279743867,\"totalApplicationCapacity\":5090164062241027652},{\"name\":\"unkbebx\",\"maximumCapacity\":3111756742771823054,\"reservationCapacity\":4511639893659034587,\"totalApplicationCapacity\":3360934059996911895}],\"managedIdentities\":[{\"name\":\"tkoievseotgq\",\"principalId\":\"l\"},{\"name\":\"tmuwlauwzi\",\"principalId\":\"xbmp\"}]},\"location\":\"jefuzmuvpbttdumo\",\"tags\":{\"mnzb\":\"xe\",\"el\":\"bhjpglkfgohdne\",\"fikdowwqu\":\"phsdyhto\"},\"etag\":\"xzxcl\",\"id\":\"thhqzonosggbh\",\"name\":\"ohfwds\",\"type\":\"n\"}") + "{\"properties\":{\"typeVersion\":\"jflcxog\",\"parameters\":{\"nsikvmkqzeqqkdl\":\"onz\",\"bdagxt\":\"fzxmhhvhgureodkw\",\"akbogqxndlkzgxh\":\"bqdxbx\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"plbpodxun\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"byyntwlrbqt\",\"healthCheckStableDuration\":\"ievseotgqrllt\",\"healthCheckRetryTimeout\":\"wlauwzizxbmpg\",\"upgradeTimeout\":\"efuzmuvpbttd\",\"upgradeDomainTimeout\":\"orppxebmnzbtb\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":506889446,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":2140523800,\"maxPercentUnhealthyPartitionsPerService\":1036395530,\"maxPercentUnhealthyReplicasPerPartition\":834040298},\"serviceTypeHealthPolicyMap\":{\"yhtozfikdowwqu\":{\"maxPercentUnhealthyServices\":2052379315,\"maxPercentUnhealthyPartitionsPerService\":571890155,\"maxPercentUnhealthyReplicasPerPartition\":2019789161}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false},\"minimumNodes\":6214959618688242083,\"maximumNodes\":5272627491576584483,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"osggbhc\",\"maximumCapacity\":4942910351281289771,\"reservationCapacity\":6105818768712779964,\"totalApplicationCapacity\":1975392080870414152}],\"managedIdentities\":[{\"name\":\"utiiswacf\",\"principalId\":\"gdkz\"},{\"name\":\"ewkfvhqcrai\",\"principalId\":\"vpnpp\"},{\"name\":\"uflrwd\",\"principalId\":\"hdlxyjrxsagafcn\"}]},\"location\":\"gwq\",\"tags\":{\"pkeqdcvdrhvoo\":\"edgfbcvkcvq\",\"dopcjwvnh\":\"sotbob\"},\"etag\":\"d\",\"id\":\"gx\",\"name\":\"xrslpm\",\"type\":\"twuoegrpkhjwni\"}") .toObject(ApplicationResourceUpdate.class); - Assertions.assertEquals("jefuzmuvpbttdumo", model.location()); - Assertions.assertEquals("xe", model.tags().get("mnzb")); - Assertions.assertEquals("cym", model.typeVersion()); - Assertions.assertEquals("l", model.parameters().get("ssl")); - Assertions.assertEquals("vxzbncb", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, + Assertions.assertEquals("gwq", model.location()); + Assertions.assertEquals("edgfbcvkcvq", model.tags().get("pkeqdcvdrhvoo")); + Assertions.assertEquals("jflcxog", model.typeVersion()); + Assertions.assertEquals("onz", model.parameters().get("nsikvmkqzeqqkdl")); + Assertions.assertEquals("plbpodxun", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("bhhxsrzdzuc", + Assertions.assertEquals("byyntwlrbqt", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("scdntnevf", + Assertions.assertEquals("ievseotgqrllt", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jmygtdsslswtmwer", + Assertions.assertEquals("wlauwzizxbmpg", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fzp", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("semwabnet", + Assertions.assertEquals("efuzmuvpbttd", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("orppxebmnzbtb", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(199039203, + Assertions.assertFalse(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(506889446, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1422875618, + Assertions.assertEquals(2140523800, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1522056639, + Assertions.assertEquals(1036395530, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1384508080, + Assertions.assertEquals(834040298, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1386333367, + Assertions.assertEquals(2052379315, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1072723853, + Assertions.assertEquals(571890155, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(720725723, + Assertions.assertEquals(2019789161, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(290569327537915175L, model.minimumNodes()); - Assertions.assertEquals(820800207830190162L, model.maximumNodes()); - Assertions.assertEquals(true, model.removeApplicationCapacity()); - Assertions.assertEquals("gxtibqdxbxw", model.metrics().get(0).name()); - Assertions.assertEquals(5943284282565637663L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(2666849186413454157L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(1899793527406427487L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("tkoievseotgq", model.managedIdentities().get(0).name()); - Assertions.assertEquals("l", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); + Assertions.assertFalse(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(6214959618688242083L, model.minimumNodes()); + Assertions.assertEquals(5272627491576584483L, model.maximumNodes()); + Assertions.assertTrue(model.removeApplicationCapacity()); + Assertions.assertEquals("osggbhc", model.metrics().get(0).name()); + Assertions.assertEquals(4942910351281289771L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(6105818768712779964L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(1975392080870414152L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("utiiswacf", model.managedIdentities().get(0).name()); + Assertions.assertEquals("gdkz", model.managedIdentities().get(0).principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationResourceUpdate model = new ApplicationResourceUpdate().withLocation("jefuzmuvpbttdumo") - .withTags(mapOf("mnzb", "xe", "el", "bhjpglkfgohdne", "fikdowwqu", "phsdyhto")) - .withTypeVersion("cym") - .withParameters(mapOf("ssl", "l", "d", "lfmmdnbbglzpswi", "bzmnvdfznud", "cwyhzdxssa")) - .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("vxzbncb") + ApplicationResourceUpdate model = new ApplicationResourceUpdate().withLocation("gwq") + .withTags(mapOf("pkeqdcvdrhvoo", "edgfbcvkcvq", "dopcjwvnh", "sotbob")) + .withTypeVersion("jflcxog") + .withParameters(mapOf("nsikvmkqzeqqkdl", "onz", "bdagxt", "fzxmhhvhgureodkw", "akbogqxndlkzgxh", "bqdxbx")) + .withUpgradePolicy(new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("plbpodxun") .withForceRestart(true) .withRollingUpgradeMonitoringPolicy( - new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) - .withHealthCheckWaitDuration("bhhxsrzdzuc") - .withHealthCheckStableDuration("scdntnevf") - .withHealthCheckRetryTimeout("jmygtdsslswtmwer") - .withUpgradeTimeout("fzp") - .withUpgradeDomainTimeout("semwabnet")) - .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(199039203) + new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.ROLLBACK) + .withHealthCheckWaitDuration("byyntwlrbqt") + .withHealthCheckStableDuration("ievseotgqrllt") + .withHealthCheckRetryTimeout("wlauwzizxbmpg") + .withUpgradeTimeout("efuzmuvpbttd") + .withUpgradeDomainTimeout("orppxebmnzbtb")) + .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(false) + .withMaxPercentUnhealthyDeployedApplications(506889446) .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1422875618) - .withMaxPercentUnhealthyPartitionsPerService(1522056639) - .withMaxPercentUnhealthyReplicasPerPartition(1384508080)) - .withServiceTypeHealthPolicyMap(mapOf("sldnkwwtppjflcxo", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1386333367) - .withMaxPercentUnhealthyPartitionsPerService(1072723853) - .withMaxPercentUnhealthyReplicasPerPartition(720725723), - "m", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1632551729) - .withMaxPercentUnhealthyPartitionsPerService(584568005) - .withMaxPercentUnhealthyReplicasPerPartition(204366319), - "qzeqqkdltfzxm", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(696489313) - .withMaxPercentUnhealthyPartitionsPerService(1995245792) - .withMaxPercentUnhealthyReplicasPerPartition(1013346228)))) - .withUpgradeMode(RollingUpgradeMode.INVALID) - .withRecreateApplication(true)) - .withMinimumNodes(290569327537915175L) - .withMaximumNodes(820800207830190162L) + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2140523800) + .withMaxPercentUnhealthyPartitionsPerService(1036395530) + .withMaxPercentUnhealthyReplicasPerPartition(834040298)) + .withServiceTypeHealthPolicyMap(mapOf("yhtozfikdowwqu", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2052379315) + .withMaxPercentUnhealthyPartitionsPerService(571890155) + .withMaxPercentUnhealthyReplicasPerPartition(2019789161)))) + .withUpgradeMode(RollingUpgradeMode.UNMONITORED_AUTO) + .withRecreateApplication(false)) + .withMinimumNodes(6214959618688242083L) + .withMaximumNodes(5272627491576584483L) .withRemoveApplicationCapacity(true) - .withMetrics(Arrays.asList( - new ApplicationMetricDescription().withName("gxtibqdxbxw") - .withMaximumCapacity(5943284282565637663L) - .withReservationCapacity(2666849186413454157L) - .withTotalApplicationCapacity(1899793527406427487L), - new ApplicationMetricDescription().withName("zgx") - .withMaximumCapacity(4187834271496207519L) - .withReservationCapacity(822687425279743867L) - .withTotalApplicationCapacity(5090164062241027652L), - new ApplicationMetricDescription().withName("unkbebx") - .withMaximumCapacity(3111756742771823054L) - .withReservationCapacity(4511639893659034587L) - .withTotalApplicationCapacity(3360934059996911895L))) + .withMetrics(Arrays.asList(new ApplicationMetricDescription().withName("osggbhc") + .withMaximumCapacity(4942910351281289771L) + .withReservationCapacity(6105818768712779964L) + .withTotalApplicationCapacity(1975392080870414152L))) .withManagedIdentities( - Arrays.asList(new ApplicationUserAssignedIdentity().withName("tkoievseotgq").withPrincipalId("l"), - new ApplicationUserAssignedIdentity().withName("tmuwlauwzi").withPrincipalId("xbmp"))); + Arrays.asList(new ApplicationUserAssignedIdentity().withName("utiiswacf").withPrincipalId("gdkz"), + new ApplicationUserAssignedIdentity().withName("ewkfvhqcrai").withPrincipalId("vpnpp"), + new ApplicationUserAssignedIdentity().withName("uflrwd").withPrincipalId("hdlxyjrxsagafcn"))); model = BinaryData.fromObject(model).toObject(ApplicationResourceUpdate.class); - Assertions.assertEquals("jefuzmuvpbttdumo", model.location()); - Assertions.assertEquals("xe", model.tags().get("mnzb")); - Assertions.assertEquals("cym", model.typeVersion()); - Assertions.assertEquals("l", model.parameters().get("ssl")); - Assertions.assertEquals("vxzbncb", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, + Assertions.assertEquals("gwq", model.location()); + Assertions.assertEquals("edgfbcvkcvq", model.tags().get("pkeqdcvdrhvoo")); + Assertions.assertEquals("jflcxog", model.typeVersion()); + Assertions.assertEquals("onz", model.parameters().get("nsikvmkqzeqqkdl")); + Assertions.assertEquals("plbpodxun", model.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.upgradePolicy().forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, model.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("bhhxsrzdzuc", + Assertions.assertEquals("byyntwlrbqt", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("scdntnevf", + Assertions.assertEquals("ievseotgqrllt", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("jmygtdsslswtmwer", + Assertions.assertEquals("wlauwzizxbmpg", model.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fzp", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("semwabnet", + Assertions.assertEquals("efuzmuvpbttd", + model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("orppxebmnzbtb", model.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(199039203, + Assertions.assertFalse(model.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(506889446, model.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1422875618, + Assertions.assertEquals(2140523800, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1522056639, + Assertions.assertEquals(1036395530, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1384508080, + Assertions.assertEquals(834040298, model.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1386333367, + Assertions.assertEquals(2052379315, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1072723853, + Assertions.assertEquals(571890155, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(720725723, + Assertions.assertEquals(2019789161, model.upgradePolicy() .applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("sldnkwwtppjflcxo") + .get("yhtozfikdowwqu") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, model.upgradePolicy().recreateApplication()); - Assertions.assertEquals(290569327537915175L, model.minimumNodes()); - Assertions.assertEquals(820800207830190162L, model.maximumNodes()); - Assertions.assertEquals(true, model.removeApplicationCapacity()); - Assertions.assertEquals("gxtibqdxbxw", model.metrics().get(0).name()); - Assertions.assertEquals(5943284282565637663L, model.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(2666849186413454157L, model.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(1899793527406427487L, model.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("tkoievseotgq", model.managedIdentities().get(0).name()); - Assertions.assertEquals("l", model.managedIdentities().get(0).principalId()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradePolicy().upgradeMode()); + Assertions.assertFalse(model.upgradePolicy().recreateApplication()); + Assertions.assertEquals(6214959618688242083L, model.minimumNodes()); + Assertions.assertEquals(5272627491576584483L, model.maximumNodes()); + Assertions.assertTrue(model.removeApplicationCapacity()); + Assertions.assertEquals("osggbhc", model.metrics().get(0).name()); + Assertions.assertEquals(4942910351281289771L, model.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(6105818768712779964L, model.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(1975392080870414152L, model.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("utiiswacf", model.managedIdentities().get(0).name()); + Assertions.assertEquals("gdkz", model.managedIdentities().get(0).principalId()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceInnerTests.java index 6afba4d22806..c94ca8101d4e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -14,19 +14,19 @@ public final class ApplicationTypeResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeResourceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"dfgiot\"},\"location\":\"tutqxlngxlefgug\",\"tags\":{\"i\":\"rxdq\"},\"etag\":\"thz\",\"id\":\"qdrabhjybigehoqf\",\"name\":\"owskanyktz\",\"type\":\"cuiywgqyw\"}") + "{\"properties\":{\"provisioningState\":\"bavo\"},\"location\":\"zdmohctbqvu\",\"tags\":{\"ujjugwdkcglh\":\"dndnvow\"},\"etag\":\"azjdyggd\",\"id\":\"ixhbkuofqweykhm\",\"name\":\"n\",\"type\":\"vfyexfw\"}") .toObject(ApplicationTypeResourceInner.class); - Assertions.assertEquals("tutqxlngxlefgug", model.location()); - Assertions.assertEquals("rxdq", model.tags().get("i")); + Assertions.assertEquals("zdmohctbqvu", model.location()); + Assertions.assertEquals("dndnvow", model.tags().get("ujjugwdkcglh")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationTypeResourceInner model - = new ApplicationTypeResourceInner().withLocation("tutqxlngxlefgug").withTags(mapOf("i", "rxdq")); + = new ApplicationTypeResourceInner().withLocation("zdmohctbqvu").withTags(mapOf("ujjugwdkcglh", "dndnvow")); model = BinaryData.fromObject(model).toObject(ApplicationTypeResourceInner.class); - Assertions.assertEquals("tutqxlngxlefgug", model.location()); - Assertions.assertEquals("rxdq", model.tags().get("i")); + Assertions.assertEquals("zdmohctbqvu", model.location()); + Assertions.assertEquals("dndnvow", model.tags().get("ujjugwdkcglh")); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceListTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceListTests.java index 857ca546a73e..c177459f4efa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceListTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourceListTests.java @@ -1,49 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResourceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeResourceList; import org.junit.jupiter.api.Assertions; public final class ApplicationTypeResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"hrc\"},\"location\":\"nc\",\"tags\":{\"oo\":\"ecfvmm\"},\"etag\":\"xlzevgbmqjqabcy\",\"id\":\"ivkwlzuvccfwnfnb\",\"name\":\"cfionl\",\"type\":\"bxetqgtzxdpn\"},{\"properties\":{\"provisioningState\":\"qwxrjfeallnw\"},\"location\":\"bisnja\",\"tags\":{\"onq\":\"ngnzscxaqwoochc\",\"ea\":\"pkvlrxn\",\"enjbdlwtgrhp\":\"eipheoflokeyy\"},\"etag\":\"pj\",\"id\":\"asxazjpqyegualhb\",\"name\":\"xhejjzzvdud\",\"type\":\"wdslfhotwmcy\"},{\"properties\":{\"provisioningState\":\"lbjnpgacftadehx\"},\"location\":\"tyfsoppusuesn\",\"tags\":{\"avo\":\"ej\",\"vudwx\":\"xzdmohctb\"},\"etag\":\"dnvowg\",\"id\":\"jugwdkcglhsl\",\"name\":\"zj\",\"type\":\"yggdtjixh\"}],\"nextLink\":\"uofqwe\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"ectehf\"},\"location\":\"scjeypv\",\"tags\":{\"gm\":\"rkgqhcjrefo\",\"yyvxyqjpkcattpn\":\"qsl\",\"v\":\"jcrcczsqpjhvmda\",\"q\":\"ysou\"},\"etag\":\"a\",\"id\":\"ae\",\"name\":\"pfhyhl\",\"type\":\"rpmopjmc\"},{\"properties\":{\"provisioningState\":\"u\"},\"location\":\"thfuiuaodsfcpkvx\",\"tags\":{\"bezy\":\"uozmyzydagfua\",\"wqsmbsur\":\"uokktwhrdxwz\",\"ryocfsfksymdd\":\"xim\"},\"etag\":\"tki\",\"id\":\"xhqyudxorrqnb\",\"name\":\"oczvy\",\"type\":\"fqrvkdvjsllrmvvd\"}],\"nextLink\":\"atkpnp\"}") .toObject(ApplicationTypeResourceList.class); - Assertions.assertEquals("nc", model.value().get(0).location()); - Assertions.assertEquals("ecfvmm", model.value().get(0).tags().get("oo")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationTypeResourceList model = new ApplicationTypeResourceList().withValue( - Arrays.asList(new ApplicationTypeResourceInner().withLocation("nc").withTags(mapOf("oo", "ecfvmm")), - new ApplicationTypeResourceInner().withLocation("bisnja") - .withTags(mapOf("onq", "ngnzscxaqwoochc", "ea", "pkvlrxn", "enjbdlwtgrhp", "eipheoflokeyy")), - new ApplicationTypeResourceInner().withLocation("tyfsoppusuesn") - .withTags(mapOf("avo", "ej", "vudwx", "xzdmohctb")))); - model = BinaryData.fromObject(model).toObject(ApplicationTypeResourceList.class); - Assertions.assertEquals("nc", model.value().get(0).location()); - Assertions.assertEquals("ecfvmm", model.value().get(0).tags().get("oo")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("scjeypv", model.value().get(0).location()); + Assertions.assertEquals("rkgqhcjrefo", model.value().get(0).tags().get("gm")); + Assertions.assertEquals("atkpnp", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourcePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourcePropertiesTests.java index 150d4af8781d..15da084cd6ff 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourcePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeResourcePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -10,7 +10,7 @@ public final class ApplicationTypeResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationTypeResourceProperties model = BinaryData.fromString("{\"provisioningState\":\"drvyn\"}") + ApplicationTypeResourceProperties model = BinaryData.fromString("{\"provisioningState\":\"bcibvyvdcsitynn\"}") .toObject(ApplicationTypeResourceProperties.class); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceInnerTests.java index 680c0e3b5c65..118170f759f8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -14,23 +14,22 @@ public final class ApplicationTypeVersionResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeVersionResourceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"menevfyexfwh\",\"appPackageUrl\":\"bcibvyvdcsitynn\",\"defaultParameterList\":{\"eypvhezrkg\":\"dectehfiqsc\",\"sle\":\"hcjrefovgmk\",\"cattpngjcrcczsq\":\"yvxyqjp\",\"mdajv\":\"jh\"}},\"location\":\"sounqecanoaeu\",\"tags\":{\"tuo\":\"yhltrpmopjmcm\"},\"etag\":\"hfuiuaodsfc\",\"id\":\"vxodpu\",\"name\":\"zmyzydagf\",\"type\":\"axbezyiuo\"}") + "{\"properties\":{\"provisioningState\":\"xxbczwtr\",\"appPackageUrl\":\"wiqzbqjvsovmyo\",\"defaultParameterList\":{\"lb\":\"spkwlhzdobpxjm\",\"wzjuqk\":\"vnchrkcci\",\"iwkuofos\":\"rsa\",\"ugidyjrr\":\"ghsauuimjmvxied\"}},\"location\":\"y\",\"tags\":{\"xc\":\"v\",\"hocohslkev\":\"onpc\",\"hfmvfaxkffe\":\"eggzfb\",\"sbbzo\":\"ithlvmezyvshxm\"},\"etag\":\"igrxwburvjxxjn\",\"id\":\"ydptkoen\",\"name\":\"ou\",\"type\":\"nvudwtiukb\"}") .toObject(ApplicationTypeVersionResourceInner.class); - Assertions.assertEquals("sounqecanoaeu", model.location()); - Assertions.assertEquals("yhltrpmopjmcm", model.tags().get("tuo")); - Assertions.assertEquals("bcibvyvdcsitynn", model.appPackageUrl()); + Assertions.assertEquals("y", model.location()); + Assertions.assertEquals("v", model.tags().get("xc")); + Assertions.assertEquals("wiqzbqjvsovmyo", model.appPackageUrl()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationTypeVersionResourceInner model - = new ApplicationTypeVersionResourceInner().withLocation("sounqecanoaeu") - .withTags(mapOf("tuo", "yhltrpmopjmcm")) - .withAppPackageUrl("bcibvyvdcsitynn"); + ApplicationTypeVersionResourceInner model = new ApplicationTypeVersionResourceInner().withLocation("y") + .withTags(mapOf("xc", "v", "hocohslkev", "onpc", "hfmvfaxkffe", "eggzfb", "sbbzo", "ithlvmezyvshxm")) + .withAppPackageUrl("wiqzbqjvsovmyo"); model = BinaryData.fromObject(model).toObject(ApplicationTypeVersionResourceInner.class); - Assertions.assertEquals("sounqecanoaeu", model.location()); - Assertions.assertEquals("yhltrpmopjmcm", model.tags().get("tuo")); - Assertions.assertEquals("bcibvyvdcsitynn", model.appPackageUrl()); + Assertions.assertEquals("y", model.location()); + Assertions.assertEquals("v", model.tags().get("xc")); + Assertions.assertEquals("wiqzbqjvsovmyo", model.appPackageUrl()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceListTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceListTests.java index 2a86a0955ef4..8fa70b0127a3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceListTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourceListTests.java @@ -1,60 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; -import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResourceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.servicefabric.implementation.models.ApplicationTypeVersionResourceList; import org.junit.jupiter.api.Assertions; public final class ApplicationTypeVersionResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeVersionResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"nbpoczvyifqrvkdv\",\"appPackageUrl\":\"sllr\",\"defaultParameterList\":{\"watkpnpulexxb\":\"d\",\"yokacspkw\":\"zwtruwiqzbqjvsov\",\"rkcciwwzjuqk\":\"hzdobpxjmflbvvnc\"}},\"location\":\"sa\",\"tags\":{\"foskghsauuimj\":\"ku\",\"rfbyaosvexcso\":\"vxieduugidyj\",\"vleggzfbuhfmvfax\":\"pclhocohslk\",\"hl\":\"ffeii\"},\"etag\":\"ez\",\"id\":\"shxmzsbbzoggigrx\",\"name\":\"burvjxxjnspy\",\"type\":\"ptkoenkoukn\"},{\"properties\":{\"provisioningState\":\"wtiukbldn\",\"appPackageUrl\":\"kpoc\",\"defaultParameterList\":{\"xoegukgjnpiucgy\":\"z\",\"zcdrqjsdpydnfyhx\":\"evqzntypmrbp\",\"ifsjttgzfbishcb\":\"eoejzic\"}},\"location\":\"ajdeyeamdphaga\",\"tags\":{\"ow\":\"uxwgipwho\",\"injep\":\"gshwankixz\"},\"etag\":\"tmryw\",\"id\":\"zoqftiyqzrnkcqvy\",\"name\":\"lwh\",\"type\":\"lsicohoqqnwv\"},{\"properties\":{\"provisioningState\":\"avwhheunm\",\"appPackageUrl\":\"qhgyxzkonocukok\",\"defaultParameterList\":{\"szfkbe\":\"xuconu\",\"jmwvvj\":\"pewr\"}},\"location\":\"tcxsenhwlrs\",\"tags\":{\"qdqgbi\":\"zpwv\",\"fcivfsnkym\":\"ylihkaetckt\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\"},\"etag\":\"rbirphxe\",\"id\":\"yva\",\"name\":\"fnljky\",\"type\":\"xjvuujqgidokg\"},{\"properties\":{\"provisioningState\":\"yoxgvcltbgsnc\",\"appPackageUrl\":\"hkjeszzhbi\",\"defaultParameterList\":{\"mpvecxgodebfqk\":\"xfvgxbfsmxne\",\"flz\":\"rbmpukgri\"}},\"location\":\"bxzpuzycisp\",\"tags\":{\"y\":\"ahmgkbrp\",\"rgvtqag\":\"hibnuqqkpika\",\"bfs\":\"buynhijggm\",\"rcvpnazzmhjrunmp\":\"arbu\"},\"etag\":\"tdbhrbnla\",\"id\":\"xmyskp\",\"name\":\"henbtkcxywnytn\",\"type\":\"synlqidybyxczfc\"}],\"nextLink\":\"aaxdbabphlwrq\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"tgzfbishcbkh\",\"appPackageUrl\":\"jdeyeamdpha\",\"defaultParameterList\":{\"wkgshwa\":\"pbuxwgipwhon\",\"bin\":\"kix\",\"iyqzrnk\":\"eputtmrywnuzoqf\",\"qnwvlrya\":\"qvyxlwhzlsicoho\"}},\"location\":\"hheunmmqhgyx\",\"tags\":{\"koklya\":\"noc\",\"ewrmjmwvvjektc\":\"uconuqszfkbey\"},\"etag\":\"enhwlrs\",\"id\":\"rzpwvlqdqgbiq\",\"name\":\"lihkaetcktvfc\",\"type\":\"vf\"},{\"properties\":{\"provisioningState\":\"ymuctqhjfbebrj\",\"appPackageUrl\":\"xerf\",\"defaultParameterList\":{\"rp\":\"tttxfvjrb\",\"jky\":\"xepcyvahfn\",\"ljyoxgvcltb\":\"xjvuujqgidokg\",\"bijhtxfvgxbf\":\"sncghkjeszz\"}},\"location\":\"xnehmpvec\",\"tags\":{\"flz\":\"debfqkkrbmpukgri\",\"qzahmgkbrp\":\"fbxzpuzycisp\",\"hibnuqqkpika\":\"y\",\"buynhijggm\":\"rgvtqag\"},\"etag\":\"fsiarbutr\",\"id\":\"pnazzm\",\"name\":\"jrunmpxtt\",\"type\":\"bh\"},{\"properties\":{\"provisioningState\":\"l\",\"appPackageUrl\":\"nkxmyskpbhenbtk\",\"defaultParameterList\":{\"y\":\"w\"}},\"location\":\"rsyn\",\"tags\":{\"dbabp\":\"dybyxczfclhaa\",\"fkts\":\"lwrq\",\"nyyazttbtwwrqpue\":\"hsucoc\"},\"etag\":\"kzywbiex\",\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"}],\"nextLink\":\"wbavxbniwdj\"}") .toObject(ApplicationTypeVersionResourceList.class); - Assertions.assertEquals("sa", model.value().get(0).location()); - Assertions.assertEquals("ku", model.value().get(0).tags().get("foskghsauuimj")); - Assertions.assertEquals("sllr", model.value().get(0).appPackageUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationTypeVersionResourceList model = new ApplicationTypeVersionResourceList().withValue(Arrays.asList( - new ApplicationTypeVersionResourceInner().withLocation("sa") - .withTags(mapOf("foskghsauuimj", "ku", "rfbyaosvexcso", "vxieduugidyj", "vleggzfbuhfmvfax", - "pclhocohslk", "hl", "ffeii")) - .withAppPackageUrl("sllr"), - new ApplicationTypeVersionResourceInner().withLocation("ajdeyeamdphaga") - .withTags(mapOf("ow", "uxwgipwho", "injep", "gshwankixz")) - .withAppPackageUrl("kpoc"), - new ApplicationTypeVersionResourceInner().withLocation("tcxsenhwlrs") - .withTags(mapOf("qdqgbi", "zpwv", "fcivfsnkym", "ylihkaetckt", "jf", "ctq", "fuwutttxf", "ebrjcxe")) - .withAppPackageUrl("qhgyxzkonocukok"), - new ApplicationTypeVersionResourceInner().withLocation("bxzpuzycisp") - .withTags( - mapOf("y", "ahmgkbrp", "rgvtqag", "hibnuqqkpika", "bfs", "buynhijggm", "rcvpnazzmhjrunmp", "arbu")) - .withAppPackageUrl("hkjeszzhbi"))); - model = BinaryData.fromObject(model).toObject(ApplicationTypeVersionResourceList.class); - Assertions.assertEquals("sa", model.value().get(0).location()); - Assertions.assertEquals("ku", model.value().get(0).tags().get("foskghsauuimj")); - Assertions.assertEquals("sllr", model.value().get(0).appPackageUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("hheunmmqhgyx", model.value().get(0).location()); + Assertions.assertEquals("noc", model.value().get(0).tags().get("koklya")); + Assertions.assertEquals("jdeyeamdpha", model.value().get(0).appPackageUrl()); + Assertions.assertEquals("wbavxbniwdj", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourcePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourcePropertiesTests.java index 373b2ad4c54e..fa596166a31b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourcePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionResourcePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,16 +12,16 @@ public final class ApplicationTypeVersionResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeVersionResourceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"twhrdxwzywqsm\",\"appPackageUrl\":\"surex\",\"defaultParameterList\":{\"stkiiuxhqyud\":\"ryocfsfksymdd\"}}") + "{\"provisioningState\":\"ngkpocipazy\",\"appPackageUrl\":\"o\",\"defaultParameterList\":{\"iucgygevqzn\":\"kgjn\",\"rbpizc\":\"yp\",\"j\":\"r\",\"yhxdeoejzicwi\":\"dpydn\"}}") .toObject(ApplicationTypeVersionResourceProperties.class); - Assertions.assertEquals("surex", model.appPackageUrl()); + Assertions.assertEquals("o", model.appPackageUrl()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationTypeVersionResourceProperties model - = new ApplicationTypeVersionResourceProperties().withAppPackageUrl("surex"); + = new ApplicationTypeVersionResourceProperties().withAppPackageUrl("o"); model = BinaryData.fromObject(model).toObject(ApplicationTypeVersionResourceProperties.class); - Assertions.assertEquals("surex", model.appPackageUrl()); + Assertions.assertEquals("o", model.appPackageUrl()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCleanupPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCleanupPolicyTests.java index dde76300a5b8..b4245639158c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCleanupPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsCleanupPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,16 +12,16 @@ public final class ApplicationTypeVersionsCleanupPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationTypeVersionsCleanupPolicy model - = BinaryData.fromString("{\"maxUnusedVersionsToKeep\":6101750029331136264}") + = BinaryData.fromString("{\"maxUnusedVersionsToKeep\":3202297530026478124}") .toObject(ApplicationTypeVersionsCleanupPolicy.class); - Assertions.assertEquals(6101750029331136264L, model.maxUnusedVersionsToKeep()); + Assertions.assertEquals(3202297530026478124L, model.maxUnusedVersionsToKeep()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationTypeVersionsCleanupPolicy model - = new ApplicationTypeVersionsCleanupPolicy().withMaxUnusedVersionsToKeep(6101750029331136264L); + = new ApplicationTypeVersionsCleanupPolicy().withMaxUnusedVersionsToKeep(3202297530026478124L); model = BinaryData.fromObject(model).toObject(ApplicationTypeVersionsCleanupPolicy.class); - Assertions.assertEquals(6101750029331136264L, model.maxUnusedVersionsToKeep()); + Assertions.assertEquals(3202297530026478124L, model.maxUnusedVersionsToKeep()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetWithResponseMockTests.java index d1410dd840ef..61c963c94502 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResource; @@ -21,21 +21,21 @@ public final class ApplicationTypeVersionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"ftpipiwyczu\",\"appPackageUrl\":\"xacpqjli\",\"defaultParameterList\":{\"asdvl\":\"usps\",\"mrsreuzvxurisjnh\":\"fwdgzxulucvp\"}},\"location\":\"txifqj\",\"tags\":{\"sutrgjup\":\"mrhublwpc\",\"jqgwzp\":\"uutpwoqhih\"},\"etag\":\"qntcypsxjvfoimwk\",\"id\":\"ircizjxvy\",\"name\":\"fceacvlhvygd\",\"type\":\"ftumrtwnawjslbiw\"}"; + = "{\"properties\":{\"provisioningState\":\"nfqn\",\"appPackageUrl\":\"cypsxjv\",\"defaultParameterList\":{\"ircizjxvy\":\"mwks\",\"ftumrtwnawjslbiw\":\"fceacvlhvygd\",\"fmznba\":\"ojgcyzt\"}},\"location\":\"ph\",\"tags\":{\"ehuwrykqgaifmvik\":\"nrnrp\",\"xcv\":\"bydvkhbejdz\",\"v\":\"srhnjivo\",\"jdftuljltd\":\"novqfzge\"},\"etag\":\"eamtmcz\",\"id\":\"m\",\"name\":\"jw\",\"type\":\"w\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ApplicationTypeVersionResource response = manager.applicationTypeVersions() - .getWithResponse("dshf", "snrbgyefrymsgao", "fmwncotmrfh", "rctym", com.azure.core.util.Context.NONE) + .getWithResponse("lw", "cesutrgjupauut", "woqhihe", "qg", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("txifqj", response.location()); - Assertions.assertEquals("mrhublwpc", response.tags().get("sutrgjup")); - Assertions.assertEquals("xacpqjli", response.appPackageUrl()); + Assertions.assertEquals("ph", response.location()); + Assertions.assertEquals("nrnrp", response.tags().get("ehuwrykqgaifmvik")); + Assertions.assertEquals("cypsxjv", response.appPackageUrl()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListMockTests.java index 19983d77b8c4..6b76ecb86f63 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypeVersionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResource; @@ -22,20 +22,20 @@ public final class ApplicationTypeVersionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"qgaifmviklbydv\",\"appPackageUrl\":\"hbejdznxcvdsrhnj\",\"defaultParameterList\":{\"qfzgemjdftul\":\"lvtno\",\"tmczuomejwcwwqi\":\"ltducea\",\"vpkjpr\":\"knssxmojm\"}},\"location\":\"wcfzqljyxgt\",\"tags\":{\"hmkxmaehvbb\":\"eydbsd\"},\"etag\":\"ripltf\",\"id\":\"tbaxk\",\"name\":\"xywr\",\"type\":\"kpyklyhp\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"jyxgtczh\",\"appPackageUrl\":\"ydbsd\",\"defaultParameterList\":{\"aehvbbxuri\":\"kx\"}},\"location\":\"tfnhtbaxkgxywr\",\"tags\":{\"gzibthostgktstv\":\"yklyhpluodpvruud\",\"odqkdlwwqfb\":\"xeclzedqbcvhzlhp\",\"lmbtxhwgfwsrt\":\"mlkxtrqjfs\",\"kh\":\"wcoezbrhub\"},\"etag\":\"ygo\",\"id\":\"kkqfqjbvle\",\"name\":\"rfmluiqtq\",\"type\":\"fa\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.applicationTypeVersions() - .list("ojgcyzt", "fmznba", "qphchqnrnrpxehuw", com.azure.core.util.Context.NONE); + .list("qioknssxmojm", "vpkjpr", "kwcf", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wcfzqljyxgt", response.iterator().next().location()); - Assertions.assertEquals("eydbsd", response.iterator().next().tags().get("hmkxmaehvbb")); - Assertions.assertEquals("hbejdznxcvdsrhnj", response.iterator().next().appPackageUrl()); + Assertions.assertEquals("tfnhtbaxkgxywr", response.iterator().next().location()); + Assertions.assertEquals("yklyhpluodpvruud", response.iterator().next().tags().get("gzibthostgktstv")); + Assertions.assertEquals("ydbsd", response.iterator().next().appPackageUrl()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateWithResponseMockTests.java index 35a1bb065972..96bbd6a4effc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; @@ -23,24 +23,24 @@ public final class ApplicationTypesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"yzirtxdyuxzejn\"},\"location\":\"sewgioilqukr\",\"tags\":{\"rgguf\":\"tqmieox\",\"hhavgrvkffovjz\":\"yaomtb\",\"gjmfxumvfcl\":\"pjbi\"},\"etag\":\"ovwxnbkfezzxsc\",\"id\":\"wzdgirujbzbo\",\"name\":\"vzzbtdcq\",\"type\":\"pniyujviyl\"}"; + = "{\"properties\":{\"provisioningState\":\"zbtd\"},\"location\":\"vp\",\"tags\":{\"n\":\"ujviylwdshfs\",\"rymsgaojfmw\":\"bgye\",\"hirctymoxoftpipi\":\"cotmr\",\"lihhyuspskasdvlm\":\"yczuhxacpq\"},\"etag\":\"dgzxulucvpamrsr\",\"id\":\"zvxurisjnhny\",\"name\":\"xifqjzgxm\",\"type\":\"hu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ApplicationTypeResource response = manager.applicationTypes() - .define("zh") - .withExistingCluster("zronasxift", "zq") - .withRegion("onnxkrlgnyhm") - .withTags(mapOf("thrrgh", "xkk", "gf", "jbdhqxvc")) + .define("x") + .withExistingCluster("rtkfawnopq", "ikyzirtxdy") + .withRegion("gioilqu") + .withTags(mapOf("ggufhyaomtb", "dxtqmieoxo", "pjbi", "hhavgrvkffovjz")) .create(); - Assertions.assertEquals("sewgioilqukr", response.location()); - Assertions.assertEquals("tqmieox", response.tags().get("rgguf")); + Assertions.assertEquals("vp", response.location()); + Assertions.assertEquals("ujviylwdshfs", response.tags().get("n")); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetWithResponseMockTests.java index 0d0b6c926565..fa500eff0d5b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; @@ -21,20 +21,20 @@ public final class ApplicationTypesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"qmt\"},\"location\":\"ltmm\",\"tags\":{\"upkvipmdsc\":\"yeozphvwauyqncy\",\"totxhojujb\":\"xqupevzhf\",\"n\":\"pelmcuvhixbjxyf\"},\"etag\":\"r\",\"id\":\"o\",\"name\":\"sttp\",\"type\":\"iwkkbn\"}"; + = "{\"properties\":{\"provisioningState\":\"lrcoolsttpki\"},\"location\":\"kbnujr\",\"tags\":{\"ithtywu\":\"tylbfpncurdoiw\",\"knfd\":\"xcbihw\",\"ihxumwctondzj\":\"twjchrdg\"},\"etag\":\"udfdlwgg\",\"id\":\"sb\",\"name\":\"tov\",\"type\":\"tgseinqfiufxqkn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ApplicationTypeResource response = manager.applicationTypes() - .getWithResponse("pyouaibrebqaays", "kixqtnqtt", "zlwfffiakp", com.azure.core.util.Context.NONE) + .getWithResponse("dscwxqupevzhf", "totxhojujb", "pelmcuvhixbjxyf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ltmm", response.location()); - Assertions.assertEquals("yeozphvwauyqncy", response.tags().get("upkvipmdsc")); + Assertions.assertEquals("kbnujr", response.location()); + Assertions.assertEquals("tylbfpncurdoiw", response.tags().get("ithtywu")); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListMockTests.java index 683a012430b8..4a76593c1f0f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationTypesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; @@ -22,19 +22,19 @@ public final class ApplicationTypesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"iithtywu\"},\"location\":\"cbihwqk\",\"tags\":{\"dgoihxumwctondzj\":\"ntwjch\",\"fdlwg\":\"uu\",\"gseinq\":\"ytsbwtovv\"},\"etag\":\"ufxqknpirgnepttw\",\"id\":\"sniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"dmqnrojlpij\"},\"location\":\"rxfrddhc\",\"tags\":{\"hftwesgog\":\"izzronasxiftozqy\",\"sxkkg\":\"zhonnxkrlgnyhmo\",\"rghxjb\":\"h\"},\"etag\":\"qxvcxgfrpdsofb\",\"id\":\"rnsvbuswd\",\"name\":\"z\",\"type\":\"ybycnunvj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.applicationTypes().list("jrywvtylbfpnc", "rd", com.azure.core.util.Context.NONE); + = manager.applicationTypes().list("irgne", "ttwqmsni", com.azure.core.util.Context.NONE); - Assertions.assertEquals("cbihwqk", response.iterator().next().location()); - Assertions.assertEquals("ntwjch", response.iterator().next().tags().get("dgoihxumwctondzj")); + Assertions.assertEquals("rxfrddhc", response.iterator().next().location()); + Assertions.assertEquals("izzronasxiftozqy", response.iterator().next().tags().get("hftwesgog")); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUpgradePolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUpgradePolicyTests.java index e2f0da7be693..514ef1e63793 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUpgradePolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUpgradePolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -19,100 +19,100 @@ public final class ApplicationUpgradePolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ApplicationUpgradePolicy model = BinaryData.fromString( - "{\"upgradeReplicaSetCheckTimeout\":\"grcfb\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"hhkxbp\",\"healthCheckStableDuration\":\"ymjhxxjyngudivkr\",\"healthCheckRetryTimeout\":\"wbxqzvszjfau\",\"upgradeTimeout\":\"fdxxivetvtcqaqtd\",\"upgradeDomainTimeout\":\"mcbxvwvxysl\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":263048903,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":693295515,\"maxPercentUnhealthyPartitionsPerService\":527643920,\"maxPercentUnhealthyReplicasPerPartition\":2053949685},\"serviceTypeHealthPolicyMap\":{\"bkrvrnsvshqj\":{\"maxPercentUnhealthyServices\":1336387683,\"maxPercentUnhealthyPartitionsPerService\":1562521656,\"maxPercentUnhealthyReplicasPerPartition\":520113589}}},\"upgradeMode\":\"Invalid\",\"recreateApplication\":true}") + "{\"upgradeReplicaSetCheckTimeout\":\"cgjbirxbp\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"fdtwssotft\",\"healthCheckStableDuration\":\"jzbexilzznfq\",\"healthCheckRetryTimeout\":\"vwpm\",\"upgradeTimeout\":\"aruoujmkcjhwqyt\",\"upgradeDomainTimeout\":\"ybn\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":2026519653,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":948183907,\"maxPercentUnhealthyPartitionsPerService\":1822878262,\"maxPercentUnhealthyReplicasPerPartition\":604177419},\"serviceTypeHealthPolicyMap\":{\"doy\":{\"maxPercentUnhealthyServices\":282586156,\"maxPercentUnhealthyPartitionsPerService\":682074960,\"maxPercentUnhealthyReplicasPerPartition\":1632259296},\"zdnds\":{\"maxPercentUnhealthyServices\":1553722584,\"maxPercentUnhealthyPartitionsPerService\":1126761283,\"maxPercentUnhealthyReplicasPerPartition\":372150678}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false}") .toObject(ApplicationUpgradePolicy.class); - Assertions.assertEquals("grcfb", model.upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("hhkxbp", model.rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("ymjhxxjyngudivkr", model.rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("wbxqzvszjfau", model.rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fdxxivetvtcqaqtd", model.rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("mcbxvwvxysl", model.rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(false, model.applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(263048903, model.applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(693295515, + Assertions.assertEquals("cgjbirxbp", model.upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, + model.rollingUpgradeMonitoringPolicy().failureAction()); + Assertions.assertEquals("fdtwssotft", model.rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); + Assertions.assertEquals("jzbexilzznfq", model.rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); + Assertions.assertEquals("vwpm", model.rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); + Assertions.assertEquals("aruoujmkcjhwqyt", model.rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("ybn", model.rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertTrue(model.applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(2026519653, model.applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); + Assertions.assertEquals(948183907, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(527643920, + Assertions.assertEquals(1822878262, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(2053949685, + Assertions.assertEquals(604177419, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1336387683, + Assertions.assertEquals(282586156, + model.applicationHealthPolicy().serviceTypeHealthPolicyMap().get("doy").maxPercentUnhealthyServices()); + Assertions.assertEquals(682074960, model.applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") - .maxPercentUnhealthyServices()); - Assertions.assertEquals(1562521656, - model.applicationHealthPolicy() - .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") + .get("doy") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(520113589, + Assertions.assertEquals(1632259296, model.applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") + .get("doy") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.upgradeMode()); - Assertions.assertEquals(true, model.recreateApplication()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradeMode()); + Assertions.assertFalse(model.recreateApplication()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationUpgradePolicy model = new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("grcfb") + ApplicationUpgradePolicy model = new ApplicationUpgradePolicy().withUpgradeReplicaSetCheckTimeout("cgjbirxbp") .withForceRestart(true) .withRollingUpgradeMonitoringPolicy( - new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) - .withHealthCheckWaitDuration("hhkxbp") - .withHealthCheckStableDuration("ymjhxxjyngudivkr") - .withHealthCheckRetryTimeout("wbxqzvszjfau") - .withUpgradeTimeout("fdxxivetvtcqaqtd") - .withUpgradeDomainTimeout("mcbxvwvxysl")) - .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(false) - .withMaxPercentUnhealthyDeployedApplications(263048903) + new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.ROLLBACK) + .withHealthCheckWaitDuration("fdtwssotft") + .withHealthCheckStableDuration("jzbexilzznfq") + .withHealthCheckRetryTimeout("vwpm") + .withUpgradeTimeout("aruoujmkcjhwqyt") + .withUpgradeDomainTimeout("ybn")) + .withApplicationHealthPolicy(new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) + .withMaxPercentUnhealthyDeployedApplications(2026519653) .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(693295515) - .withMaxPercentUnhealthyPartitionsPerService(527643920) - .withMaxPercentUnhealthyReplicasPerPartition(2053949685)) - .withServiceTypeHealthPolicyMap(mapOf("bkrvrnsvshqj", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1336387683) - .withMaxPercentUnhealthyPartitionsPerService(1562521656) - .withMaxPercentUnhealthyReplicasPerPartition(520113589)))) - .withUpgradeMode(RollingUpgradeMode.INVALID) - .withRecreateApplication(true); + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(948183907) + .withMaxPercentUnhealthyPartitionsPerService(1822878262) + .withMaxPercentUnhealthyReplicasPerPartition(604177419)) + .withServiceTypeHealthPolicyMap(mapOf("doy", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(282586156) + .withMaxPercentUnhealthyPartitionsPerService(682074960) + .withMaxPercentUnhealthyReplicasPerPartition(1632259296), + "zdnds", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1553722584) + .withMaxPercentUnhealthyPartitionsPerService(1126761283) + .withMaxPercentUnhealthyReplicasPerPartition(372150678)))) + .withUpgradeMode(RollingUpgradeMode.UNMONITORED_AUTO) + .withRecreateApplication(false); model = BinaryData.fromObject(model).toObject(ApplicationUpgradePolicy.class); - Assertions.assertEquals("grcfb", model.upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, model.forceRestart()); - Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("hhkxbp", model.rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("ymjhxxjyngudivkr", model.rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("wbxqzvszjfau", model.rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("fdxxivetvtcqaqtd", model.rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("mcbxvwvxysl", model.rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(false, model.applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(263048903, model.applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(693295515, + Assertions.assertEquals("cgjbirxbp", model.upgradeReplicaSetCheckTimeout()); + Assertions.assertTrue(model.forceRestart()); + Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, + model.rollingUpgradeMonitoringPolicy().failureAction()); + Assertions.assertEquals("fdtwssotft", model.rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); + Assertions.assertEquals("jzbexilzznfq", model.rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); + Assertions.assertEquals("vwpm", model.rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); + Assertions.assertEquals("aruoujmkcjhwqyt", model.rollingUpgradeMonitoringPolicy().upgradeTimeout()); + Assertions.assertEquals("ybn", model.rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); + Assertions.assertTrue(model.applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(2026519653, model.applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); + Assertions.assertEquals(948183907, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(527643920, + Assertions.assertEquals(1822878262, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(2053949685, + Assertions.assertEquals(604177419, model.applicationHealthPolicy().defaultServiceTypeHealthPolicy().maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1336387683, - model.applicationHealthPolicy() - .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") - .maxPercentUnhealthyServices()); - Assertions.assertEquals(1562521656, + Assertions.assertEquals(282586156, + model.applicationHealthPolicy().serviceTypeHealthPolicyMap().get("doy").maxPercentUnhealthyServices()); + Assertions.assertEquals(682074960, model.applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") + .get("doy") .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(520113589, + Assertions.assertEquals(1632259296, model.applicationHealthPolicy() .serviceTypeHealthPolicyMap() - .get("bkrvrnsvshqj") + .get("doy") .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.INVALID, model.upgradeMode()); - Assertions.assertEquals(true, model.recreateApplication()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, model.upgradeMode()); + Assertions.assertFalse(model.recreateApplication()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUserAssignedIdentityTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUserAssignedIdentityTests.java index 4f58d08409e6..bab3e8e21c4c 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUserAssignedIdentityTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationUserAssignedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,19 +11,18 @@ public final class ApplicationUserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationUserAssignedIdentity model - = BinaryData.fromString("{\"name\":\"kthumaqolbgycdui\",\"principalId\":\"r\"}") - .toObject(ApplicationUserAssignedIdentity.class); - Assertions.assertEquals("kthumaqolbgycdui", model.name()); - Assertions.assertEquals("r", model.principalId()); + ApplicationUserAssignedIdentity model = BinaryData.fromString("{\"name\":\"rsc\",\"principalId\":\"ntnev\"}") + .toObject(ApplicationUserAssignedIdentity.class); + Assertions.assertEquals("rsc", model.name()); + Assertions.assertEquals("ntnev", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ApplicationUserAssignedIdentity model - = new ApplicationUserAssignedIdentity().withName("kthumaqolbgycdui").withPrincipalId("r"); + = new ApplicationUserAssignedIdentity().withName("rsc").withPrincipalId("ntnev"); model = BinaryData.fromObject(model).toObject(ApplicationUserAssignedIdentity.class); - Assertions.assertEquals("kthumaqolbgycdui", model.name()); - Assertions.assertEquals("r", model.principalId()); + Assertions.assertEquals("rsc", model.name()); + Assertions.assertEquals("ntnev", model.principalId()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetWithResponseMockTests.java index 7f1d37e67635..a3749150fd7f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationResource; @@ -24,67 +24,67 @@ public final class ApplicationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"identity\":{\"principalId\":\"tgk\",\"tenantId\":\"tvdxeclzedqb\",\"type\":\"None\",\"userAssignedIdentities\":{\"fsmlmbtxhwgfw\":{\"principalId\":\"plodqkdlwwqfbu\",\"clientId\":\"kxtrq\"}}},\"properties\":{\"provisioningState\":\"a\",\"typeName\":\"oezbrhubsk\",\"typeVersion\":\"dyg\",\"parameters\":{\"rfmluiqtq\":\"kkqfqjbvle\",\"yvnqqybaryeuay\":\"fa\",\"bqgzslesjcbhern\":\"kq\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"ewdjcvbquwrb\",\"forceRestart\":true,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"buffkmrqemvvhm\",\"healthCheckStableDuration\":\"drjf\",\"healthCheckRetryTimeout\":\"acoebj\",\"upgradeTimeout\":\"wzcjznmwcpmgua\",\"upgradeDomainTimeout\":\"raufactkahzova\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":347971797,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":113664127,\"maxPercentUnhealthyPartitionsPerService\":1959547059,\"maxPercentUnhealthyReplicasPerPartition\":196518772},\"serviceTypeHealthPolicyMap\":{\"lfg\":{},\"lqubkwdlen\":{}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":true},\"minimumNodes\":5032851596424421907,\"maximumNodes\":3773912633867560647,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"inyflnorwmduvwp\",\"maximumCapacity\":7997351295761854478,\"reservationCapacity\":2959519988127241657,\"totalApplicationCapacity\":8236469646650196378},{\"name\":\"gpqch\",\"maximumCapacity\":4486802272843555243,\"reservationCapacity\":3778167690103643206,\"totalApplicationCapacity\":6219904994785247374},{\"name\":\"xgibbda\",\"maximumCapacity\":3690608915062764768,\"reservationCapacity\":5258496855323298629,\"totalApplicationCapacity\":4529300263395127628},{\"name\":\"sukokwbqplhl\",\"maximumCapacity\":8356054412580573793,\"reservationCapacity\":7056990023571937899,\"totalApplicationCapacity\":864057560368064195}],\"managedIdentities\":[{\"name\":\"zsoldwey\",\"principalId\":\"qdunvmnnrwrbior\"},{\"name\":\"talywjhhgdnhxms\",\"principalId\":\"v\"},{\"name\":\"omi\",\"principalId\":\"ox\"},{\"name\":\"gdufiqnd\",\"principalId\":\"euzaof\"}]},\"location\":\"hvcyyysfg\",\"tags\":{\"qonmacj\":\"cubiipuipw\",\"izsh\":\"k\",\"gmblrri\":\"vcimpev\",\"rwfscjfnynszquj\":\"bywdxsmicc\"},\"etag\":\"dvoqyt\",\"id\":\"yo\",\"name\":\"bblgyavut\",\"type\":\"thjoxoism\"}"; + = "{\"properties\":{\"provisioningState\":\"ewdjcvbquwrb\",\"typeName\":\"wagohbuffk\",\"typeVersion\":\"qem\",\"parameters\":{\"jfutacoebj\":\"mxtd\",\"guaadraufactkahz\":\"ewzcjznmwcp\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"jjziuxxpsh\",\"forceRestart\":false,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Rollback\",\"healthCheckWaitDuration\":\"gs\",\"healthCheckStableDuration\":\"ubkwdle\",\"healthCheckRetryTimeout\":\"d\",\"upgradeTimeout\":\"tujbazpju\",\"upgradeDomainTimeout\":\"minyflnorwm\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":1908961214,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":937766926,\"maxPercentUnhealthyPartitionsPerService\":689066944,\"maxPercentUnhealthyReplicasPerPartition\":1194335789},\"serviceTypeHealthPolicyMap\":{\"pgpqchiszepnnb\":{},\"crxgibb\":{}}},\"upgradeMode\":\"UnmonitoredManual\",\"recreateApplication\":false},\"minimumNodes\":1959601964865679111,\"maximumNodes\":2303455502372916888,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"okwbqplh\",\"maximumCapacity\":928202540530969399,\"reservationCapacity\":4258159930427537161,\"totalApplicationCapacity\":2781081428480081862},{\"name\":\"hw\",\"maximumCapacity\":1586614318517999656,\"reservationCapacity\":3005842301651128236,\"totalApplicationCapacity\":6472514649626093953},{\"name\":\"unvmnnr\",\"maximumCapacity\":8647949215017672842,\"reservationCapacity\":2202819048814856030,\"totalApplicationCapacity\":1294897435349030649},{\"name\":\"wjhhgdnhxmsivf\",\"maximumCapacity\":2582739038119922413,\"reservationCapacity\":7403868879501124563,\"totalApplicationCapacity\":5098855864202607843}],\"managedIdentities\":[{\"name\":\"q\",\"principalId\":\"dieuzaofj\"},{\"name\":\"hvcyyysfg\",\"principalId\":\"otcubi\"},{\"name\":\"p\",\"principalId\":\"ipwoqonmacjek\"}]},\"identity\":{\"principalId\":\"shqvcimpev\",\"tenantId\":\"mblrrilbywd\",\"type\":\"None\",\"userAssignedIdentities\":{\"voqyt\":{\"principalId\":\"wrwfscjfnyns\",\"clientId\":\"ujiz\"}}},\"location\":\"yo\",\"tags\":{\"vutpthjoxo\":\"lgy\",\"pi\":\"smsks\",\"xkcgxxlxsffgcvi\":\"lqol\"},\"etag\":\"zdwlvwlyoupfgfb\",\"id\":\"ubdyhgk\",\"name\":\"minsgowzf\",\"type\":\"tsttktlahbq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ApplicationResource response = manager.applications() - .getWithResponse("uodpv", "uudl", "zibt", com.azure.core.util.Context.NONE) + .getWithResponse("yvnqqybaryeuay", "kq", "bqgzslesjcbhern", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(ManagedIdentityType.NONE, response.identity().type()); - Assertions.assertEquals("hvcyyysfg", response.location()); - Assertions.assertEquals("cubiipuipw", response.tags().get("qonmacj")); - Assertions.assertEquals("oezbrhubsk", response.typeName()); - Assertions.assertEquals("dyg", response.typeVersion()); - Assertions.assertEquals("kkqfqjbvle", response.parameters().get("rfmluiqtq")); - Assertions.assertEquals("ewdjcvbquwrb", response.upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(true, response.upgradePolicy().forceRestart()); + Assertions.assertEquals("yo", response.location()); + Assertions.assertEquals("lgy", response.tags().get("vutpthjoxo")); + Assertions.assertEquals("wagohbuffk", response.typeName()); + Assertions.assertEquals("qem", response.typeVersion()); + Assertions.assertEquals("mxtd", response.parameters().get("jfutacoebj")); + Assertions.assertEquals("jjziuxxpsh", response.upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertFalse(response.upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.ROLLBACK, response.upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("buffkmrqemvvhm", + Assertions.assertEquals("gs", response.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("drjf", + Assertions.assertEquals("ubkwdle", response.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("acoebj", + Assertions.assertEquals("d", response.upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("wzcjznmwcpmgua", + Assertions.assertEquals("tujbazpju", response.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("raufactkahzova", + Assertions.assertEquals("minyflnorwm", response.upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(true, response.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(347971797, + Assertions.assertFalse(response.upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(1908961214, response.upgradePolicy().applicationHealthPolicy().maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(113664127, + Assertions.assertEquals(937766926, response.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1959547059, + Assertions.assertEquals(689066944, response.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(196518772, + Assertions.assertEquals(1194335789, response.upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, response.upgradePolicy().upgradeMode()); - Assertions.assertEquals(true, response.upgradePolicy().recreateApplication()); - Assertions.assertEquals(5032851596424421907L, response.minimumNodes()); - Assertions.assertEquals(3773912633867560647L, response.maximumNodes()); - Assertions.assertEquals(false, response.removeApplicationCapacity()); - Assertions.assertEquals("inyflnorwmduvwp", response.metrics().get(0).name()); - Assertions.assertEquals(7997351295761854478L, response.metrics().get(0).maximumCapacity()); - Assertions.assertEquals(2959519988127241657L, response.metrics().get(0).reservationCapacity()); - Assertions.assertEquals(8236469646650196378L, response.metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("zsoldwey", response.managedIdentities().get(0).name()); - Assertions.assertEquals("qdunvmnnrwrbior", response.managedIdentities().get(0).principalId()); + Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_MANUAL, response.upgradePolicy().upgradeMode()); + Assertions.assertFalse(response.upgradePolicy().recreateApplication()); + Assertions.assertEquals(1959601964865679111L, response.minimumNodes()); + Assertions.assertEquals(2303455502372916888L, response.maximumNodes()); + Assertions.assertTrue(response.removeApplicationCapacity()); + Assertions.assertEquals("okwbqplh", response.metrics().get(0).name()); + Assertions.assertEquals(928202540530969399L, response.metrics().get(0).maximumCapacity()); + Assertions.assertEquals(4258159930427537161L, response.metrics().get(0).reservationCapacity()); + Assertions.assertEquals(2781081428480081862L, response.metrics().get(0).totalApplicationCapacity()); + Assertions.assertEquals("q", response.managedIdentities().get(0).name()); + Assertions.assertEquals("dieuzaofj", response.managedIdentities().get(0).principalId()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListMockTests.java index f02af804e07f..0e9878e48183 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ApplicationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ApplicationResource; @@ -25,82 +25,79 @@ public final class ApplicationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"cvizqzdwlvw\",\"tenantId\":\"oupfgfb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ahbqactxtgzuk\":{\"principalId\":\"hgkfmin\",\"clientId\":\"owzfttsttkt\"},\"azivjlfrqttbajl\":{\"principalId\":\"tmmqtgqqqxhrn\",\"clientId\":\"xcpjuisavokqdzf\"},\"igovi\":{\"principalId\":\"tnwxy\",\"clientId\":\"pidkqqfkuvscxkdm\"}}},\"properties\":{\"provisioningState\":\"kpmloa\",\"typeName\":\"ruocbgo\",\"typeVersion\":\"bteoybf\",\"parameters\":{\"mywwtkgkxnyed\":\"akvvjgslordi\",\"yvudtjuewbci\":\"b\",\"xccybvpa\":\"xuuwhcj\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"kudzpxgwj\",\"forceRestart\":false,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"cyohpfkyrkdbd\",\"healthCheckStableDuration\":\"ogsjkmnwqjno\",\"healthCheckRetryTimeout\":\"iyhddvi\",\"upgradeTimeout\":\"egfnmntfpmvmemfn\",\"upgradeDomainTimeout\":\"dwvvba\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":677641870,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":984375294,\"maxPercentUnhealthyPartitionsPerService\":1628077523,\"maxPercentUnhealthyReplicasPerPartition\":482170286},\"serviceTypeHealthPolicyMap\":{\"rdnhfuku\":{}}},\"upgradeMode\":\"UnmonitoredAuto\",\"recreateApplication\":false},\"minimumNodes\":5191466923245315601,\"maximumNodes\":4557398891396675269,\"removeApplicationCapacity\":true,\"metrics\":[{\"name\":\"pfcvlerchpqbmfp\",\"maximumCapacity\":6598038620342743533,\"reservationCapacity\":8640705401011653724,\"totalApplicationCapacity\":5480146714072551724},{\"name\":\"spuunnoxyhkxgq\",\"maximumCapacity\":8879508928062968266,\"reservationCapacity\":5499837573865267014,\"totalApplicationCapacity\":5674487456112843436}],\"managedIdentities\":[{\"name\":\"a\",\"principalId\":\"wdaomdjvlpjxxkzb\"},{\"name\":\"msgeivsiykzk\",\"principalId\":\"ncj\"},{\"name\":\"xonbzoggculapz\",\"principalId\":\"y\"}]},\"location\":\"gogtqxepnylbf\",\"tags\":{\"vofqzhvfc\":\"lyjt\",\"jpvd\":\"byfmowuxr\",\"vwzjbhyz\":\"xfzwi\"},\"etag\":\"jrkambtrnegvmnv\",\"id\":\"eqvldspast\",\"name\":\"bkkd\",\"type\":\"flvestmjlxrrilo\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"xcpjuisavokqdzf\",\"typeName\":\"zivj\",\"typeVersion\":\"rqttbajlkatnw\",\"parameters\":{\"cxkdmligovi\":\"opidkqqfkuv\",\"goorbteo\":\"rxkpmloazuruoc\"},\"upgradePolicy\":{\"upgradeReplicaSetCheckTimeout\":\"hjxa\",\"forceRestart\":false,\"rollingUpgradeMonitoringPolicy\":{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"ordilmywwtkgkxny\",\"healthCheckStableDuration\":\"abgyvudt\",\"healthCheckRetryTimeout\":\"ewbcihxuuw\",\"upgradeTimeout\":\"j\",\"upgradeDomainTimeout\":\"ccybvp\"},\"applicationHealthPolicy\":{\"considerWarningAsError\":false,\"maxPercentUnhealthyDeployedApplications\":2047588500,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":417091375,\"maxPercentUnhealthyPartitionsPerService\":2015749730,\"maxPercentUnhealthyReplicasPerPartition\":431593989},\"serviceTypeHealthPolicyMap\":{\"mag\":{}}},\"upgradeMode\":\"Monitored\",\"recreateApplication\":true},\"minimumNodes\":7553431900772779958,\"maximumNodes\":7306067338315697757,\"removeApplicationCapacity\":false,\"metrics\":[{\"name\":\"iogsjkmnwq\",\"maximumCapacity\":6833853370140143589,\"reservationCapacity\":7156428016747730929,\"totalApplicationCapacity\":8649178950235367695}],\"managedIdentities\":[{\"name\":\"acegfnmntf\",\"principalId\":\"mvmemfnczd\"},{\"name\":\"vvbalx\",\"principalId\":\"l\"},{\"name\":\"chp\",\"principalId\":\"db\"}]},\"identity\":{\"principalId\":\"wrd\",\"tenantId\":\"fukuvsjcswsmystu\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"xgqddrih\":{\"principalId\":\"cvlerchpqbmfpjba\",\"clientId\":\"idfcxsspuunnoxyh\"},\"msgeivsiykzk\":{\"principalId\":\"hoqca\",\"clientId\":\"wdaomdjvlpjxxkzb\"},\"gculap\":{\"principalId\":\"cjdx\",\"clientId\":\"bzo\"},\"ajlyjtlvofqzhv\":{\"principalId\":\"y\",\"clientId\":\"gogtqxepnylbf\"}}},\"location\":\"ibyfmo\",\"tags\":{\"wzjbh\":\"rkjpvdwxfzwii\",\"mnvuqe\":\"zsxjrkambtrneg\"},\"etag\":\"lds\",\"id\":\"stjbkkdmfl\",\"name\":\"est\",\"type\":\"jlxr\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.applications().list("ksbpimlqoljx", "cgxxlxs", com.azure.core.util.Context.NONE); + = manager.applications().list("ctxtgzukxi", "mmqtgqqqxhr", com.azure.core.util.Context.NONE); Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("gogtqxepnylbf", response.iterator().next().location()); - Assertions.assertEquals("lyjt", response.iterator().next().tags().get("vofqzhvfc")); - Assertions.assertEquals("ruocbgo", response.iterator().next().typeName()); - Assertions.assertEquals("bteoybf", response.iterator().next().typeVersion()); - Assertions.assertEquals("akvvjgslordi", response.iterator().next().parameters().get("mywwtkgkxnyed")); - Assertions.assertEquals("kudzpxgwj", - response.iterator().next().upgradePolicy().upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals(false, response.iterator().next().upgradePolicy().forceRestart()); + Assertions.assertEquals("ibyfmo", response.iterator().next().location()); + Assertions.assertEquals("rkjpvdwxfzwii", response.iterator().next().tags().get("wzjbh")); + Assertions.assertEquals("zivj", response.iterator().next().typeName()); + Assertions.assertEquals("rqttbajlkatnw", response.iterator().next().typeVersion()); + Assertions.assertEquals("opidkqqfkuv", response.iterator().next().parameters().get("cxkdmligovi")); + Assertions.assertEquals("hjxa", response.iterator().next().upgradePolicy().upgradeReplicaSetCheckTimeout()); + Assertions.assertFalse(response.iterator().next().upgradePolicy().forceRestart()); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().failureAction()); - Assertions.assertEquals("cyohpfkyrkdbd", + Assertions.assertEquals("ordilmywwtkgkxny", response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckWaitDuration()); - Assertions.assertEquals("ogsjkmnwqjno", + Assertions.assertEquals("abgyvudt", response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckStableDuration()); - Assertions.assertEquals("iyhddvi", + Assertions.assertEquals("ewbcihxuuw", response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().healthCheckRetryTimeout()); - Assertions.assertEquals("egfnmntfpmvmemfn", + Assertions.assertEquals("j", response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeTimeout()); - Assertions.assertEquals("dwvvba", + Assertions.assertEquals("ccybvp", response.iterator().next().upgradePolicy().rollingUpgradeMonitoringPolicy().upgradeDomainTimeout()); - Assertions.assertEquals(false, - response.iterator().next().upgradePolicy().applicationHealthPolicy().considerWarningAsError()); - Assertions.assertEquals(677641870, + Assertions + .assertFalse(response.iterator().next().upgradePolicy().applicationHealthPolicy().considerWarningAsError()); + Assertions.assertEquals(2047588500, response.iterator() .next() .upgradePolicy() .applicationHealthPolicy() .maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(984375294, + Assertions.assertEquals(417091375, response.iterator() .next() .upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(1628077523, + Assertions.assertEquals(2015749730, response.iterator() .next() .upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(482170286, + Assertions.assertEquals(431593989, response.iterator() .next() .upgradePolicy() .applicationHealthPolicy() .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(RollingUpgradeMode.UNMONITORED_AUTO, - response.iterator().next().upgradePolicy().upgradeMode()); - Assertions.assertEquals(false, response.iterator().next().upgradePolicy().recreateApplication()); - Assertions.assertEquals(5191466923245315601L, response.iterator().next().minimumNodes()); - Assertions.assertEquals(4557398891396675269L, response.iterator().next().maximumNodes()); - Assertions.assertEquals(true, response.iterator().next().removeApplicationCapacity()); - Assertions.assertEquals("pfcvlerchpqbmfp", response.iterator().next().metrics().get(0).name()); - Assertions.assertEquals(6598038620342743533L, response.iterator().next().metrics().get(0).maximumCapacity()); - Assertions.assertEquals(8640705401011653724L, + Assertions.assertEquals(RollingUpgradeMode.MONITORED, response.iterator().next().upgradePolicy().upgradeMode()); + Assertions.assertTrue(response.iterator().next().upgradePolicy().recreateApplication()); + Assertions.assertEquals(7553431900772779958L, response.iterator().next().minimumNodes()); + Assertions.assertEquals(7306067338315697757L, response.iterator().next().maximumNodes()); + Assertions.assertFalse(response.iterator().next().removeApplicationCapacity()); + Assertions.assertEquals("iogsjkmnwq", response.iterator().next().metrics().get(0).name()); + Assertions.assertEquals(6833853370140143589L, response.iterator().next().metrics().get(0).maximumCapacity()); + Assertions.assertEquals(7156428016747730929L, response.iterator().next().metrics().get(0).reservationCapacity()); - Assertions.assertEquals(5480146714072551724L, + Assertions.assertEquals(8649178950235367695L, response.iterator().next().metrics().get(0).totalApplicationCapacity()); - Assertions.assertEquals("a", response.iterator().next().managedIdentities().get(0).name()); - Assertions.assertEquals("wdaomdjvlpjxxkzb", - response.iterator().next().managedIdentities().get(0).principalId()); + Assertions.assertEquals("acegfnmntf", response.iterator().next().managedIdentities().get(0).name()); + Assertions.assertEquals("mvmemfnczd", response.iterator().next().managedIdentities().get(0).principalId()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmApplicationHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmApplicationHealthPolicyTests.java index ecbe2f0b424d..20b8f8f38624 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmApplicationHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmApplicationHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -15,61 +15,57 @@ public final class ArmApplicationHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmApplicationHealthPolicy model = BinaryData.fromString( - "{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":1553831435,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1616367631,\"maxPercentUnhealthyPartitionsPerService\":1933405011,\"maxPercentUnhealthyReplicasPerPartition\":1057432086},\"serviceTypeHealthPolicyMap\":{\"vwpm\":{\"maxPercentUnhealthyServices\":1948356330,\"maxPercentUnhealthyPartitionsPerService\":2126872967,\"maxPercentUnhealthyReplicasPerPartition\":1133541665},\"jmkcjhwqytj\":{\"maxPercentUnhealthyServices\":1787439694,\"maxPercentUnhealthyPartitionsPerService\":930552751,\"maxPercentUnhealthyReplicasPerPartition\":477944589},\"wgdrjervnaenqp\":{\"maxPercentUnhealthyServices\":778428037,\"maxPercentUnhealthyPartitionsPerService\":385457826,\"maxPercentUnhealthyReplicasPerPartition\":524895743},\"gmifthnzd\":{\"maxPercentUnhealthyServices\":1479768723,\"maxPercentUnhealthyPartitionsPerService\":681452902,\"maxPercentUnhealthyReplicasPerPartition\":895776000}}}") + "{\"considerWarningAsError\":true,\"maxPercentUnhealthyDeployedApplications\":1979529158,\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":219002993,\"maxPercentUnhealthyPartitionsPerService\":1148330667,\"maxPercentUnhealthyReplicasPerPartition\":532112858},\"serviceTypeHealthPolicyMap\":{\"mcwyhzdxssadb\":{\"maxPercentUnhealthyServices\":1340500207,\"maxPercentUnhealthyPartitionsPerService\":870818177,\"maxPercentUnhealthyReplicasPerPartition\":220182660},\"n\":{\"maxPercentUnhealthyServices\":122725512,\"maxPercentUnhealthyPartitionsPerService\":487755858,\"maxPercentUnhealthyReplicasPerPartition\":1045217690},\"zbn\":{\"maxPercentUnhealthyServices\":451636387,\"maxPercentUnhealthyPartitionsPerService\":1568683744,\"maxPercentUnhealthyReplicasPerPartition\":540761199}}}") .toObject(ArmApplicationHealthPolicy.class); - Assertions.assertEquals(true, model.considerWarningAsError()); - Assertions.assertEquals(1553831435, model.maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1616367631, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(1933405011, + Assertions.assertTrue(model.considerWarningAsError()); + Assertions.assertEquals(1979529158, model.maxPercentUnhealthyDeployedApplications()); + Assertions.assertEquals(219002993, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); + Assertions.assertEquals(1148330667, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1057432086, + Assertions.assertEquals(532112858, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1948356330, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyServices()); - Assertions.assertEquals(2126872967, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1133541665, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyReplicasPerPartition()); + Assertions.assertEquals(1340500207, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyServices()); + Assertions.assertEquals(870818177, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyPartitionsPerService()); + Assertions.assertEquals(220182660, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyReplicasPerPartition()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ArmApplicationHealthPolicy model = new ArmApplicationHealthPolicy().withConsiderWarningAsError(true) - .withMaxPercentUnhealthyDeployedApplications(1553831435) + .withMaxPercentUnhealthyDeployedApplications(1979529158) .withDefaultServiceTypeHealthPolicy( - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1616367631) - .withMaxPercentUnhealthyPartitionsPerService(1933405011) - .withMaxPercentUnhealthyReplicasPerPartition(1057432086)) - .withServiceTypeHealthPolicyMap(mapOf("vwpm", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1948356330) - .withMaxPercentUnhealthyPartitionsPerService(2126872967) - .withMaxPercentUnhealthyReplicasPerPartition(1133541665), - "jmkcjhwqytj", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1787439694) - .withMaxPercentUnhealthyPartitionsPerService(930552751) - .withMaxPercentUnhealthyReplicasPerPartition(477944589), - "wgdrjervnaenqp", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(778428037) - .withMaxPercentUnhealthyPartitionsPerService(385457826) - .withMaxPercentUnhealthyReplicasPerPartition(524895743), - "gmifthnzd", - new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1479768723) - .withMaxPercentUnhealthyPartitionsPerService(681452902) - .withMaxPercentUnhealthyReplicasPerPartition(895776000))); + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(219002993) + .withMaxPercentUnhealthyPartitionsPerService(1148330667) + .withMaxPercentUnhealthyReplicasPerPartition(532112858)) + .withServiceTypeHealthPolicyMap(mapOf("mcwyhzdxssadb", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1340500207) + .withMaxPercentUnhealthyPartitionsPerService(870818177) + .withMaxPercentUnhealthyReplicasPerPartition(220182660), + "n", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(122725512) + .withMaxPercentUnhealthyPartitionsPerService(487755858) + .withMaxPercentUnhealthyReplicasPerPartition(1045217690), + "zbn", + new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(451636387) + .withMaxPercentUnhealthyPartitionsPerService(1568683744) + .withMaxPercentUnhealthyReplicasPerPartition(540761199))); model = BinaryData.fromObject(model).toObject(ArmApplicationHealthPolicy.class); - Assertions.assertEquals(true, model.considerWarningAsError()); - Assertions.assertEquals(1553831435, model.maxPercentUnhealthyDeployedApplications()); - Assertions.assertEquals(1616367631, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); - Assertions.assertEquals(1933405011, + Assertions.assertTrue(model.considerWarningAsError()); + Assertions.assertEquals(1979529158, model.maxPercentUnhealthyDeployedApplications()); + Assertions.assertEquals(219002993, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyServices()); + Assertions.assertEquals(1148330667, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1057432086, + Assertions.assertEquals(532112858, model.defaultServiceTypeHealthPolicy().maxPercentUnhealthyReplicasPerPartition()); - Assertions.assertEquals(1948356330, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyServices()); - Assertions.assertEquals(2126872967, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(1133541665, - model.serviceTypeHealthPolicyMap().get("vwpm").maxPercentUnhealthyReplicasPerPartition()); + Assertions.assertEquals(1340500207, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyServices()); + Assertions.assertEquals(870818177, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyPartitionsPerService()); + Assertions.assertEquals(220182660, + model.serviceTypeHealthPolicyMap().get("mcwyhzdxssadb").maxPercentUnhealthyReplicasPerPartition()); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmRollingUpgradeMonitoringPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmRollingUpgradeMonitoringPolicyTests.java index 0781078607d6..f64d5401312b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmRollingUpgradeMonitoringPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmRollingUpgradeMonitoringPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,31 +13,31 @@ public final class ArmRollingUpgradeMonitoringPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmRollingUpgradeMonitoringPolicy model = BinaryData.fromString( - "{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"ovasrruvwbhsqfsu\",\"healthCheckStableDuration\":\"gjb\",\"healthCheckRetryTimeout\":\"xb\",\"upgradeTimeout\":\"bsrfbj\",\"upgradeDomainTimeout\":\"twss\"}") + "{\"failureAction\":\"Manual\",\"healthCheckWaitDuration\":\"ynduha\",\"healthCheckStableDuration\":\"qlkth\",\"healthCheckRetryTimeout\":\"aqolbgycduiertg\",\"upgradeTimeout\":\"y\",\"upgradeDomainTimeout\":\"aolps\"}") .toObject(ArmRollingUpgradeMonitoringPolicy.class); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.failureAction()); - Assertions.assertEquals("ovasrruvwbhsqfsu", model.healthCheckWaitDuration()); - Assertions.assertEquals("gjb", model.healthCheckStableDuration()); - Assertions.assertEquals("xb", model.healthCheckRetryTimeout()); - Assertions.assertEquals("bsrfbj", model.upgradeTimeout()); - Assertions.assertEquals("twss", model.upgradeDomainTimeout()); + Assertions.assertEquals("ynduha", model.healthCheckWaitDuration()); + Assertions.assertEquals("qlkth", model.healthCheckStableDuration()); + Assertions.assertEquals("aqolbgycduiertg", model.healthCheckRetryTimeout()); + Assertions.assertEquals("y", model.upgradeTimeout()); + Assertions.assertEquals("aolps", model.upgradeDomainTimeout()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ArmRollingUpgradeMonitoringPolicy model = new ArmRollingUpgradeMonitoringPolicy().withFailureAction(ArmUpgradeFailureAction.MANUAL) - .withHealthCheckWaitDuration("ovasrruvwbhsqfsu") - .withHealthCheckStableDuration("gjb") - .withHealthCheckRetryTimeout("xb") - .withUpgradeTimeout("bsrfbj") - .withUpgradeDomainTimeout("twss"); + .withHealthCheckWaitDuration("ynduha") + .withHealthCheckStableDuration("qlkth") + .withHealthCheckRetryTimeout("aqolbgycduiertg") + .withUpgradeTimeout("y") + .withUpgradeDomainTimeout("aolps"); model = BinaryData.fromObject(model).toObject(ArmRollingUpgradeMonitoringPolicy.class); Assertions.assertEquals(ArmUpgradeFailureAction.MANUAL, model.failureAction()); - Assertions.assertEquals("ovasrruvwbhsqfsu", model.healthCheckWaitDuration()); - Assertions.assertEquals("gjb", model.healthCheckStableDuration()); - Assertions.assertEquals("xb", model.healthCheckRetryTimeout()); - Assertions.assertEquals("bsrfbj", model.upgradeTimeout()); - Assertions.assertEquals("twss", model.upgradeDomainTimeout()); + Assertions.assertEquals("ynduha", model.healthCheckWaitDuration()); + Assertions.assertEquals("qlkth", model.healthCheckStableDuration()); + Assertions.assertEquals("aqolbgycduiertg", model.healthCheckRetryTimeout()); + Assertions.assertEquals("y", model.upgradeTimeout()); + Assertions.assertEquals("aolps", model.upgradeDomainTimeout()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmServiceTypeHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmServiceTypeHealthPolicyTests.java index 482997784ca8..ab07f7632578 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmServiceTypeHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ArmServiceTypeHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,21 +12,21 @@ public final class ArmServiceTypeHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmServiceTypeHealthPolicy model = BinaryData.fromString( - "{\"maxPercentUnhealthyServices\":294736838,\"maxPercentUnhealthyPartitionsPerService\":962281735,\"maxPercentUnhealthyReplicasPerPartition\":843221186}") + "{\"maxPercentUnhealthyServices\":2109510262,\"maxPercentUnhealthyPartitionsPerService\":1470162172,\"maxPercentUnhealthyReplicasPerPartition\":1117825443}") .toObject(ArmServiceTypeHealthPolicy.class); - Assertions.assertEquals(294736838, model.maxPercentUnhealthyServices()); - Assertions.assertEquals(962281735, model.maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(843221186, model.maxPercentUnhealthyReplicasPerPartition()); + Assertions.assertEquals(2109510262, model.maxPercentUnhealthyServices()); + Assertions.assertEquals(1470162172, model.maxPercentUnhealthyPartitionsPerService()); + Assertions.assertEquals(1117825443, model.maxPercentUnhealthyReplicasPerPartition()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ArmServiceTypeHealthPolicy model = new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(294736838) - .withMaxPercentUnhealthyPartitionsPerService(962281735) - .withMaxPercentUnhealthyReplicasPerPartition(843221186); + ArmServiceTypeHealthPolicy model = new ArmServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2109510262) + .withMaxPercentUnhealthyPartitionsPerService(1470162172) + .withMaxPercentUnhealthyReplicasPerPartition(1117825443); model = BinaryData.fromObject(model).toObject(ArmServiceTypeHealthPolicy.class); - Assertions.assertEquals(294736838, model.maxPercentUnhealthyServices()); - Assertions.assertEquals(962281735, model.maxPercentUnhealthyPartitionsPerService()); - Assertions.assertEquals(843221186, model.maxPercentUnhealthyReplicasPerPartition()); + Assertions.assertEquals(2109510262, model.maxPercentUnhealthyServices()); + Assertions.assertEquals(1470162172, model.maxPercentUnhealthyPartitionsPerService()); + Assertions.assertEquals(1117825443, model.maxPercentUnhealthyReplicasPerPartition()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AvailableOperationDisplayTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AvailableOperationDisplayTests.java index c9d007d94be4..8ec1d4fd084b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AvailableOperationDisplayTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AvailableOperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,24 +12,11 @@ public final class AvailableOperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AvailableOperationDisplay model = BinaryData - .fromString("{\"provider\":\"og\",\"resource\":\"e\",\"operation\":\"a\",\"description\":\"uhrzayvvt\"}") + .fromString("{\"provider\":\"bj\",\"resource\":\"a\",\"operation\":\"th\",\"description\":\"hab\"}") .toObject(AvailableOperationDisplay.class); - Assertions.assertEquals("og", model.provider()); - Assertions.assertEquals("e", model.resource()); - Assertions.assertEquals("a", model.operation()); - Assertions.assertEquals("uhrzayvvt", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableOperationDisplay model = new AvailableOperationDisplay().withProvider("og") - .withResource("e") - .withOperation("a") - .withDescription("uhrzayvvt"); - model = BinaryData.fromObject(model).toObject(AvailableOperationDisplay.class); - Assertions.assertEquals("og", model.provider()); - Assertions.assertEquals("e", model.resource()); - Assertions.assertEquals("a", model.operation()); - Assertions.assertEquals("uhrzayvvt", model.description()); + Assertions.assertEquals("bj", model.provider()); + Assertions.assertEquals("a", model.resource()); + Assertions.assertEquals("th", model.operation()); + Assertions.assertEquals("hab", model.description()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AzureActiveDirectoryTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AzureActiveDirectoryTests.java index 0c9823700795..d67b80754b48 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AzureActiveDirectoryTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/AzureActiveDirectoryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,23 +11,22 @@ public final class AzureActiveDirectoryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AzureActiveDirectory model = BinaryData - .fromString( - "{\"tenantId\":\"cmsxaobhdxbm\",\"clusterApplication\":\"ioq\",\"clientApplication\":\"ehtbm\"}") + AzureActiveDirectory model = BinaryData.fromString( + "{\"tenantId\":\"audccsnhs\",\"clusterApplication\":\"nyejhkryhtnap\",\"clientApplication\":\"wlokjyem\"}") .toObject(AzureActiveDirectory.class); - Assertions.assertEquals("cmsxaobhdxbm", model.tenantId()); - Assertions.assertEquals("ioq", model.clusterApplication()); - Assertions.assertEquals("ehtbm", model.clientApplication()); + Assertions.assertEquals("audccsnhs", model.tenantId()); + Assertions.assertEquals("nyejhkryhtnap", model.clusterApplication()); + Assertions.assertEquals("wlokjyem", model.clientApplication()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AzureActiveDirectory model = new AzureActiveDirectory().withTenantId("cmsxaobhdxbm") - .withClusterApplication("ioq") - .withClientApplication("ehtbm"); + AzureActiveDirectory model = new AzureActiveDirectory().withTenantId("audccsnhs") + .withClusterApplication("nyejhkryhtnap") + .withClientApplication("wlokjyem"); model = BinaryData.fromObject(model).toObject(AzureActiveDirectory.class); - Assertions.assertEquals("cmsxaobhdxbm", model.tenantId()); - Assertions.assertEquals("ioq", model.clusterApplication()); - Assertions.assertEquals("ehtbm", model.clientApplication()); + Assertions.assertEquals("audccsnhs", model.tenantId()); + Assertions.assertEquals("nyejhkryhtnap", model.clusterApplication()); + Assertions.assertEquals("wlokjyem", model.clientApplication()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/CertificateDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/CertificateDescriptionTests.java index bdefdd307ed8..08a7f096d33f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/CertificateDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/CertificateDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,21 +13,21 @@ public final class CertificateDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CertificateDescription model = BinaryData.fromString( - "{\"thumbprint\":\"fpownoizhwlr\",\"thumbprintSecondary\":\"bqsoqijg\",\"x509StoreName\":\"TrustedPublisher\"}") + "{\"thumbprint\":\"kvnipjoxz\",\"thumbprintSecondary\":\"chgejspodm\",\"x509StoreName\":\"TrustedPeople\"}") .toObject(CertificateDescription.class); - Assertions.assertEquals("fpownoizhwlr", model.thumbprint()); - Assertions.assertEquals("bqsoqijg", model.thumbprintSecondary()); - Assertions.assertEquals(StoreName.TRUSTED_PUBLISHER, model.x509StoreName()); + Assertions.assertEquals("kvnipjoxz", model.thumbprint()); + Assertions.assertEquals("chgejspodm", model.thumbprintSecondary()); + Assertions.assertEquals(StoreName.TRUSTED_PEOPLE, model.x509StoreName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertificateDescription model = new CertificateDescription().withThumbprint("fpownoizhwlr") - .withThumbprintSecondary("bqsoqijg") - .withX509StoreName(StoreName.TRUSTED_PUBLISHER); + CertificateDescription model = new CertificateDescription().withThumbprint("kvnipjoxz") + .withThumbprintSecondary("chgejspodm") + .withX509StoreName(StoreName.TRUSTED_PEOPLE); model = BinaryData.fromObject(model).toObject(CertificateDescription.class); - Assertions.assertEquals("fpownoizhwlr", model.thumbprint()); - Assertions.assertEquals("bqsoqijg", model.thumbprintSecondary()); - Assertions.assertEquals(StoreName.TRUSTED_PUBLISHER, model.x509StoreName()); + Assertions.assertEquals("kvnipjoxz", model.thumbprint()); + Assertions.assertEquals("chgejspodm", model.thumbprintSecondary()); + Assertions.assertEquals(StoreName.TRUSTED_PEOPLE, model.x509StoreName()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateCommonNameTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateCommonNameTests.java index ee0fda021d96..fbbe7ccba97e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateCommonNameTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateCommonNameTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,22 +11,23 @@ public final class ClientCertificateCommonNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClientCertificateCommonName model = BinaryData.fromString( - "{\"isAdmin\":false,\"certificateCommonName\":\"jpsq\",\"certificateIssuerThumbprint\":\"cmpoyfdkfogkny\"}") + ClientCertificateCommonName model = BinaryData + .fromString( + "{\"isAdmin\":false,\"certificateCommonName\":\"iodjp\",\"certificateIssuerThumbprint\":\"lwejdpv\"}") .toObject(ClientCertificateCommonName.class); - Assertions.assertEquals(false, model.isAdmin()); - Assertions.assertEquals("jpsq", model.certificateCommonName()); - Assertions.assertEquals("cmpoyfdkfogkny", model.certificateIssuerThumbprint()); + Assertions.assertFalse(model.isAdmin()); + Assertions.assertEquals("iodjp", model.certificateCommonName()); + Assertions.assertEquals("lwejdpv", model.certificateIssuerThumbprint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClientCertificateCommonName model = new ClientCertificateCommonName().withIsAdmin(false) - .withCertificateCommonName("jpsq") - .withCertificateIssuerThumbprint("cmpoyfdkfogkny"); + .withCertificateCommonName("iodjp") + .withCertificateIssuerThumbprint("lwejdpv"); model = BinaryData.fromObject(model).toObject(ClientCertificateCommonName.class); - Assertions.assertEquals(false, model.isAdmin()); - Assertions.assertEquals("jpsq", model.certificateCommonName()); - Assertions.assertEquals("cmpoyfdkfogkny", model.certificateIssuerThumbprint()); + Assertions.assertFalse(model.isAdmin()); + Assertions.assertEquals("iodjp", model.certificateCommonName()); + Assertions.assertEquals("lwejdpv", model.certificateIssuerThumbprint()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateThumbprintTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateThumbprintTests.java index d9155125ab33..637ed1ea1334 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateThumbprintTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClientCertificateThumbprintTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,18 +12,18 @@ public final class ClientCertificateThumbprintTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClientCertificateThumbprint model - = BinaryData.fromString("{\"isAdmin\":false,\"certificateThumbprint\":\"ofjdde\"}") + = BinaryData.fromString("{\"isAdmin\":false,\"certificateThumbprint\":\"yoqpsoaccta\"}") .toObject(ClientCertificateThumbprint.class); - Assertions.assertEquals(false, model.isAdmin()); - Assertions.assertEquals("ofjdde", model.certificateThumbprint()); + Assertions.assertFalse(model.isAdmin()); + Assertions.assertEquals("yoqpsoaccta", model.certificateThumbprint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClientCertificateThumbprint model - = new ClientCertificateThumbprint().withIsAdmin(false).withCertificateThumbprint("ofjdde"); + = new ClientCertificateThumbprint().withIsAdmin(false).withCertificateThumbprint("yoqpsoaccta"); model = BinaryData.fromObject(model).toObject(ClientCertificateThumbprint.class); - Assertions.assertEquals(false, model.isAdmin()); - Assertions.assertEquals("ofjdde", model.certificateThumbprint()); + Assertions.assertFalse(model.isAdmin()); + Assertions.assertEquals("yoqpsoaccta", model.certificateThumbprint()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterHealthPolicyTests.java index 775e889505d2..ccec0510129d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -16,62 +16,52 @@ public final class ClusterHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterHealthPolicy model = BinaryData.fromString( - "{\"maxPercentUnhealthyNodes\":180815183,\"maxPercentUnhealthyApplications\":1181425969,\"applicationHealthPolicies\":{\"eotusivyevc\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1824195045},\"serviceTypeHealthPolicies\":{\"pdvhpfxxypin\":{\"maxPercentUnhealthyServices\":864037829},\"ayhuy\":{\"maxPercentUnhealthyServices\":2146603578},\"podepoo\":{\"maxPercentUnhealthyServices\":1192352775},\"uvamiheognarxzxt\":{\"maxPercentUnhealthyServices\":895630833}}},\"kufubljo\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1522291140},\"serviceTypeHealthPolicies\":{\"ngbwjz\":{\"maxPercentUnhealthyServices\":422843266},\"ygxgispemvtz\":{\"maxPercentUnhealthyServices\":1668036347}}},\"jqul\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":111264928},\"serviceTypeHealthPolicies\":{\"e\":{\"maxPercentUnhealthyServices\":1330720242},\"qjbasvms\":{\"maxPercentUnhealthyServices\":565226786}}}}}") + "{\"maxPercentUnhealthyNodes\":239046622,\"maxPercentUnhealthyApplications\":1167970761,\"applicationHealthPolicies\":{\"cpr\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":43446932},\"serviceTypeHealthPolicies\":{\"uvfqawrlyxwj\":{\"maxPercentUnhealthyServices\":969433721}}},\"uitnwuiz\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":181237829},\"serviceTypeHealthPolicies\":{\"tbvpysszdnru\":{\"maxPercentUnhealthyServices\":590807378},\"uhmuouqfprwzwbn\":{\"maxPercentUnhealthyServices\":718700797}}}}}") .toObject(ClusterHealthPolicy.class); - Assertions.assertEquals(180815183, model.maxPercentUnhealthyNodes()); - Assertions.assertEquals(1181425969, model.maxPercentUnhealthyApplications()); - Assertions.assertEquals(1824195045, + Assertions.assertEquals(239046622, model.maxPercentUnhealthyNodes()); + Assertions.assertEquals(1167970761, model.maxPercentUnhealthyApplications()); + Assertions.assertEquals(43446932, model.applicationHealthPolicies() - .get("eotusivyevc") + .get("cpr") .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(864037829, + Assertions.assertEquals(969433721, model.applicationHealthPolicies() - .get("eotusivyevc") + .get("cpr") .serviceTypeHealthPolicies() - .get("pdvhpfxxypin") + .get("uvfqawrlyxwj") .maxPercentUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterHealthPolicy model = new ClusterHealthPolicy().withMaxPercentUnhealthyNodes(180815183) - .withMaxPercentUnhealthyApplications(1181425969) - .withApplicationHealthPolicies(mapOf("eotusivyevc", new ApplicationHealthPolicy() + ClusterHealthPolicy model = new ClusterHealthPolicy().withMaxPercentUnhealthyNodes(239046622) + .withMaxPercentUnhealthyApplications(1167970761) + .withApplicationHealthPolicies(mapOf("cpr", new ApplicationHealthPolicy() .withDefaultServiceTypeHealthPolicy( - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1824195045)) + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(43446932)) .withServiceTypeHealthPolicies( - mapOf("pdvhpfxxypin", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(864037829), - "ayhuy", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2146603578), "podepoo", - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1192352775), "uvamiheognarxzxt", - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(895630833))), - "kufubljo", + mapOf("uvfqawrlyxwj", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(969433721))), + "uitnwuiz", new ApplicationHealthPolicy() .withDefaultServiceTypeHealthPolicy( - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1522291140)) - .withServiceTypeHealthPolicies( - mapOf("ngbwjz", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(422843266), - "ygxgispemvtz", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1668036347))), - "jqul", - new ApplicationHealthPolicy() - .withDefaultServiceTypeHealthPolicy( - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(111264928)) - .withServiceTypeHealthPolicies( - mapOf("e", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1330720242), - "qjbasvms", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(565226786))))); + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(181237829)) + .withServiceTypeHealthPolicies(mapOf("tbvpysszdnru", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(590807378), "uhmuouqfprwzwbn", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(718700797))))); model = BinaryData.fromObject(model).toObject(ClusterHealthPolicy.class); - Assertions.assertEquals(180815183, model.maxPercentUnhealthyNodes()); - Assertions.assertEquals(1181425969, model.maxPercentUnhealthyApplications()); - Assertions.assertEquals(1824195045, + Assertions.assertEquals(239046622, model.maxPercentUnhealthyNodes()); + Assertions.assertEquals(1167970761, model.maxPercentUnhealthyApplications()); + Assertions.assertEquals(43446932, model.applicationHealthPolicies() - .get("eotusivyevc") + .get("cpr") .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(864037829, + Assertions.assertEquals(969433721, model.applicationHealthPolicies() - .get("eotusivyevc") + .get("cpr") .serviceTypeHealthPolicies() - .get("pdvhpfxxypin") + .get("uvfqawrlyxwj") .maxPercentUnhealthyServices()); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradeDeltaHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradeDeltaHealthPolicyTests.java index 2e47221717ea..57e7de30c120 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradeDeltaHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradeDeltaHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -16,71 +16,63 @@ public final class ClusterUpgradeDeltaHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterUpgradeDeltaHealthPolicy model = BinaryData.fromString( - "{\"maxPercentDeltaUnhealthyNodes\":1154463022,\"maxPercentUpgradeDomainDeltaUnhealthyNodes\":595941541,\"maxPercentDeltaUnhealthyApplications\":1356626713,\"applicationDeltaHealthPolicies\":{\"vmgxsab\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":461040275},\"serviceTypeDeltaHealthPolicies\":{\"ljfmppee\":{\"maxPercentDeltaUnhealthyServices\":347858915}}},\"dkvwrwjfe\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1160647104},\"serviceTypeDeltaHealthPolicies\":{\"tcj\":{\"maxPercentDeltaUnhealthyServices\":2066308678},\"zevndhkrwpdappds\":{\"maxPercentDeltaUnhealthyServices\":372276294}}},\"tqxhocdgeab\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1102727938},\"serviceTypeDeltaHealthPolicies\":{\"ltmrldh\":{\"maxPercentDeltaUnhealthyServices\":1936335434},\"zzd\":{\"maxPercentDeltaUnhealthyServices\":885785432}}},\"aozwyiftyhxhu\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":743985587},\"serviceTypeDeltaHealthPolicies\":{\"ndv\":{\"maxPercentDeltaUnhealthyServices\":1962929741}}}}}") + "{\"maxPercentDeltaUnhealthyNodes\":1150541796,\"maxPercentUpgradeDomainDeltaUnhealthyNodes\":881303294,\"maxPercentDeltaUnhealthyApplications\":260176606,\"applicationDeltaHealthPolicies\":{\"sgfyccsnew\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":396497881},\"serviceTypeDeltaHealthPolicies\":{\"wxmnteiwao\":{\"maxPercentDeltaUnhealthyServices\":490464950},\"mijcmmxdcufufs\":{\"maxPercentDeltaUnhealthyServices\":269791591},\"mzidnsezcxtb\":{\"maxPercentDeltaUnhealthyServices\":1460749034}}},\"crmnohjtckwhds\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":44464100},\"serviceTypeDeltaHealthPolicies\":{\"chboosflnrosf\":{\"maxPercentDeltaUnhealthyServices\":479901048},\"eeh\":{\"maxPercentDeltaUnhealthyServices\":104787050},\"ypyqrimzinp\":{\"maxPercentDeltaUnhealthyServices\":1130087895},\"jdkirsoodqx\":{\"maxPercentDeltaUnhealthyServices\":990570448}}}}}") .toObject(ClusterUpgradeDeltaHealthPolicy.class); - Assertions.assertEquals(1154463022, model.maxPercentDeltaUnhealthyNodes()); - Assertions.assertEquals(595941541, model.maxPercentUpgradeDomainDeltaUnhealthyNodes()); - Assertions.assertEquals(1356626713, model.maxPercentDeltaUnhealthyApplications()); - Assertions.assertEquals(461040275, + Assertions.assertEquals(1150541796, model.maxPercentDeltaUnhealthyNodes()); + Assertions.assertEquals(881303294, model.maxPercentUpgradeDomainDeltaUnhealthyNodes()); + Assertions.assertEquals(260176606, model.maxPercentDeltaUnhealthyApplications()); + Assertions.assertEquals(396497881, model.applicationDeltaHealthPolicies() - .get("vmgxsab") + .get("sgfyccsnew") .defaultServiceTypeDeltaHealthPolicy() .maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(347858915, + Assertions.assertEquals(490464950, model.applicationDeltaHealthPolicies() - .get("vmgxsab") + .get("sgfyccsnew") .serviceTypeDeltaHealthPolicies() - .get("ljfmppee") + .get("wxmnteiwao") .maxPercentDeltaUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterUpgradeDeltaHealthPolicy model - = new ClusterUpgradeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyNodes(1154463022) - .withMaxPercentUpgradeDomainDeltaUnhealthyNodes(595941541) - .withMaxPercentDeltaUnhealthyApplications(1356626713) - .withApplicationDeltaHealthPolicies(mapOf("vmgxsab", - new ApplicationDeltaHealthPolicy() - .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(461040275)) - .withServiceTypeDeltaHealthPolicies(mapOf("ljfmppee", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(347858915))), - "dkvwrwjfe", - new ApplicationDeltaHealthPolicy() - .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1160647104)) - .withServiceTypeDeltaHealthPolicies(mapOf("tcj", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(2066308678), - "zevndhkrwpdappds", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(372276294))), - "tqxhocdgeab", - new ApplicationDeltaHealthPolicy() - .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1102727938)) - .withServiceTypeDeltaHealthPolicies(mapOf("ltmrldh", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1936335434), "zzd", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(885785432))), - "aozwyiftyhxhu", - new ApplicationDeltaHealthPolicy() - .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(743985587)) - .withServiceTypeDeltaHealthPolicies(mapOf("ndv", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1962929741))))); + ClusterUpgradeDeltaHealthPolicy model = new ClusterUpgradeDeltaHealthPolicy() + .withMaxPercentDeltaUnhealthyNodes(1150541796) + .withMaxPercentUpgradeDomainDeltaUnhealthyNodes(881303294) + .withMaxPercentDeltaUnhealthyApplications(260176606) + .withApplicationDeltaHealthPolicies(mapOf("sgfyccsnew", new ApplicationDeltaHealthPolicy() + .withDefaultServiceTypeDeltaHealthPolicy( + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(396497881)) + .withServiceTypeDeltaHealthPolicies(mapOf("wxmnteiwao", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(490464950), + "mijcmmxdcufufs", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(269791591), "mzidnsezcxtb", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1460749034))), + "crmnohjtckwhds", + new ApplicationDeltaHealthPolicy() + .withDefaultServiceTypeDeltaHealthPolicy( + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(44464100)) + .withServiceTypeDeltaHealthPolicies(mapOf("chboosflnrosf", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(479901048), "eeh", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(104787050), + "ypyqrimzinp", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1130087895), + "jdkirsoodqx", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(990570448))))); model = BinaryData.fromObject(model).toObject(ClusterUpgradeDeltaHealthPolicy.class); - Assertions.assertEquals(1154463022, model.maxPercentDeltaUnhealthyNodes()); - Assertions.assertEquals(595941541, model.maxPercentUpgradeDomainDeltaUnhealthyNodes()); - Assertions.assertEquals(1356626713, model.maxPercentDeltaUnhealthyApplications()); - Assertions.assertEquals(461040275, + Assertions.assertEquals(1150541796, model.maxPercentDeltaUnhealthyNodes()); + Assertions.assertEquals(881303294, model.maxPercentUpgradeDomainDeltaUnhealthyNodes()); + Assertions.assertEquals(260176606, model.maxPercentDeltaUnhealthyApplications()); + Assertions.assertEquals(396497881, model.applicationDeltaHealthPolicies() - .get("vmgxsab") + .get("sgfyccsnew") .defaultServiceTypeDeltaHealthPolicy() .maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(347858915, + Assertions.assertEquals(490464950, model.applicationDeltaHealthPolicies() - .get("vmgxsab") + .get("sgfyccsnew") .serviceTypeDeltaHealthPolicies() - .get("ljfmppee") + .get("wxmnteiwao") .maxPercentDeltaUnhealthyServices()); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradePolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradePolicyTests.java index b93ba2807119..25ecbefbb72a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradePolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClusterUpgradePolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -20,134 +20,146 @@ public final class ClusterUpgradePolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClusterUpgradePolicy model = BinaryData.fromString( - "{\"forceRestart\":false,\"upgradeReplicaSetCheckTimeout\":\"wvukx\",\"healthCheckWaitDuration\":\"audccsnhs\",\"healthCheckStableDuration\":\"cnyejhkryhtnapcz\",\"healthCheckRetryTimeout\":\"lokjyemkk\",\"upgradeTimeout\":\"ni\",\"upgradeDomainTimeout\":\"joxzjnchgejspodm\",\"healthPolicy\":{\"maxPercentUnhealthyNodes\":1543997460,\"maxPercentUnhealthyApplications\":1345546955,\"applicationHealthPolicies\":{\"jvwmfda\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1876925756},\"serviceTypeHealthPolicies\":{\"uxinpmqnjaq\":{\"maxPercentUnhealthyServices\":302858012},\"jsprozvcpute\":{\"maxPercentUnhealthyServices\":288433409}}}}},\"deltaHealthPolicy\":{\"maxPercentDeltaUnhealthyNodes\":1030512533,\"maxPercentUpgradeDomainDeltaUnhealthyNodes\":344559573,\"maxPercentDeltaUnhealthyApplications\":1290413072,\"applicationDeltaHealthPolicies\":{\"slwejdpvw\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":153428823},\"serviceTypeDeltaHealthPolicies\":{\"vmkjozkrwfndiodj\":{\"maxPercentDeltaUnhealthyServices\":796050777}}},\"hcrzevd\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1059261896},\"serviceTypeDeltaHealthPolicies\":{\"cctazakljlahbc\":{\"maxPercentDeltaUnhealthyServices\":854028036},\"fdfdosygexpa\":{\"maxPercentDeltaUnhealthyServices\":1201536256},\"khmsbz\":{\"maxPercentDeltaUnhealthyServices\":889386051}}},\"it\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1500196175},\"serviceTypeDeltaHealthPolicies\":{\"hqtrgqjbpf\":{\"maxPercentDeltaUnhealthyServices\":965033495},\"inzgvfcj\":{\"maxPercentDeltaUnhealthyServices\":257181558},\"oxxjtfelluwf\":{\"maxPercentDeltaUnhealthyServices\":1821850933}}}}}}") + "{\"forceRestart\":true,\"upgradeReplicaSetCheckTimeout\":\"wnzlljfmppeeb\",\"healthCheckWaitDuration\":\"mgxsab\",\"healthCheckStableDuration\":\"yqduujit\",\"healthCheckRetryTimeout\":\"jczdzevndh\",\"upgradeTimeout\":\"rwpdappdsbdkvwrw\",\"upgradeDomainTimeout\":\"feusnhut\",\"healthPolicy\":{\"maxPercentUnhealthyNodes\":1743582993,\"maxPercentUnhealthyApplications\":1438650135,\"applicationHealthPolicies\":{\"phut\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":2022069390},\"serviceTypeHealthPolicies\":{\"datqxhocdgeabl\":{\"maxPercentUnhealthyServices\":700845418}}},\"k\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1686468499},\"serviceTypeHealthPolicies\":{\"zwyiftyhxhur\":{\"maxPercentUnhealthyServices\":1455747257}}},\"gfgibm\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1369496360},\"serviceTypeHealthPolicies\":{\"wpwcukjfkgiawxkl\":{\"maxPercentUnhealthyServices\":1868047247},\"lwckbasyypnddhs\":{\"maxPercentUnhealthyServices\":2108755788},\"acphejkoty\":{\"maxPercentUnhealthyServices\":248766473},\"oulzndlikwyq\":{\"maxPercentUnhealthyServices\":757698897}}},\"ta\":{\"defaultServiceTypeHealthPolicy\":{\"maxPercentUnhealthyServices\":1288567604},\"serviceTypeHealthPolicies\":{\"rxybz\":{\"maxPercentUnhealthyServices\":186641812},\"dqytbciqfouflmm\":{\"maxPercentUnhealthyServices\":161045800},\"smodmgloug\":{\"maxPercentUnhealthyServices\":799119693},\"wtmutduq\":{\"maxPercentUnhealthyServices\":2107455615}}}}},\"deltaHealthPolicy\":{\"maxPercentDeltaUnhealthyNodes\":12180649,\"maxPercentUpgradeDomainDeltaUnhealthyNodes\":1035420183,\"maxPercentDeltaUnhealthyApplications\":807711520,\"applicationDeltaHealthPolicies\":{\"vqwhbmdgbbjfd\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1218908818},\"serviceTypeDeltaHealthPolicies\":{\"o\":{\"maxPercentDeltaUnhealthyServices\":1838728472}}},\"jaoyfhrtx\":{\"defaultServiceTypeDeltaHealthPolicy\":{\"maxPercentDeltaUnhealthyServices\":1359237516},\"serviceTypeDeltaHealthPolicies\":{\"ppbhtqqrolfp\":{\"maxPercentDeltaUnhealthyServices\":531991652},\"algbquxigjyjg\":{\"maxPercentDeltaUnhealthyServices\":68812306}}}}}}") .toObject(ClusterUpgradePolicy.class); - Assertions.assertEquals(false, model.forceRestart()); - Assertions.assertEquals("wvukx", model.upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals("audccsnhs", model.healthCheckWaitDuration()); - Assertions.assertEquals("cnyejhkryhtnapcz", model.healthCheckStableDuration()); - Assertions.assertEquals("lokjyemkk", model.healthCheckRetryTimeout()); - Assertions.assertEquals("ni", model.upgradeTimeout()); - Assertions.assertEquals("joxzjnchgejspodm", model.upgradeDomainTimeout()); - Assertions.assertEquals(1543997460, model.healthPolicy().maxPercentUnhealthyNodes()); - Assertions.assertEquals(1345546955, model.healthPolicy().maxPercentUnhealthyApplications()); - Assertions.assertEquals(1876925756, + Assertions.assertTrue(model.forceRestart()); + Assertions.assertEquals("wnzlljfmppeeb", model.upgradeReplicaSetCheckTimeout()); + Assertions.assertEquals("mgxsab", model.healthCheckWaitDuration()); + Assertions.assertEquals("yqduujit", model.healthCheckStableDuration()); + Assertions.assertEquals("jczdzevndh", model.healthCheckRetryTimeout()); + Assertions.assertEquals("rwpdappdsbdkvwrw", model.upgradeTimeout()); + Assertions.assertEquals("feusnhut", model.upgradeDomainTimeout()); + Assertions.assertEquals(1743582993, model.healthPolicy().maxPercentUnhealthyNodes()); + Assertions.assertEquals(1438650135, model.healthPolicy().maxPercentUnhealthyApplications()); + Assertions.assertEquals(2022069390, model.healthPolicy() .applicationHealthPolicies() - .get("jvwmfda") + .get("phut") .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(302858012, + Assertions.assertEquals(700845418, model.healthPolicy() .applicationHealthPolicies() - .get("jvwmfda") + .get("phut") .serviceTypeHealthPolicies() - .get("uxinpmqnjaq") + .get("datqxhocdgeabl") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1030512533, model.deltaHealthPolicy().maxPercentDeltaUnhealthyNodes()); - Assertions.assertEquals(344559573, model.deltaHealthPolicy().maxPercentUpgradeDomainDeltaUnhealthyNodes()); - Assertions.assertEquals(1290413072, model.deltaHealthPolicy().maxPercentDeltaUnhealthyApplications()); - Assertions.assertEquals(153428823, + Assertions.assertEquals(12180649, model.deltaHealthPolicy().maxPercentDeltaUnhealthyNodes()); + Assertions.assertEquals(1035420183, model.deltaHealthPolicy().maxPercentUpgradeDomainDeltaUnhealthyNodes()); + Assertions.assertEquals(807711520, model.deltaHealthPolicy().maxPercentDeltaUnhealthyApplications()); + Assertions.assertEquals(1218908818, model.deltaHealthPolicy() .applicationDeltaHealthPolicies() - .get("slwejdpvw") + .get("vqwhbmdgbbjfd") .defaultServiceTypeDeltaHealthPolicy() .maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(796050777, + Assertions.assertEquals(1838728472, model.deltaHealthPolicy() .applicationDeltaHealthPolicies() - .get("slwejdpvw") + .get("vqwhbmdgbbjfd") .serviceTypeDeltaHealthPolicies() - .get("vmkjozkrwfndiodj") + .get("o") .maxPercentDeltaUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterUpgradePolicy model - = new ClusterUpgradePolicy().withForceRestart(false) - .withUpgradeReplicaSetCheckTimeout("wvukx") - .withHealthCheckWaitDuration("audccsnhs") - .withHealthCheckStableDuration("cnyejhkryhtnapcz") - .withHealthCheckRetryTimeout("lokjyemkk") - .withUpgradeTimeout("ni") - .withUpgradeDomainTimeout("joxzjnchgejspodm") - .withHealthPolicy(new ClusterHealthPolicy().withMaxPercentUnhealthyNodes(1543997460) - .withMaxPercentUnhealthyApplications(1345546955) - .withApplicationHealthPolicies(mapOf("jvwmfda", new ApplicationHealthPolicy() + ClusterUpgradePolicy model = new ClusterUpgradePolicy().withForceRestart(true) + .withUpgradeReplicaSetCheckTimeout("wnzlljfmppeeb") + .withHealthCheckWaitDuration("mgxsab") + .withHealthCheckStableDuration("yqduujit") + .withHealthCheckRetryTimeout("jczdzevndh") + .withUpgradeTimeout("rwpdappdsbdkvwrw") + .withUpgradeDomainTimeout("feusnhut") + .withHealthPolicy(new ClusterHealthPolicy().withMaxPercentUnhealthyNodes(1743582993) + .withMaxPercentUnhealthyApplications(1438650135) + .withApplicationHealthPolicies(mapOf("phut", + new ApplicationHealthPolicy() .withDefaultServiceTypeHealthPolicy( - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1876925756)) - .withServiceTypeHealthPolicies(mapOf("uxinpmqnjaq", - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(302858012), "jsprozvcpute", - new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(288433409)))))) - .withDeltaHealthPolicy(new ClusterUpgradeDeltaHealthPolicy() - .withMaxPercentDeltaUnhealthyNodes(1030512533) - .withMaxPercentUpgradeDomainDeltaUnhealthyNodes(344559573) - .withMaxPercentDeltaUnhealthyApplications(1290413072) - .withApplicationDeltaHealthPolicies(mapOf("slwejdpvw", - new ApplicationDeltaHealthPolicy() - .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(153428823)) - .withServiceTypeDeltaHealthPolicies(mapOf("vmkjozkrwfndiodj", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(796050777))), - "hcrzevd", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2022069390)) + .withServiceTypeHealthPolicies(mapOf("datqxhocdgeabl", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(700845418))), + "k", + new ApplicationHealthPolicy() + .withDefaultServiceTypeHealthPolicy( + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1686468499)) + .withServiceTypeHealthPolicies(mapOf( + "zwyiftyhxhur", new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1455747257))), + "gfgibm", + new ApplicationHealthPolicy() + .withDefaultServiceTypeHealthPolicy( + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1369496360)) + .withServiceTypeHealthPolicies(mapOf("wpwcukjfkgiawxkl", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1868047247), + "lwckbasyypnddhs", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2108755788), "acphejkoty", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(248766473), "oulzndlikwyq", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(757698897))), + "ta", + new ApplicationHealthPolicy() + .withDefaultServiceTypeHealthPolicy( + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1288567604)) + .withServiceTypeHealthPolicies(mapOf("rxybz", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(186641812), "dqytbciqfouflmm", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(161045800), "smodmgloug", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(799119693), "wtmutduq", + new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(2107455615)))))) + .withDeltaHealthPolicy( + new ClusterUpgradeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyNodes(12180649) + .withMaxPercentUpgradeDomainDeltaUnhealthyNodes(1035420183) + .withMaxPercentDeltaUnhealthyApplications(807711520) + .withApplicationDeltaHealthPolicies(mapOf("vqwhbmdgbbjfd", new ApplicationDeltaHealthPolicy() .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1059261896)) - .withServiceTypeDeltaHealthPolicies(mapOf("cctazakljlahbc", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(854028036), - "fdfdosygexpa", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1201536256), - "khmsbz", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(889386051))), - "it", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1218908818)) + .withServiceTypeDeltaHealthPolicies(mapOf("o", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1838728472))), + "jaoyfhrtx", new ApplicationDeltaHealthPolicy() .withDefaultServiceTypeDeltaHealthPolicy( - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1500196175)) - .withServiceTypeDeltaHealthPolicies(mapOf("hqtrgqjbpf", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(965033495), - "inzgvfcj", - new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(257181558), - "oxxjtfelluwf", new ServiceTypeDeltaHealthPolicy() - .withMaxPercentDeltaUnhealthyServices(1821850933)))))); + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1359237516)) + .withServiceTypeDeltaHealthPolicies(mapOf("ppbhtqqrolfp", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(531991652), + "algbquxigjyjg", + new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(68812306)))))); model = BinaryData.fromObject(model).toObject(ClusterUpgradePolicy.class); - Assertions.assertEquals(false, model.forceRestart()); - Assertions.assertEquals("wvukx", model.upgradeReplicaSetCheckTimeout()); - Assertions.assertEquals("audccsnhs", model.healthCheckWaitDuration()); - Assertions.assertEquals("cnyejhkryhtnapcz", model.healthCheckStableDuration()); - Assertions.assertEquals("lokjyemkk", model.healthCheckRetryTimeout()); - Assertions.assertEquals("ni", model.upgradeTimeout()); - Assertions.assertEquals("joxzjnchgejspodm", model.upgradeDomainTimeout()); - Assertions.assertEquals(1543997460, model.healthPolicy().maxPercentUnhealthyNodes()); - Assertions.assertEquals(1345546955, model.healthPolicy().maxPercentUnhealthyApplications()); - Assertions.assertEquals(1876925756, + Assertions.assertTrue(model.forceRestart()); + Assertions.assertEquals("wnzlljfmppeeb", model.upgradeReplicaSetCheckTimeout()); + Assertions.assertEquals("mgxsab", model.healthCheckWaitDuration()); + Assertions.assertEquals("yqduujit", model.healthCheckStableDuration()); + Assertions.assertEquals("jczdzevndh", model.healthCheckRetryTimeout()); + Assertions.assertEquals("rwpdappdsbdkvwrw", model.upgradeTimeout()); + Assertions.assertEquals("feusnhut", model.upgradeDomainTimeout()); + Assertions.assertEquals(1743582993, model.healthPolicy().maxPercentUnhealthyNodes()); + Assertions.assertEquals(1438650135, model.healthPolicy().maxPercentUnhealthyApplications()); + Assertions.assertEquals(2022069390, model.healthPolicy() .applicationHealthPolicies() - .get("jvwmfda") + .get("phut") .defaultServiceTypeHealthPolicy() .maxPercentUnhealthyServices()); - Assertions.assertEquals(302858012, + Assertions.assertEquals(700845418, model.healthPolicy() .applicationHealthPolicies() - .get("jvwmfda") + .get("phut") .serviceTypeHealthPolicies() - .get("uxinpmqnjaq") + .get("datqxhocdgeabl") .maxPercentUnhealthyServices()); - Assertions.assertEquals(1030512533, model.deltaHealthPolicy().maxPercentDeltaUnhealthyNodes()); - Assertions.assertEquals(344559573, model.deltaHealthPolicy().maxPercentUpgradeDomainDeltaUnhealthyNodes()); - Assertions.assertEquals(1290413072, model.deltaHealthPolicy().maxPercentDeltaUnhealthyApplications()); - Assertions.assertEquals(153428823, + Assertions.assertEquals(12180649, model.deltaHealthPolicy().maxPercentDeltaUnhealthyNodes()); + Assertions.assertEquals(1035420183, model.deltaHealthPolicy().maxPercentUpgradeDomainDeltaUnhealthyNodes()); + Assertions.assertEquals(807711520, model.deltaHealthPolicy().maxPercentDeltaUnhealthyApplications()); + Assertions.assertEquals(1218908818, model.deltaHealthPolicy() .applicationDeltaHealthPolicies() - .get("slwejdpvw") + .get("vqwhbmdgbbjfd") .defaultServiceTypeDeltaHealthPolicy() .maxPercentDeltaUnhealthyServices()); - Assertions.assertEquals(796050777, + Assertions.assertEquals(1838728472, model.deltaHealthPolicy() .applicationDeltaHealthPolicies() - .get("slwejdpvw") + .get("vqwhbmdgbbjfd") .serviceTypeDeltaHealthPolicies() - .get("vmkjozkrwfndiodj") + .get("o") .maxPercentDeltaUnhealthyServices()); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteByResourceGroupWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteByResourceGroupWithResponseMockTests.java index 19014544acc8..661ef115f8aa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersDeleteByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.clusters().deleteByResourceGroupWithResponse("opgxedkowepb", "pc", com.azure.core.util.Context.NONE); + manager.clusters() + .deleteByResourceGroupWithResponse("hlmctlpdngitvgb", "hrixkwmy", com.azure.core.util.Context.NONE); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsWithResponseMockTests.java index 128c9fdc87eb..7b546535c0a8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ClustersListUpgradableVersionsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.UpgradableVersionPathResult; @@ -21,21 +21,20 @@ public final class ClustersListUpgradableVersionsWithResponseMockTests { @Test public void testListUpgradableVersionsWithResponse() throws Exception { - String responseStr = "{\"supportedPath\":[\"vgoup\"]}"; + String responseStr = "{\"supportedPath\":[\"kmcwaekrrjreafx\",\"sgumhjglikkxwsl\",\"lbqpvuzlmvfelf\",\"tgp\"]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); UpgradableVersionPathResult response = manager.clusters() - .listUpgradableVersionsWithResponse("dhtmdvypgikd", "szywkbirryu", - new UpgradableVersionsDescription().withTargetVersion("hlhkjoqrvqqaatj"), - com.azure.core.util.Context.NONE) + .listUpgradableVersionsWithResponse("svfycxzbfv", "owvrvmtgjqppyos", + new UpgradableVersionsDescription().withTargetVersion("ronzmyhgfip"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vgoup", response.supportedPath().get(0)); + Assertions.assertEquals("kmcwaekrrjreafx", response.supportedPath().get(0)); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/EndpointRangeDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/EndpointRangeDescriptionTests.java index 5fb877ccb3a5..ba66f06ce478 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/EndpointRangeDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/EndpointRangeDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,18 +11,18 @@ public final class EndpointRangeDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EndpointRangeDescription model = BinaryData.fromString("{\"startPort\":1629282531,\"endPort\":850212440}") + EndpointRangeDescription model = BinaryData.fromString("{\"startPort\":1437691312,\"endPort\":568858007}") .toObject(EndpointRangeDescription.class); - Assertions.assertEquals(1629282531, model.startPort()); - Assertions.assertEquals(850212440, model.endPort()); + Assertions.assertEquals(1437691312, model.startPort()); + Assertions.assertEquals(568858007, model.endPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { EndpointRangeDescription model - = new EndpointRangeDescription().withStartPort(1629282531).withEndPort(850212440); + = new EndpointRangeDescription().withStartPort(1437691312).withEndPort(568858007); model = BinaryData.fromObject(model).toObject(EndpointRangeDescription.class); - Assertions.assertEquals(1629282531, model.startPort()); - Assertions.assertEquals(850212440, model.endPort()); + Assertions.assertEquals(1437691312, model.startPort()); + Assertions.assertEquals(568858007, model.endPort()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ManagedIdentityTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ManagedIdentityTests.java index b09c405e2428..152373533e7d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ManagedIdentityTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ManagedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -16,7 +16,7 @@ public final class ManagedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedIdentity model = BinaryData.fromString( - "{\"principalId\":\"hcdhmdual\",\"tenantId\":\"xqpvfadmw\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"isgwbnbbeldawkz\":{\"principalId\":\"xpvgo\",\"clientId\":\"lf\"}}}") + "{\"principalId\":\"wjmy\",\"tenantId\":\"dsslswt\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"hhszh\":{\"principalId\":\"fzp\",\"clientId\":\"semwabnet\"}}}") .toObject(ManagedIdentity.class); Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); } @@ -24,7 +24,7 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedIdentity model = new ManagedIdentity().withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("isgwbnbbeldawkz", new UserAssignedIdentity())); + .withUserAssignedIdentities(mapOf("hhszh", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NamedPartitionSchemeDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NamedPartitionSchemeDescriptionTests.java index 37eaabb6f8eb..8f97af9d6e53 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NamedPartitionSchemeDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NamedPartitionSchemeDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,20 +12,19 @@ public final class NamedPartitionSchemeDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NamedPartitionSchemeDescription model = BinaryData - .fromString( - "{\"partitionScheme\":\"Named\",\"count\":1561704632,\"names\":[\"refajpjorwkqnyh\",\"b\",\"j\"]}") - .toObject(NamedPartitionSchemeDescription.class); - Assertions.assertEquals(1561704632, model.count()); - Assertions.assertEquals("refajpjorwkqnyh", model.names().get(0)); + NamedPartitionSchemeDescription model + = BinaryData.fromString("{\"partitionScheme\":\"Named\",\"count\":1813126235,\"names\":[\"equi\"]}") + .toObject(NamedPartitionSchemeDescription.class); + Assertions.assertEquals(1813126235, model.count()); + Assertions.assertEquals("equi", model.names().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NamedPartitionSchemeDescription model = new NamedPartitionSchemeDescription().withCount(1561704632) - .withNames(Arrays.asList("refajpjorwkqnyh", "b", "j")); + NamedPartitionSchemeDescription model + = new NamedPartitionSchemeDescription().withCount(1813126235).withNames(Arrays.asList("equi")); model = BinaryData.fromObject(model).toObject(NamedPartitionSchemeDescription.class); - Assertions.assertEquals(1561704632, model.count()); - Assertions.assertEquals("refajpjorwkqnyh", model.names().get(0)); + Assertions.assertEquals(1813126235, model.count()); + Assertions.assertEquals("equi", model.names().get(0)); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NodeTypeDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NodeTypeDescriptionTests.java deleted file mode 100644 index c55da0e02c05..000000000000 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NodeTypeDescriptionTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.servicefabric.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.models.DurabilityLevel; -import com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription; -import com.azure.resourcemanager.servicefabric.models.NodeTypeDescription; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NodeTypeDescriptionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeTypeDescription model = BinaryData.fromString( - "{\"name\":\"u\",\"placementProperties\":{\"nwzsymg\":\"ryrtihfxtijbpzv\",\"anufhfcbjysag\":\"zufcyzkohdbi\"},\"capacities\":{\"pikxwczbyscnpqxu\":\"xqhabi\"},\"clientConnectionEndpointPort\":1646115006,\"httpGatewayEndpointPort\":800348188,\"durabilityLevel\":\"Silver\",\"applicationPorts\":{\"startPort\":1574574303,\"endPort\":649847293},\"ephemeralPorts\":{\"startPort\":992034682,\"endPort\":355535904},\"isPrimary\":false,\"vmInstanceCount\":143848779,\"reverseProxyEndpointPort\":519347031,\"isStateless\":true,\"multipleAvailabilityZones\":true}") - .toObject(NodeTypeDescription.class); - Assertions.assertEquals("u", model.name()); - Assertions.assertEquals("ryrtihfxtijbpzv", model.placementProperties().get("nwzsymg")); - Assertions.assertEquals("xqhabi", model.capacities().get("pikxwczbyscnpqxu")); - Assertions.assertEquals(1646115006, model.clientConnectionEndpointPort()); - Assertions.assertEquals(800348188, model.httpGatewayEndpointPort()); - Assertions.assertEquals(DurabilityLevel.SILVER, model.durabilityLevel()); - Assertions.assertEquals(1574574303, model.applicationPorts().startPort()); - Assertions.assertEquals(649847293, model.applicationPorts().endPort()); - Assertions.assertEquals(992034682, model.ephemeralPorts().startPort()); - Assertions.assertEquals(355535904, model.ephemeralPorts().endPort()); - Assertions.assertEquals(false, model.isPrimary()); - Assertions.assertEquals(143848779, model.vmInstanceCount()); - Assertions.assertEquals(519347031, model.reverseProxyEndpointPort()); - Assertions.assertEquals(true, model.isStateless()); - Assertions.assertEquals(true, model.multipleAvailabilityZones()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeTypeDescription model = new NodeTypeDescription().withName("u") - .withPlacementProperties(mapOf("nwzsymg", "ryrtihfxtijbpzv", "anufhfcbjysag", "zufcyzkohdbi")) - .withCapacities(mapOf("pikxwczbyscnpqxu", "xqhabi")) - .withClientConnectionEndpointPort(1646115006) - .withHttpGatewayEndpointPort(800348188) - .withDurabilityLevel(DurabilityLevel.SILVER) - .withApplicationPorts(new EndpointRangeDescription().withStartPort(1574574303).withEndPort(649847293)) - .withEphemeralPorts(new EndpointRangeDescription().withStartPort(992034682).withEndPort(355535904)) - .withIsPrimary(false) - .withVmInstanceCount(143848779) - .withReverseProxyEndpointPort(519347031) - .withIsStateless(true) - .withMultipleAvailabilityZones(true); - model = BinaryData.fromObject(model).toObject(NodeTypeDescription.class); - Assertions.assertEquals("u", model.name()); - Assertions.assertEquals("ryrtihfxtijbpzv", model.placementProperties().get("nwzsymg")); - Assertions.assertEquals("xqhabi", model.capacities().get("pikxwczbyscnpqxu")); - Assertions.assertEquals(1646115006, model.clientConnectionEndpointPort()); - Assertions.assertEquals(800348188, model.httpGatewayEndpointPort()); - Assertions.assertEquals(DurabilityLevel.SILVER, model.durabilityLevel()); - Assertions.assertEquals(1574574303, model.applicationPorts().startPort()); - Assertions.assertEquals(649847293, model.applicationPorts().endPort()); - Assertions.assertEquals(992034682, model.ephemeralPorts().startPort()); - Assertions.assertEquals(355535904, model.ephemeralPorts().endPort()); - Assertions.assertEquals(false, model.isPrimary()); - Assertions.assertEquals(143848779, model.vmInstanceCount()); - Assertions.assertEquals(519347031, model.reverseProxyEndpointPort()); - Assertions.assertEquals(true, model.isStateless()); - Assertions.assertEquals(true, model.multipleAvailabilityZones()); - } - - // 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/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTargetTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTargetTests.java index aa96d4337eac..d4079e838a17 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTargetTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTargetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,19 +13,19 @@ public final class NotificationTargetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NotificationTarget model = BinaryData - .fromString("{\"notificationChannel\":\"EmailUser\",\"receivers\":[\"kgfg\",\"bmadgak\",\"qsrxybzqqed\"]}") + NotificationTarget model = BinaryData.fromString( + "{\"notificationChannel\":\"EmailUser\",\"receivers\":[\"mkljavb\",\"idtqajzyu\",\"pku\",\"jkrlkhbzhfepg\"]}") .toObject(NotificationTarget.class); Assertions.assertEquals(NotificationChannel.EMAIL_USER, model.notificationChannel()); - Assertions.assertEquals("kgfg", model.receivers().get(0)); + Assertions.assertEquals("mkljavb", model.receivers().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NotificationTarget model = new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_USER) - .withReceivers(Arrays.asList("kgfg", "bmadgak", "qsrxybzqqed")); + .withReceivers(Arrays.asList("mkljavb", "idtqajzyu", "pku", "jkrlkhbzhfepg")); model = BinaryData.fromObject(model).toObject(NotificationTarget.class); Assertions.assertEquals(NotificationChannel.EMAIL_USER, model.notificationChannel()); - Assertions.assertEquals("kgfg", model.receivers().get(0)); + Assertions.assertEquals("mkljavb", model.receivers().get(0)); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTests.java index c219bd239b9a..f9b14ced7071 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/NotificationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -17,31 +17,32 @@ public final class NotificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Notification model = BinaryData.fromString( - "{\"isEnabled\":true,\"notificationCategory\":\"WaveProgress\",\"notificationLevel\":\"All\",\"notificationTargets\":[{\"notificationChannel\":\"EmailSubscription\",\"receivers\":[\"ejk\",\"tynqgoul\",\"ndlik\"]}]}") + "{\"isEnabled\":false,\"notificationCategory\":\"WaveProgress\",\"notificationLevel\":\"All\",\"notificationTargets\":[{\"notificationChannel\":\"EmailSubscription\",\"receivers\":[\"nmoc\"]},{\"notificationChannel\":\"EmailSubscription\",\"receivers\":[\"shurzafbljjgpbto\"]}]}") .toObject(Notification.class); - Assertions.assertEquals(true, model.isEnabled()); + Assertions.assertFalse(model.isEnabled()); Assertions.assertEquals(NotificationCategory.WAVE_PROGRESS, model.notificationCategory()); Assertions.assertEquals(NotificationLevel.ALL, model.notificationLevel()); Assertions.assertEquals(NotificationChannel.EMAIL_SUBSCRIPTION, model.notificationTargets().get(0).notificationChannel()); - Assertions.assertEquals("ejk", model.notificationTargets().get(0).receivers().get(0)); + Assertions.assertEquals("nmoc", model.notificationTargets().get(0).receivers().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Notification model - = new Notification().withIsEnabled(true) - .withNotificationCategory(NotificationCategory.WAVE_PROGRESS) - .withNotificationLevel(NotificationLevel.ALL) - .withNotificationTargets(Arrays - .asList(new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_SUBSCRIPTION) - .withReceivers(Arrays.asList("ejk", "tynqgoul", "ndlik")))); + Notification model = new Notification().withIsEnabled(false) + .withNotificationCategory(NotificationCategory.WAVE_PROGRESS) + .withNotificationLevel(NotificationLevel.ALL) + .withNotificationTargets(Arrays.asList( + new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_SUBSCRIPTION) + .withReceivers(Arrays.asList("nmoc")), + new NotificationTarget().withNotificationChannel(NotificationChannel.EMAIL_SUBSCRIPTION) + .withReceivers(Arrays.asList("shurzafbljjgpbto")))); model = BinaryData.fromObject(model).toObject(Notification.class); - Assertions.assertEquals(true, model.isEnabled()); + Assertions.assertFalse(model.isEnabled()); Assertions.assertEquals(NotificationCategory.WAVE_PROGRESS, model.notificationCategory()); Assertions.assertEquals(NotificationLevel.ALL, model.notificationLevel()); Assertions.assertEquals(NotificationChannel.EMAIL_SUBSCRIPTION, model.notificationTargets().get(0).notificationChannel()); - Assertions.assertEquals("ejk", model.notificationTargets().get(0).receivers().get(0)); + Assertions.assertEquals("nmoc", model.notificationTargets().get(0).receivers().get(0)); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationListResultTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationListResultTests.java index 80fff680b797..24b206be3ef1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationListResultTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationListResultTests.java @@ -1,59 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; -import com.azure.resourcemanager.servicefabric.models.AvailableOperationDisplay; -import com.azure.resourcemanager.servicefabric.models.OperationListResult; -import java.util.Arrays; +import com.azure.resourcemanager.servicefabric.implementation.models.OperationListResult; import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"idtqajzyu\",\"isDataAction\":true,\"display\":{\"provider\":\"jkrlkhbzhfepg\",\"resource\":\"qex\",\"operation\":\"ocxscpaierhhbcs\",\"description\":\"ummajtjaod\"},\"origin\":\"bnbdxkqpxokajion\",\"nextLink\":\"mexgstxgcp\"},{\"name\":\"gmaajrm\",\"isDataAction\":false,\"display\":{\"provider\":\"rlovmclwhijcoej\",\"resource\":\"bzaqsqsycbkbfk\",\"operation\":\"kdkexxp\",\"description\":\"fmxa\"},\"origin\":\"fjpgddtocjjxhvp\",\"nextLink\":\"uexhdzx\"}],\"nextLink\":\"qeojnxqbzvddntw\"}") + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"ownoizhw\",\"nextLink\":\"xybqsoqij\"},{\"name\":\"dmbpazlobcufpdz\",\"isDataAction\":false,\"display\":{\"provider\":\"qqjnqgl\",\"resource\":\"gnufoooj\",\"operation\":\"ifsqesaagdfmg\",\"description\":\"lhjxr\"},\"origin\":\"kwm\",\"nextLink\":\"ktsizntocipaou\"},{\"name\":\"psqucmpoyf\",\"isDataAction\":true,\"display\":{\"provider\":\"knygjofjddeq\",\"resource\":\"deupewnwrei\",\"operation\":\"zyf\",\"description\":\"sarhmofc\"},\"origin\":\"smy\",\"nextLink\":\"kdtmlxhekuk\"}],\"nextLink\":\"txukcdmp\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("jkrlkhbzhfepg", model.value().get(0).display().provider()); - Assertions.assertEquals("qex", model.value().get(0).display().resource()); - Assertions.assertEquals("ocxscpaierhhbcs", model.value().get(0).display().operation()); - Assertions.assertEquals("ummajtjaod", model.value().get(0).display().description()); - Assertions.assertEquals("bnbdxkqpxokajion", model.value().get(0).origin()); - Assertions.assertEquals("mexgstxgcp", model.value().get(0).nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult().withValue(Arrays.asList( - new OperationResultInner().withName("idtqajzyu") - .withIsDataAction(true) - .withDisplay(new AvailableOperationDisplay().withProvider("jkrlkhbzhfepg") - .withResource("qex") - .withOperation("ocxscpaierhhbcs") - .withDescription("ummajtjaod")) - .withOrigin("bnbdxkqpxokajion") - .withNextLink("mexgstxgcp"), - new OperationResultInner().withName("gmaajrm") - .withIsDataAction(false) - .withDisplay(new AvailableOperationDisplay().withProvider("rlovmclwhijcoej") - .withResource("bzaqsqsycbkbfk") - .withOperation("kdkexxp") - .withDescription("fmxa")) - .withOrigin("fjpgddtocjjxhvp") - .withNextLink("uexhdzx"))); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("idtqajzyu", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("jkrlkhbzhfepg", model.value().get(0).display().provider()); - Assertions.assertEquals("qex", model.value().get(0).display().resource()); - Assertions.assertEquals("ocxscpaierhhbcs", model.value().get(0).display().operation()); - Assertions.assertEquals("ummajtjaod", model.value().get(0).display().description()); - Assertions.assertEquals("bnbdxkqpxokajion", model.value().get(0).origin()); - Assertions.assertEquals("mexgstxgcp", model.value().get(0).nextLink()); + Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); + Assertions.assertTrue(model.value().get(0).isDataAction()); + Assertions.assertEquals("pbsphrupidgs", model.value().get(0).display().provider()); + Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); + Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); + Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); + Assertions.assertEquals("ownoizhw", model.value().get(0).origin()); + Assertions.assertEquals("xybqsoqij", model.value().get(0).nextLink()); + Assertions.assertEquals("txukcdmp", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationResultInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationResultInnerTests.java index 0a799c878dc5..8af823bc37b1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationResultInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationResultInnerTests.java @@ -1,48 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; -import com.azure.resourcemanager.servicefabric.models.AvailableOperationDisplay; import org.junit.jupiter.api.Assertions; public final class OperationResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationResultInner model = BinaryData.fromString( - "{\"name\":\"eic\",\"isDataAction\":false,\"display\":{\"provider\":\"zao\",\"resource\":\"uhrhcffcyddgl\",\"operation\":\"t\",\"description\":\"qkwpyeicxmqc\"},\"origin\":\"q\",\"nextLink\":\"khixuigdtopbo\"}") + "{\"name\":\"cryuan\",\"isDataAction\":false,\"display\":{\"provider\":\"dxtayrlhm\",\"resource\":\"fp\",\"operation\":\"qobmtukk\",\"description\":\"yrtih\"},\"origin\":\"tijbpzvgnwzsymgl\",\"nextLink\":\"fcyzkohdbihanufh\"}") .toObject(OperationResultInner.class); - Assertions.assertEquals("eic", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("zao", model.display().provider()); - Assertions.assertEquals("uhrhcffcyddgl", model.display().resource()); - Assertions.assertEquals("t", model.display().operation()); - Assertions.assertEquals("qkwpyeicxmqc", model.display().description()); - Assertions.assertEquals("q", model.origin()); - Assertions.assertEquals("khixuigdtopbo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultInner model = new OperationResultInner().withName("eic") - .withIsDataAction(false) - .withDisplay(new AvailableOperationDisplay().withProvider("zao") - .withResource("uhrhcffcyddgl") - .withOperation("t") - .withDescription("qkwpyeicxmqc")) - .withOrigin("q") - .withNextLink("khixuigdtopbo"); - model = BinaryData.fromObject(model).toObject(OperationResultInner.class); - Assertions.assertEquals("eic", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("zao", model.display().provider()); - Assertions.assertEquals("uhrhcffcyddgl", model.display().resource()); - Assertions.assertEquals("t", model.display().operation()); - Assertions.assertEquals("qkwpyeicxmqc", model.display().description()); - Assertions.assertEquals("q", model.origin()); - Assertions.assertEquals("khixuigdtopbo", model.nextLink()); + Assertions.assertEquals("cryuan", model.name()); + Assertions.assertFalse(model.isDataAction()); + Assertions.assertEquals("dxtayrlhm", model.display().provider()); + Assertions.assertEquals("fp", model.display().resource()); + Assertions.assertEquals("qobmtukk", model.display().operation()); + Assertions.assertEquals("yrtih", model.display().description()); + Assertions.assertEquals("tijbpzvgnwzsymgl", model.origin()); + Assertions.assertEquals("fcyzkohdbihanufh", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationsListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationsListMockTests.java index d1a5fedfe705..679135dd5b68 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationsListMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.OperationResult; @@ -22,24 +22,24 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"kpnb\",\"isDataAction\":false,\"display\":{\"provider\":\"joqkagfhsxt\",\"resource\":\"ugzxnf\",\"operation\":\"zpxdt\",\"description\":\"dm\"},\"origin\":\"j\",\"nextLink\":\"wuenvr\"}]}"; + = "{\"value\":[{\"name\":\"ikdgszywkbir\",\"isDataAction\":true,\"display\":{\"provider\":\"lhkjoqrvqq\",\"resource\":\"t\",\"operation\":\"nrvgoupmfiibfgg\",\"description\":\"ool\"},\"origin\":\"wxkvtkkgll\",\"nextLink\":\"jygvjayvbl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("kpnb", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("joqkagfhsxt", response.iterator().next().display().provider()); - Assertions.assertEquals("ugzxnf", response.iterator().next().display().resource()); - Assertions.assertEquals("zpxdt", response.iterator().next().display().operation()); - Assertions.assertEquals("dm", response.iterator().next().display().description()); - Assertions.assertEquals("j", response.iterator().next().origin()); - Assertions.assertEquals("wuenvr", response.iterator().next().nextLink()); + Assertions.assertEquals("ikdgszywkbir", response.iterator().next().name()); + Assertions.assertTrue(response.iterator().next().isDataAction()); + Assertions.assertEquals("lhkjoqrvqq", response.iterator().next().display().provider()); + Assertions.assertEquals("t", response.iterator().next().display().resource()); + Assertions.assertEquals("nrvgoupmfiibfgg", response.iterator().next().display().operation()); + Assertions.assertEquals("ool", response.iterator().next().display().description()); + Assertions.assertEquals("wxkvtkkgll", response.iterator().next().origin()); + Assertions.assertEquals("jygvjayvbl", response.iterator().next().nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/PartitionSchemeDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/PartitionSchemeDescriptionTests.java index cfc909fb9711..7d6a254817e7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/PartitionSchemeDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/PartitionSchemeDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNameTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNameTests.java index d9ef5b547bbd..cb548e2b26c7 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNameTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNameTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -12,20 +12,18 @@ public final class ServerCertificateCommonNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerCertificateCommonName model = BinaryData - .fromString( - "{\"certificateCommonName\":\"zlhjxrifkwmrvkt\",\"certificateIssuerThumbprint\":\"izntocipao\"}") + .fromString("{\"certificateCommonName\":\"scmdvpjhulsuu\",\"certificateIssuerThumbprint\":\"mkjozkrwf\"}") .toObject(ServerCertificateCommonName.class); - Assertions.assertEquals("zlhjxrifkwmrvkt", model.certificateCommonName()); - Assertions.assertEquals("izntocipao", model.certificateIssuerThumbprint()); + Assertions.assertEquals("scmdvpjhulsuu", model.certificateCommonName()); + Assertions.assertEquals("mkjozkrwf", model.certificateIssuerThumbprint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServerCertificateCommonName model - = new ServerCertificateCommonName().withCertificateCommonName("zlhjxrifkwmrvkt") - .withCertificateIssuerThumbprint("izntocipao"); + ServerCertificateCommonName model = new ServerCertificateCommonName().withCertificateCommonName("scmdvpjhulsuu") + .withCertificateIssuerThumbprint("mkjozkrwf"); model = BinaryData.fromObject(model).toObject(ServerCertificateCommonName.class); - Assertions.assertEquals("zlhjxrifkwmrvkt", model.certificateCommonName()); - Assertions.assertEquals("izntocipao", model.certificateIssuerThumbprint()); + Assertions.assertEquals("scmdvpjhulsuu", model.certificateCommonName()); + Assertions.assertEquals("mkjozkrwf", model.certificateIssuerThumbprint()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNamesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNamesTests.java index 2b41e1bdc84f..7e27d6682d60 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNamesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServerCertificateCommonNamesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -15,25 +15,24 @@ public final class ServerCertificateCommonNamesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServerCertificateCommonNames model = BinaryData.fromString( - "{\"commonNames\":[{\"certificateCommonName\":\"azlobcufpdznrbt\",\"certificateIssuerThumbprint\":\"qqjnqgl\"},{\"certificateCommonName\":\"qgn\",\"certificateIssuerThumbprint\":\"foooj\"},{\"certificateCommonName\":\"wifsq\",\"certificateIssuerThumbprint\":\"saagdf\"}],\"x509StoreName\":\"AuthRoot\"}") + "{\"commonNames\":[{\"certificateCommonName\":\"deh\",\"certificateIssuerThumbprint\":\"jwyahuxinpmqnja\"},{\"certificateCommonName\":\"wixjsprozvcp\",\"certificateIssuerThumbprint\":\"tegjvwmf\"}],\"x509StoreName\":\"AddressBook\"}") .toObject(ServerCertificateCommonNames.class); - Assertions.assertEquals("azlobcufpdznrbt", model.commonNames().get(0).certificateCommonName()); - Assertions.assertEquals("qqjnqgl", model.commonNames().get(0).certificateIssuerThumbprint()); - Assertions.assertEquals(StoreName.AUTH_ROOT, model.x509StoreName()); + Assertions.assertEquals("deh", model.commonNames().get(0).certificateCommonName()); + Assertions.assertEquals("jwyahuxinpmqnja", model.commonNames().get(0).certificateIssuerThumbprint()); + Assertions.assertEquals(StoreName.ADDRESS_BOOK, model.x509StoreName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServerCertificateCommonNames model = new ServerCertificateCommonNames().withCommonNames(Arrays.asList( - new ServerCertificateCommonName().withCertificateCommonName("azlobcufpdznrbt") - .withCertificateIssuerThumbprint("qqjnqgl"), - new ServerCertificateCommonName().withCertificateCommonName("qgn").withCertificateIssuerThumbprint("foooj"), - new ServerCertificateCommonName().withCertificateCommonName("wifsq") - .withCertificateIssuerThumbprint("saagdf"))) - .withX509StoreName(StoreName.AUTH_ROOT); + new ServerCertificateCommonName().withCertificateCommonName("deh") + .withCertificateIssuerThumbprint("jwyahuxinpmqnja"), + new ServerCertificateCommonName().withCertificateCommonName("wixjsprozvcp") + .withCertificateIssuerThumbprint("tegjvwmf"))) + .withX509StoreName(StoreName.ADDRESS_BOOK); model = BinaryData.fromObject(model).toObject(ServerCertificateCommonNames.class); - Assertions.assertEquals("azlobcufpdznrbt", model.commonNames().get(0).certificateCommonName()); - Assertions.assertEquals("qqjnqgl", model.commonNames().get(0).certificateIssuerThumbprint()); - Assertions.assertEquals(StoreName.AUTH_ROOT, model.x509StoreName()); + Assertions.assertEquals("deh", model.commonNames().get(0).certificateCommonName()); + Assertions.assertEquals("jwyahuxinpmqnja", model.commonNames().get(0).certificateIssuerThumbprint()); + Assertions.assertEquals(StoreName.ADDRESS_BOOK, model.x509StoreName()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceCorrelationDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceCorrelationDescriptionTests.java index 38e66e3e834e..b40792398024 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceCorrelationDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceCorrelationDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,19 +13,19 @@ public final class ServiceCorrelationDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceCorrelationDescription model - = BinaryData.fromString("{\"scheme\":\"Invalid\",\"serviceName\":\"pofncck\"}") + = BinaryData.fromString("{\"scheme\":\"Affinity\",\"serviceName\":\"fdwoyuhh\"}") .toObject(ServiceCorrelationDescription.class); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.scheme()); - Assertions.assertEquals("pofncck", model.serviceName()); + Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.scheme()); + Assertions.assertEquals("fdwoyuhh", model.serviceName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceCorrelationDescription model - = new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("pofncck"); + = new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) + .withServiceName("fdwoyuhh"); model = BinaryData.fromObject(model).toObject(ServiceCorrelationDescription.class); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.scheme()); - Assertions.assertEquals("pofncck", model.serviceName()); + Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.scheme()); + Assertions.assertEquals("fdwoyuhh", model.serviceName()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceLoadMetricDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceLoadMetricDescriptionTests.java index 1931860fbd1b..2ef2a056b35f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceLoadMetricDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceLoadMetricDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -13,27 +13,27 @@ public final class ServiceLoadMetricDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceLoadMetricDescription model = BinaryData.fromString( - "{\"name\":\"yfzqwhxxbu\",\"weight\":\"Zero\",\"primaryDefaultLoad\":437954475,\"secondaryDefaultLoad\":776883338,\"defaultLoad\":1924816201}") + "{\"name\":\"iuiefozbhdmsm\",\"weight\":\"Low\",\"primaryDefaultLoad\":1130868680,\"secondaryDefaultLoad\":280296096,\"defaultLoad\":1411362875}") .toObject(ServiceLoadMetricDescription.class); - Assertions.assertEquals("yfzqwhxxbu", model.name()); - Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.weight()); - Assertions.assertEquals(437954475, model.primaryDefaultLoad()); - Assertions.assertEquals(776883338, model.secondaryDefaultLoad()); - Assertions.assertEquals(1924816201, model.defaultLoad()); + Assertions.assertEquals("iuiefozbhdmsm", model.name()); + Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.weight()); + Assertions.assertEquals(1130868680, model.primaryDefaultLoad()); + Assertions.assertEquals(280296096, model.secondaryDefaultLoad()); + Assertions.assertEquals(1411362875, model.defaultLoad()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceLoadMetricDescription model = new ServiceLoadMetricDescription().withName("yfzqwhxxbu") - .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(437954475) - .withSecondaryDefaultLoad(776883338) - .withDefaultLoad(1924816201); + ServiceLoadMetricDescription model = new ServiceLoadMetricDescription().withName("iuiefozbhdmsm") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(1130868680) + .withSecondaryDefaultLoad(280296096) + .withDefaultLoad(1411362875); model = BinaryData.fromObject(model).toObject(ServiceLoadMetricDescription.class); - Assertions.assertEquals("yfzqwhxxbu", model.name()); - Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.weight()); - Assertions.assertEquals(437954475, model.primaryDefaultLoad()); - Assertions.assertEquals(776883338, model.secondaryDefaultLoad()); - Assertions.assertEquals(1924816201, model.defaultLoad()); + Assertions.assertEquals("iuiefozbhdmsm", model.name()); + Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.weight()); + Assertions.assertEquals(1130868680, model.primaryDefaultLoad()); + Assertions.assertEquals(280296096, model.secondaryDefaultLoad()); + Assertions.assertEquals(1411362875, model.defaultLoad()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicePlacementPolicyDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicePlacementPolicyDescriptionTests.java index 5e4a6d46a1d4..45c9ea0f6bbb 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicePlacementPolicyDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicePlacementPolicyDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceInnerTests.java index 281b47e2880a..bab2ed87ecbd 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -24,67 +24,85 @@ public final class ServiceResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceInner model = BinaryData.fromString( - "{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"varmywdmj\",\"serviceTypeName\":\"q\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"x\",\"placementConstraints\":\"wlycoduhpkxkg\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"eqnajxqugjhkycu\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"ddg\"}],\"serviceLoadMetrics\":[{\"name\":\"fwqmzqalkrmn\",\"weight\":\"Low\",\"primaryDefaultLoad\":988494266,\"secondaryDefaultLoad\":1400063393,\"defaultLoad\":935480812}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"},\"location\":\"yxbaaabjyvayf\",\"tags\":{\"evfdnwnwm\":\"rzrtuzqogsex\"},\"etag\":\"zsyyceuzso\",\"id\":\"judpfrxt\",\"name\":\"thzvaytdwkqbrqu\",\"type\":\"paxh\"}") + "{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"qal\",\"serviceTypeName\":\"mnjijpxacqqudf\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"aaabjyvayff\",\"placementConstraints\":\"rzrtuzqogsex\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"dnw\"},{\"scheme\":\"Affinity\",\"serviceName\":\"mewzsyyc\"},{\"scheme\":\"Affinity\",\"serviceName\":\"zsoibjudpfrxtr\"},{\"scheme\":\"Invalid\",\"serviceName\":\"zvaytdwkqbr\"}],\"serviceLoadMetrics\":[{\"name\":\"paxh\",\"weight\":\"High\",\"primaryDefaultLoad\":1604306980,\"secondaryDefaultLoad\":1229152021,\"defaultLoad\":1833047663},{\"name\":\"tiirqtdqoa\",\"weight\":\"Zero\",\"primaryDefaultLoad\":849949401,\"secondaryDefaultLoad\":1556470071,\"defaultLoad\":1294640448},{\"name\":\"uyfxrxxleptramxj\",\"weight\":\"Medium\",\"primaryDefaultLoad\":800812531,\"secondaryDefaultLoad\":2125136939,\"defaultLoad\":2099315083},{\"name\":\"qlcvydy\",\"weight\":\"Low\",\"primaryDefaultLoad\":1972932814,\"secondaryDefaultLoad\":118793173,\"defaultLoad\":2084460640}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"},\"location\":\"kooebwnu\",\"tags\":{\"wj\":\"mmsbvdkcrodtjin\",\"f\":\"fltkacjv\",\"gaowpulpqblylsyx\":\"dlfoakggkfp\"},\"etag\":\"jnsjervtiagxsd\",\"id\":\"uem\",\"name\":\"sbzkf\",\"type\":\"beyvpnqicvinvkjj\"}") .toObject(ServiceResourceInner.class); - Assertions.assertEquals("wlycoduhpkxkg", model.properties().placementConstraints()); + Assertions.assertEquals("rzrtuzqogsex", model.properties().placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("eqnajxqugjhkycu", model.properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("fwqmzqalkrmn", model.properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(988494266, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1400063393, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(935480812, model.properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.properties().defaultMoveCost()); - Assertions.assertEquals("q", model.properties().serviceTypeName()); + Assertions.assertEquals("dnw", model.properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("paxh", model.properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.properties().serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1604306980, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1229152021, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1833047663, model.properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.ZERO, model.properties().defaultMoveCost()); + Assertions.assertEquals("mnjijpxacqqudf", model.properties().serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.properties().servicePackageActivationMode()); - Assertions.assertEquals("x", model.properties().serviceDnsName()); - Assertions.assertEquals("yxbaaabjyvayf", model.location()); - Assertions.assertEquals("rzrtuzqogsex", model.tags().get("evfdnwnwm")); + Assertions.assertEquals("aaabjyvayff", model.properties().serviceDnsName()); + Assertions.assertEquals("kooebwnu", model.location()); + Assertions.assertEquals("mmsbvdkcrodtjin", model.tags().get("wj")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceResourceInner model = new ServiceResourceInner() - .withProperties(new ServiceResourceProperties().withPlacementConstraints("wlycoduhpkxkg") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("eqnajxqugjhkycu"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("ddg"))) - .withServiceLoadMetrics(Arrays.asList(new ServiceLoadMetricDescription().withName("fwqmzqalkrmn") + ServiceResourceInner model = new ServiceResourceInner().withProperties(new ServiceResourceProperties() + .withPlacementConstraints("rzrtuzqogsex") + .withCorrelationScheme(Arrays.asList( + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID).withServiceName("dnw"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) + .withServiceName("mewzsyyc"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) + .withServiceName("zsoibjudpfrxtr"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("zvaytdwkqbr"))) + .withServiceLoadMetrics(Arrays.asList( + new ServiceLoadMetricDescription().withName("paxh") + .withWeight(ServiceLoadMetricWeight.HIGH) + .withPrimaryDefaultLoad(1604306980) + .withSecondaryDefaultLoad(1229152021) + .withDefaultLoad(1833047663), + new ServiceLoadMetricDescription().withName("tiirqtdqoa") + .withWeight(ServiceLoadMetricWeight.ZERO) + .withPrimaryDefaultLoad(849949401) + .withSecondaryDefaultLoad(1556470071) + .withDefaultLoad(1294640448), + new ServiceLoadMetricDescription().withName("uyfxrxxleptramxj") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(800812531) + .withSecondaryDefaultLoad(2125136939) + .withDefaultLoad(2099315083), + new ServiceLoadMetricDescription().withName("qlcvydy") .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(988494266) - .withSecondaryDefaultLoad(1400063393) - .withDefaultLoad(935480812))) - .withServicePlacementPolicies( - Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription(), - new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.MEDIUM) - .withServiceTypeName("q") - .withPartitionDescription(new PartitionSchemeDescription()) - .withServicePackageActivationMode(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS) - .withServiceDnsName("x")) - .withLocation("yxbaaabjyvayf") - .withTags(mapOf("evfdnwnwm", "rzrtuzqogsex")); + .withPrimaryDefaultLoad(1972932814) + .withSecondaryDefaultLoad(118793173) + .withDefaultLoad(2084460640))) + .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription(), + new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.ZERO) + .withServiceTypeName("mnjijpxacqqudf") + .withPartitionDescription(new PartitionSchemeDescription()) + .withServicePackageActivationMode(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS) + .withServiceDnsName("aaabjyvayff")) + .withLocation("kooebwnu") + .withTags(mapOf("wj", "mmsbvdkcrodtjin", "f", "fltkacjv", "gaowpulpqblylsyx", "dlfoakggkfp")); model = BinaryData.fromObject(model).toObject(ServiceResourceInner.class); - Assertions.assertEquals("wlycoduhpkxkg", model.properties().placementConstraints()); + Assertions.assertEquals("rzrtuzqogsex", model.properties().placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("eqnajxqugjhkycu", model.properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("fwqmzqalkrmn", model.properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(988494266, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1400063393, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(935480812, model.properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.properties().defaultMoveCost()); - Assertions.assertEquals("q", model.properties().serviceTypeName()); + Assertions.assertEquals("dnw", model.properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("paxh", model.properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.properties().serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1604306980, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1229152021, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1833047663, model.properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.ZERO, model.properties().defaultMoveCost()); + Assertions.assertEquals("mnjijpxacqqudf", model.properties().serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.properties().servicePackageActivationMode()); - Assertions.assertEquals("x", model.properties().serviceDnsName()); - Assertions.assertEquals("yxbaaabjyvayf", model.location()); - Assertions.assertEquals("rzrtuzqogsex", model.tags().get("evfdnwnwm")); + Assertions.assertEquals("aaabjyvayff", model.properties().serviceDnsName()); + Assertions.assertEquals("kooebwnu", model.location()); + Assertions.assertEquals("mmsbvdkcrodtjin", model.tags().get("wj")); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceListTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceListTests.java index 8621ea83c384..081c8d7db3bf 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceListTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceListTests.java @@ -1,153 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.servicefabric.implementation.models.ServiceResourceList; import com.azure.resourcemanager.servicefabric.models.ArmServicePackageActivationMode; import com.azure.resourcemanager.servicefabric.models.MoveCost; -import com.azure.resourcemanager.servicefabric.models.PartitionSchemeDescription; -import com.azure.resourcemanager.servicefabric.models.ServiceCorrelationDescription; import com.azure.resourcemanager.servicefabric.models.ServiceCorrelationScheme; -import com.azure.resourcemanager.servicefabric.models.ServiceLoadMetricDescription; import com.azure.resourcemanager.servicefabric.models.ServiceLoadMetricWeight; -import com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyDescription; -import com.azure.resourcemanager.servicefabric.models.ServiceResourceList; -import com.azure.resourcemanager.servicefabric.models.ServiceResourceProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ServiceResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"koowtl\",\"serviceTypeName\":\"guxawqaldsyuuxi\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"obwyznkb\",\"placementConstraints\":\"utwpfhp\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"r\"}],\"serviceLoadMetrics\":[{\"name\":\"snfdsdoakgtdl\",\"weight\":\"High\",\"primaryDefaultLoad\":1323542271,\"secondaryDefaultLoad\":1591125890,\"defaultLoad\":973934778},{\"name\":\"ewpusdsttwvogvb\",\"weight\":\"Low\",\"primaryDefaultLoad\":1690092543,\"secondaryDefaultLoad\":764265895,\"defaultLoad\":963593520},{\"name\":\"m\",\"weight\":\"Low\",\"primaryDefaultLoad\":840228808,\"secondaryDefaultLoad\":127978460,\"defaultLoad\":328261823},{\"name\":\"rwr\",\"weight\":\"Medium\",\"primaryDefaultLoad\":739471239,\"secondaryDefaultLoad\":354795976,\"defaultLoad\":130436359}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"},\"location\":\"bminrfdwoyuhhzi\",\"tags\":{\"rmaequ\":\"fozbhdmsmlmzqhof\",\"icslfaoq\":\"ah\",\"kaivwit\":\"piyylhalnswhccsp\"},\"etag\":\"cywuggwol\",\"id\":\"czbwemhairsbr\",\"name\":\"z\",\"type\":\"wmsweypqwd\"},{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"icccn\",\"serviceTypeName\":\"huexmk\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"vlz\",\"placementConstraints\":\"emhzrncsdtc\",\"correlationScheme\":[{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"ypbsfgytguslfead\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"gq\"}],\"serviceLoadMetrics\":[{\"name\":\"hejhzisx\",\"weight\":\"Low\",\"primaryDefaultLoad\":843863757,\"secondaryDefaultLoad\":196039433,\"defaultLoad\":517582343},{\"name\":\"vk\",\"weight\":\"High\",\"primaryDefaultLoad\":500405809,\"secondaryDefaultLoad\":900186733,\"defaultLoad\":653973034},{\"name\":\"aehtwd\",\"weight\":\"High\",\"primaryDefaultLoad\":1438579727,\"secondaryDefaultLoad\":767551661,\"defaultLoad\":1720208183}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"},\"location\":\"h\",\"tags\":{\"c\":\"wpracstwitykhev\",\"jc\":\"edcpnmdyodnwzxl\",\"vvwxqi\":\"nhltiugcxn\"},\"etag\":\"qunyowxwlmdjr\",\"id\":\"fgbvfvpdbo\",\"name\":\"acizsjqlhkrr\",\"type\":\"bdeibqipqk\"}],\"nextLink\":\"vxndz\"}") + "{\"value\":[{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"gzrf\",\"serviceTypeName\":\"eyebizikayuhql\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"bbqwrvtldg\",\"placementConstraints\":\"pgvmpipaslthaqfx\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"u\"},{\"scheme\":\"Affinity\",\"serviceName\":\"bdsrez\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"rhneuyowq\"}],\"serviceLoadMetrics\":[{\"name\":\"ytisibir\",\"weight\":\"Low\",\"primaryDefaultLoad\":1063300853,\"secondaryDefaultLoad\":1004253647,\"defaultLoad\":1051878092}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"},\"location\":\"lfzxiavrmbzonoki\",\"tags\":{\"irgzp\":\"q\"},\"etag\":\"lazszrn\",\"id\":\"iin\",\"name\":\"fpwpjylwbt\",\"type\":\"h\"},{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"jcdh\",\"serviceTypeName\":\"fjvfbgofeljagr\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"dvriiiojnal\",\"placementConstraints\":\"fk\",\"correlationScheme\":[{\"scheme\":\"Affinity\",\"serviceName\":\"ex\"},{\"scheme\":\"Affinity\",\"serviceName\":\"wueluqhhahhxv\"},{\"scheme\":\"Invalid\",\"serviceName\":\"mzkwpjg\"}],\"serviceLoadMetrics\":[{\"name\":\"pughftqsxh\",\"weight\":\"Medium\",\"primaryDefaultLoad\":318834407,\"secondaryDefaultLoad\":649615996,\"defaultLoad\":1485711526},{\"name\":\"xdigrjg\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1159016951,\"secondaryDefaultLoad\":1563611736,\"defaultLoad\":1621102365},{\"name\":\"tfih\",\"weight\":\"High\",\"primaryDefaultLoad\":720488968,\"secondaryDefaultLoad\":1701702807,\"defaultLoad\":867678631}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"},\"location\":\"ho\",\"tags\":{\"nwcvtbvkayhmtnv\":\"zudphqamvdkfw\",\"zcjaesgvvsccy\":\"qiatkzwpcnp\"},\"etag\":\"g\",\"id\":\"fhwygzlvdnkfxus\",\"name\":\"mdwzrmuhapfcqdps\",\"type\":\"xqv\"}],\"nextLink\":\"vuoy\"}") .toObject(ServiceResourceList.class); - Assertions.assertEquals("utwpfhp", model.value().get(0).properties().placementConstraints()); + Assertions.assertEquals("pgvmpipaslthaqfx", model.value().get(0).properties().placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.value().get(0).properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("r", model.value().get(0).properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("snfdsdoakgtdl", model.value().get(0).properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, + Assertions.assertEquals("u", model.value().get(0).properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("ytisibir", model.value().get(0).properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.value().get(0).properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1323542271, + Assertions.assertEquals(1063300853, model.value().get(0).properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1591125890, + Assertions.assertEquals(1004253647, model.value().get(0).properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(973934778, model.value().get(0).properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.value().get(0).properties().defaultMoveCost()); - Assertions.assertEquals("guxawqaldsyuuxi", model.value().get(0).properties().serviceTypeName()); + Assertions.assertEquals(1051878092, + model.value().get(0).properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.value().get(0).properties().defaultMoveCost()); + Assertions.assertEquals("eyebizikayuhql", model.value().get(0).properties().serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.SHARED_PROCESS, model.value().get(0).properties().servicePackageActivationMode()); - Assertions.assertEquals("obwyznkb", model.value().get(0).properties().serviceDnsName()); - Assertions.assertEquals("bminrfdwoyuhhzi", model.value().get(0).location()); - Assertions.assertEquals("fozbhdmsmlmzqhof", model.value().get(0).tags().get("rmaequ")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceResourceList model = new ServiceResourceList().withValue(Arrays.asList( - new ServiceResourceInner() - .withProperties(new ServiceResourceProperties().withPlacementConstraints("utwpfhp") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("r"))) - .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("snfdsdoakgtdl") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(1323542271) - .withSecondaryDefaultLoad(1591125890) - .withDefaultLoad(973934778), - new ServiceLoadMetricDescription().withName("ewpusdsttwvogvb") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(1690092543) - .withSecondaryDefaultLoad(764265895) - .withDefaultLoad(963593520), - new ServiceLoadMetricDescription().withName("m") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(840228808) - .withSecondaryDefaultLoad(127978460) - .withDefaultLoad(328261823), - new ServiceLoadMetricDescription().withName("rwr") - .withWeight(ServiceLoadMetricWeight.MEDIUM) - .withPrimaryDefaultLoad(739471239) - .withSecondaryDefaultLoad(354795976) - .withDefaultLoad(130436359))) - .withServicePlacementPolicies( - Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.MEDIUM) - .withServiceTypeName("guxawqaldsyuuxi") - .withPartitionDescription(new PartitionSchemeDescription()) - .withServicePackageActivationMode(ArmServicePackageActivationMode.SHARED_PROCESS) - .withServiceDnsName("obwyznkb")) - .withLocation("bminrfdwoyuhhzi") - .withTags(mapOf("rmaequ", "fozbhdmsmlmzqhof", "icslfaoq", "ah", "kaivwit", "piyylhalnswhccsp")), - new ServiceResourceInner() - .withProperties(new ServiceResourceProperties().withPlacementConstraints("emhzrncsdtc") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) - .withServiceName("ypbsfgytguslfead"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("gq"))) - .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("hejhzisx") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(843863757) - .withSecondaryDefaultLoad(196039433) - .withDefaultLoad(517582343), - new ServiceLoadMetricDescription().withName("vk") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(500405809) - .withSecondaryDefaultLoad(900186733) - .withDefaultLoad(653973034), - new ServiceLoadMetricDescription().withName("aehtwd") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(1438579727) - .withSecondaryDefaultLoad(767551661) - .withDefaultLoad(1720208183))) - .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.ZERO) - .withServiceTypeName("huexmk") - .withPartitionDescription(new PartitionSchemeDescription()) - .withServicePackageActivationMode(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS) - .withServiceDnsName("vlz")) - .withLocation("h") - .withTags(mapOf("c", "wpracstwitykhev", "jc", "edcpnmdyodnwzxl", "vvwxqi", "nhltiugcxn")))); - model = BinaryData.fromObject(model).toObject(ServiceResourceList.class); - Assertions.assertEquals("utwpfhp", model.value().get(0).properties().placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, - model.value().get(0).properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("r", model.value().get(0).properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("snfdsdoakgtdl", model.value().get(0).properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, - model.value().get(0).properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1323542271, - model.value().get(0).properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1591125890, - model.value().get(0).properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(973934778, model.value().get(0).properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.value().get(0).properties().defaultMoveCost()); - Assertions.assertEquals("guxawqaldsyuuxi", model.value().get(0).properties().serviceTypeName()); - Assertions.assertEquals(ArmServicePackageActivationMode.SHARED_PROCESS, - model.value().get(0).properties().servicePackageActivationMode()); - Assertions.assertEquals("obwyznkb", model.value().get(0).properties().serviceDnsName()); - Assertions.assertEquals("bminrfdwoyuhhzi", model.value().get(0).location()); - Assertions.assertEquals("fozbhdmsmlmzqhof", model.value().get(0).tags().get("rmaequ")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("bbqwrvtldg", model.value().get(0).properties().serviceDnsName()); + Assertions.assertEquals("lfzxiavrmbzonoki", model.value().get(0).location()); + Assertions.assertEquals("q", model.value().get(0).tags().get("irgzp")); + Assertions.assertEquals("vuoy", model.nextLink()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesBaseTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesBaseTests.java index 27a37901805c..4bf0b75b900d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesBaseTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesBaseTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -19,51 +19,47 @@ public final class ServiceResourcePropertiesBaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourcePropertiesBase model = BinaryData.fromString( - "{\"placementConstraints\":\"lfoakg\",\"correlationScheme\":[{\"scheme\":\"Affinity\",\"serviceName\":\"agaowpulpqblylsy\"},{\"scheme\":\"Invalid\",\"serviceName\":\"qjnsjervtia\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"sdszue\"}],\"serviceLoadMetrics\":[{\"name\":\"bzkfzbeyvpn\",\"weight\":\"High\",\"primaryDefaultLoad\":1110186498,\"secondaryDefaultLoad\":242850063,\"defaultLoad\":887231612},{\"name\":\"jxdxrbuukz\",\"weight\":\"Low\",\"primaryDefaultLoad\":553106392,\"secondaryDefaultLoad\":1827391658,\"defaultLoad\":460922562}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"}") + "{\"placementConstraints\":\"l\",\"correlationScheme\":[{\"scheme\":\"Affinity\",\"serviceName\":\"usdsttwv\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"vbbejdcng\"},{\"scheme\":\"Invalid\",\"serviceName\":\"m\"},{\"scheme\":\"Affinity\",\"serviceName\":\"kufgmj\"}],\"serviceLoadMetrics\":[{\"name\":\"rdgrtw\",\"weight\":\"Medium\",\"primaryDefaultLoad\":809360205,\"secondaryDefaultLoad\":32016010,\"defaultLoad\":1451862388}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") .toObject(ServiceResourcePropertiesBase.class); - Assertions.assertEquals("lfoakg", model.placementConstraints()); + Assertions.assertEquals("l", model.placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("agaowpulpqblylsy", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("bzkfzbeyvpn", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1110186498, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(242850063, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(887231612, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("usdsttwv", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("rdgrtw", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(809360205, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(32016010, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1451862388, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceResourcePropertiesBase model = new ServiceResourcePropertiesBase().withPlacementConstraints("lfoakg") + ServiceResourcePropertiesBase model = new ServiceResourcePropertiesBase().withPlacementConstraints("l") .withCorrelationScheme(Arrays.asList( new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("agaowpulpqblylsy"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("qjnsjervtia"), + .withServiceName("usdsttwv"), new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("sdszue"))) - .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("bzkfzbeyvpn") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(1110186498) - .withSecondaryDefaultLoad(242850063) - .withDefaultLoad(887231612), - new ServiceLoadMetricDescription().withName("jxdxrbuukz") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(553106392) - .withSecondaryDefaultLoad(1827391658) - .withDefaultLoad(460922562))) - .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.HIGH); + .withServiceName("vbbejdcng"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID).withServiceName("m"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) + .withServiceName("kufgmj"))) + .withServiceLoadMetrics(Arrays.asList(new ServiceLoadMetricDescription().withName("rdgrtw") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(809360205) + .withSecondaryDefaultLoad(32016010) + .withDefaultLoad(1451862388))) + .withServicePlacementPolicies( + Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.LOW); model = BinaryData.fromObject(model).toObject(ServiceResourcePropertiesBase.class); - Assertions.assertEquals("lfoakg", model.placementConstraints()); + Assertions.assertEquals("l", model.placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("agaowpulpqblylsy", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("bzkfzbeyvpn", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1110186498, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(242850063, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(887231612, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("usdsttwv", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("rdgrtw", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(809360205, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(32016010, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1451862388, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesTests.java index c152ebb5d869..07ce46c095f0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourcePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -21,62 +21,55 @@ public final class ServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceProperties model = BinaryData.fromString( - "{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"iilivpdtiirqtd\",\"serviceTypeName\":\"axoruzfgsquy\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"l\",\"placementConstraints\":\"tramxjez\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"wxuqlcvydypatdoo\"},{\"scheme\":\"Affinity\",\"serviceName\":\"jkniodko\"},{\"scheme\":\"Affinity\",\"serviceName\":\"bw\"}],\"serviceLoadMetrics\":[{\"name\":\"hemms\",\"weight\":\"Low\",\"primaryDefaultLoad\":145685509,\"secondaryDefaultLoad\":1224512622,\"defaultLoad\":1242300027},{\"name\":\"jinfw\",\"weight\":\"Low\",\"primaryDefaultLoad\":1139569570,\"secondaryDefaultLoad\":2134484633,\"defaultLoad\":1895840108}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") + "{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"xrbuukzclew\",\"serviceTypeName\":\"mlwpazt\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"cckwyfzqwhxxbu\",\"placementConstraints\":\"a\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"qztpp\"},{\"scheme\":\"Affinity\",\"serviceName\":\"o\"},{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"or\"}],\"serviceLoadMetrics\":[{\"name\":\"tolmncwsobqw\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1806206586,\"secondaryDefaultLoad\":358085488,\"defaultLoad\":301965904}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"}") .toObject(ServiceResourceProperties.class); - Assertions.assertEquals("tramxjez", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("wxuqlcvydypatdoo", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("hemms", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(145685509, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1224512622, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1242300027, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); - Assertions.assertEquals("axoruzfgsquy", model.serviceTypeName()); + Assertions.assertEquals("a", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("qztpp", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("tolmncwsobqw", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1806206586, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(358085488, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(301965904, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("mlwpazt", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.SHARED_PROCESS, model.servicePackageActivationMode()); - Assertions.assertEquals("l", model.serviceDnsName()); + Assertions.assertEquals("cckwyfzqwhxxbu", model.serviceDnsName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceResourceProperties model = new ServiceResourceProperties().withPlacementConstraints("tramxjez") + ServiceResourceProperties model = new ServiceResourceProperties().withPlacementConstraints("a") .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("wxuqlcvydypatdoo"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("jkniodko"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("bw"))) - .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("hemms") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(145685509) - .withSecondaryDefaultLoad(1224512622) - .withDefaultLoad(1242300027), - new ServiceLoadMetricDescription().withName("jinfw") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(1139569570) - .withSecondaryDefaultLoad(2134484633) - .withDefaultLoad(1895840108))) - .withServicePlacementPolicies( - Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.LOW) - .withServiceTypeName("axoruzfgsquy") + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("qztpp"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY).withServiceName("o"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) + .withServiceName("or"))) + .withServiceLoadMetrics(Arrays.asList(new ServiceLoadMetricDescription().withName("tolmncwsobqw") + .withWeight(ServiceLoadMetricWeight.ZERO) + .withPrimaryDefaultLoad(1806206586) + .withSecondaryDefaultLoad(358085488) + .withDefaultLoad(301965904))) + .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription(), + new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.HIGH) + .withServiceTypeName("mlwpazt") .withPartitionDescription(new PartitionSchemeDescription()) .withServicePackageActivationMode(ArmServicePackageActivationMode.SHARED_PROCESS) - .withServiceDnsName("l"); + .withServiceDnsName("cckwyfzqwhxxbu"); model = BinaryData.fromObject(model).toObject(ServiceResourceProperties.class); - Assertions.assertEquals("tramxjez", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("wxuqlcvydypatdoo", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("hemms", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(145685509, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1224512622, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1242300027, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); - Assertions.assertEquals("axoruzfgsquy", model.serviceTypeName()); + Assertions.assertEquals("a", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("qztpp", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("tolmncwsobqw", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1806206586, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(358085488, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(301965904, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("mlwpazt", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.SHARED_PROCESS, model.servicePackageActivationMode()); - Assertions.assertEquals("l", model.serviceDnsName()); + Assertions.assertEquals("cckwyfzqwhxxbu", model.serviceDnsName()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdatePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdatePropertiesTests.java index 8ffbdf5be7bb..03f01961c998 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdatePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -19,63 +19,54 @@ public final class ServiceResourceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceUpdateProperties model = BinaryData.fromString( - "{\"serviceKind\":\"ServiceResourceUpdateProperties\",\"placementConstraints\":\"ujmqlgkfbtndoa\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"jcntuj\"},{\"scheme\":\"Invalid\",\"serviceName\":\"c\"},{\"scheme\":\"Invalid\",\"serviceName\":\"df\"},{\"scheme\":\"Invalid\",\"serviceName\":\"waezkojvd\"}],\"serviceLoadMetrics\":[{\"name\":\"foqouicybx\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1685402148,\"secondaryDefaultLoad\":1273142830,\"defaultLoad\":1813944379},{\"name\":\"x\",\"weight\":\"Zero\",\"primaryDefaultLoad\":153808073,\"secondaryDefaultLoad\":1015925448,\"defaultLoad\":1109207713},{\"name\":\"mciodhkhazxkhn\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1895789611,\"secondaryDefaultLoad\":959916144,\"defaultLoad\":332286671},{\"name\":\"egokdwbwhkszzcmr\",\"weight\":\"High\",\"primaryDefaultLoad\":648975494,\"secondaryDefaultLoad\":465027307,\"defaultLoad\":1159944878}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"}") + "{\"serviceKind\":\"ServiceResourceUpdateProperties\",\"placementConstraints\":\"swibyr\",\"correlationScheme\":[{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"h\"}],\"serviceLoadMetrics\":[{\"name\":\"wpracstwitykhev\",\"weight\":\"Medium\",\"primaryDefaultLoad\":685537305,\"secondaryDefaultLoad\":1900639449,\"defaultLoad\":502101574},{\"name\":\"dyodnwzxltj\",\"weight\":\"Medium\",\"primaryDefaultLoad\":798686502,\"secondaryDefaultLoad\":823307226,\"defaultLoad\":841084025},{\"name\":\"cxnavv\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1911413053,\"secondaryDefaultLoad\":1077177476,\"defaultLoad\":1643458041}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") .toObject(ServiceResourceUpdateProperties.class); - Assertions.assertEquals("ujmqlgkfbtndoa", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("jcntuj", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("foqouicybx", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1685402148, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1273142830, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1813944379, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); + Assertions.assertEquals("swibyr", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, + model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("h", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("wpracstwitykhev", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(685537305, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1900639449, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(502101574, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceResourceUpdateProperties model = new ServiceResourceUpdateProperties() - .withPlacementConstraints("ujmqlgkfbtndoa") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("jcntuj"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID).withServiceName("c"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID).withServiceName("df"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("waezkojvd"))) + ServiceResourceUpdateProperties model = new ServiceResourceUpdateProperties().withPlacementConstraints("swibyr") + .withCorrelationScheme(Arrays + .asList(new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) + .withServiceName("h"))) .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("foqouicybx") - .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(1685402148) - .withSecondaryDefaultLoad(1273142830) - .withDefaultLoad(1813944379), - new ServiceLoadMetricDescription().withName("x") - .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(153808073) - .withSecondaryDefaultLoad(1015925448) - .withDefaultLoad(1109207713), - new ServiceLoadMetricDescription().withName("mciodhkhazxkhn") + new ServiceLoadMetricDescription().withName("wpracstwitykhev") .withWeight(ServiceLoadMetricWeight.MEDIUM) - .withPrimaryDefaultLoad(1895789611) - .withSecondaryDefaultLoad(959916144) - .withDefaultLoad(332286671), - new ServiceLoadMetricDescription().withName("egokdwbwhkszzcmr") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(648975494) - .withSecondaryDefaultLoad(465027307) - .withDefaultLoad(1159944878))) - .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription(), - new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.ZERO); + .withPrimaryDefaultLoad(685537305) + .withSecondaryDefaultLoad(1900639449) + .withDefaultLoad(502101574), + new ServiceLoadMetricDescription().withName("dyodnwzxltj") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(798686502) + .withSecondaryDefaultLoad(823307226) + .withDefaultLoad(841084025), + new ServiceLoadMetricDescription().withName("cxnavv") + .withWeight(ServiceLoadMetricWeight.ZERO) + .withPrimaryDefaultLoad(1911413053) + .withSecondaryDefaultLoad(1077177476) + .withDefaultLoad(1643458041))) + .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.LOW); model = BinaryData.fromObject(model).toObject(ServiceResourceUpdateProperties.class); - Assertions.assertEquals("ujmqlgkfbtndoa", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("jcntuj", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("foqouicybx", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1685402148, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1273142830, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1813944379, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); + Assertions.assertEquals("swibyr", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, + model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("h", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("wpracstwitykhev", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(685537305, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1900639449, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(502101574, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdateTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdateTests.java index ac86ebc63f44..f9b59807685e 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdateTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceResourceUpdateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -22,61 +22,69 @@ public final class ServiceResourceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceUpdate model = BinaryData.fromString( - "{\"properties\":{\"serviceKind\":\"ServiceResourceUpdateProperties\",\"placementConstraints\":\"priolx\",\"correlationScheme\":[{\"scheme\":\"Affinity\",\"serviceName\":\"lt\"},{\"scheme\":\"Affinity\",\"serviceName\":\"mncwsobqwcsdb\"},{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"dcfhucqdpf\"}],\"serviceLoadMetrics\":[{\"name\":\"lsbjjcanvxbv\",\"weight\":\"Low\",\"primaryDefaultLoad\":1741162391,\"secondaryDefaultLoad\":1347837415,\"defaultLoad\":1940918804},{\"name\":\"rmrlxqtvcof\",\"weight\":\"Zero\",\"primaryDefaultLoad\":573023383,\"secondaryDefaultLoad\":360831817,\"defaultLoad\":264333959}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"},\"location\":\"nqvsaznqnto\",\"tags\":{\"uwjuetaeburuvdmo\":\"sgsahmkycgr\"},\"etag\":\"mz\",\"id\":\"wabm\",\"name\":\"oefki\",\"type\":\"rvtp\"}") + "{\"properties\":{\"serviceKind\":\"ServiceResourceUpdateProperties\",\"placementConstraints\":\"iyylhalnswhccsp\",\"correlationScheme\":[{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"vwitqscyw\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"gwol\"},{\"scheme\":\"Invalid\",\"serviceName\":\"czbwemhairsbr\"}],\"serviceLoadMetrics\":[{\"name\":\"wmsweypqwd\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1600037185,\"secondaryDefaultLoad\":1774302328,\"defaultLoad\":1758343782},{\"name\":\"qhuexm\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1473747911,\"secondaryDefaultLoad\":713697907,\"defaultLoad\":1961670618},{\"name\":\"ywemhzrn\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1411475506,\"secondaryDefaultLoad\":94882707,\"defaultLoad\":1329412149}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"},\"location\":\"gytguslfead\",\"tags\":{\"xgfpelolppv\":\"qukyhejhzi\"},\"etag\":\"r\",\"id\":\"vu\",\"name\":\"zraehtwd\",\"type\":\"r\"}") .toObject(ServiceResourceUpdate.class); - Assertions.assertEquals("priolx", model.properties().placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, + Assertions.assertEquals("iyylhalnswhccsp", model.properties().placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, model.properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("lt", model.properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("lsbjjcanvxbv", model.properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1741162391, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1347837415, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1940918804, model.properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.properties().defaultMoveCost()); - Assertions.assertEquals("nqvsaznqnto", model.location()); - Assertions.assertEquals("sgsahmkycgr", model.tags().get("uwjuetaeburuvdmo")); + Assertions.assertEquals("vwitqscyw", model.properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("wmsweypqwd", model.properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, + model.properties().serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1600037185, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1774302328, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1758343782, model.properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.properties().defaultMoveCost()); + Assertions.assertEquals("gytguslfead", model.location()); + Assertions.assertEquals("qukyhejhzi", model.tags().get("xgfpelolppv")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceResourceUpdate model = new ServiceResourceUpdate().withProperties(new ServiceResourceUpdateProperties() - .withPlacementConstraints("priolx") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY).withServiceName("lt"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("mncwsobqwcsdb"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) - .withServiceName("dcfhucqdpf"))) - .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("lsbjjcanvxbv") - .withWeight(ServiceLoadMetricWeight.LOW) - .withPrimaryDefaultLoad(1741162391) - .withSecondaryDefaultLoad(1347837415) - .withDefaultLoad(1940918804), - new ServiceLoadMetricDescription().withName("rmrlxqtvcof") - .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(573023383) - .withSecondaryDefaultLoad(360831817) - .withDefaultLoad(264333959))) - .withServicePlacementPolicies( - Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.MEDIUM)) - .withLocation("nqvsaznqnto") - .withTags(mapOf("uwjuetaeburuvdmo", "sgsahmkycgr")); + ServiceResourceUpdate model = new ServiceResourceUpdate() + .withProperties(new ServiceResourceUpdateProperties().withPlacementConstraints("iyylhalnswhccsp") + .withCorrelationScheme(Arrays.asList( + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) + .withServiceName("vwitqscyw"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) + .withServiceName("gwol"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("czbwemhairsbr"))) + .withServiceLoadMetrics(Arrays.asList( + new ServiceLoadMetricDescription().withName("wmsweypqwd") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(1600037185) + .withSecondaryDefaultLoad(1774302328) + .withDefaultLoad(1758343782), + new ServiceLoadMetricDescription().withName("qhuexm") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(1473747911) + .withSecondaryDefaultLoad(713697907) + .withDefaultLoad(1961670618), + new ServiceLoadMetricDescription().withName("ywemhzrn") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(1411475506) + .withSecondaryDefaultLoad(94882707) + .withDefaultLoad(1329412149))) + .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription(), + new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.HIGH)) + .withLocation("gytguslfead") + .withTags(mapOf("xgfpelolppv", "qukyhejhzi")); model = BinaryData.fromObject(model).toObject(ServiceResourceUpdate.class); - Assertions.assertEquals("priolx", model.properties().placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, + Assertions.assertEquals("iyylhalnswhccsp", model.properties().placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, model.properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("lt", model.properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("lsbjjcanvxbv", model.properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1741162391, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1347837415, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1940918804, model.properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.properties().defaultMoveCost()); - Assertions.assertEquals("nqvsaznqnto", model.location()); - Assertions.assertEquals("sgsahmkycgr", model.tags().get("uwjuetaeburuvdmo")); + Assertions.assertEquals("vwitqscyw", model.properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("wmsweypqwd", model.properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, + model.properties().serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1600037185, model.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1774302328, model.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1758343782, model.properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.properties().defaultMoveCost()); + Assertions.assertEquals("gytguslfead", model.location()); + Assertions.assertEquals("qukyhejhzi", model.tags().get("xgfpelolppv")); } // Use "Map.of" if available diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeDeltaHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeDeltaHealthPolicyTests.java index 963999f7d319..ebaa28fcc488 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeDeltaHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeDeltaHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,16 +11,16 @@ public final class ServiceTypeDeltaHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceTypeDeltaHealthPolicy model = BinaryData.fromString("{\"maxPercentDeltaUnhealthyServices\":1475325470}") + ServiceTypeDeltaHealthPolicy model = BinaryData.fromString("{\"maxPercentDeltaUnhealthyServices\":1016211190}") .toObject(ServiceTypeDeltaHealthPolicy.class); - Assertions.assertEquals(1475325470, model.maxPercentDeltaUnhealthyServices()); + Assertions.assertEquals(1016211190, model.maxPercentDeltaUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceTypeDeltaHealthPolicy model - = new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1475325470); + = new ServiceTypeDeltaHealthPolicy().withMaxPercentDeltaUnhealthyServices(1016211190); model = BinaryData.fromObject(model).toObject(ServiceTypeDeltaHealthPolicy.class); - Assertions.assertEquals(1475325470, model.maxPercentDeltaUnhealthyServices()); + Assertions.assertEquals(1016211190, model.maxPercentDeltaUnhealthyServices()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeHealthPolicyTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeHealthPolicyTests.java index a1ad5d9eb495..39e3bbee7567 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeHealthPolicyTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServiceTypeHealthPolicyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,15 +11,15 @@ public final class ServiceTypeHealthPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceTypeHealthPolicy model = BinaryData.fromString("{\"maxPercentUnhealthyServices\":1218196264}") + ServiceTypeHealthPolicy model = BinaryData.fromString("{\"maxPercentUnhealthyServices\":537623059}") .toObject(ServiceTypeHealthPolicy.class); - Assertions.assertEquals(1218196264, model.maxPercentUnhealthyServices()); + Assertions.assertEquals(537623059, model.maxPercentUnhealthyServices()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceTypeHealthPolicy model = new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(1218196264); + ServiceTypeHealthPolicy model = new ServiceTypeHealthPolicy().withMaxPercentUnhealthyServices(537623059); model = BinaryData.fromObject(model).toObject(ServiceTypeHealthPolicy.class); - Assertions.assertEquals(1218196264, model.maxPercentUnhealthyServices()); + Assertions.assertEquals(537623059, model.maxPercentUnhealthyServices()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetWithResponseMockTests.java index ae83707312df..5b814a306b9a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetWithResponseMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ArmServicePackageActivationMode; @@ -25,35 +25,36 @@ public final class ServicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"rqzz\",\"serviceTypeName\":\"jvpglydzgk\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"vtoepryutnw\",\"placementConstraints\":\"pzdm\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"fvaawzqa\"},{\"scheme\":\"Invalid\",\"serviceName\":\"lgzurig\"}],\"serviceLoadMetrics\":[{\"name\":\"cx\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1221508981,\"secondaryDefaultLoad\":1691117977,\"defaultLoad\":675680646}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"},\"location\":\"mldgxobfirc\",\"tags\":{\"khyawfvjlboxqv\":\"kciayzri\"},\"etag\":\"lmxhomdyn\",\"id\":\"wdigumbnraauz\",\"name\":\"p\",\"type\":\"jazysdzhezwwvaiq\"}"; + = "{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"mrqzzrrjvpgl\",\"serviceTypeName\":\"zgkrvqe\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"SharedProcess\",\"serviceDnsName\":\"pryu\",\"placementConstraints\":\"wytpzdmovz\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"awzqadfl\"}],\"serviceLoadMetrics\":[{\"name\":\"riglaec\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1609928566,\"secondaryDefaultLoad\":1510056241,\"defaultLoad\":687349800}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"},\"location\":\"t\",\"tags\":{\"ciayzriykhya\":\"gxobfirclnp\",\"omdynhdwdigum\":\"fvjlboxqvkjlmx\",\"tj\":\"nraauzz\"},\"etag\":\"ysdzhez\",\"id\":\"vaiqyuvvf\",\"name\":\"nk\",\"type\":\"hhqyi\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceResource response = manager.services() - .getWithResponse("apeewchpxlkt", "kuziycsle", "ufuztcktyhjtq", "dcgzul", com.azure.core.util.Context.NONE) + .getWithResponse("ilozapeewchpxlk", "wk", "ziycslevufuztck", "yhjtqedcgzu", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("pzdm", response.properties().placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, + Assertions.assertEquals("wytpzdmovz", response.properties().placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, response.properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("fvaawzqa", response.properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("cx", response.properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, + Assertions.assertEquals("awzqadfl", response.properties().correlationScheme().get(0).serviceName()); + Assertions.assertEquals("riglaec", response.properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, response.properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1221508981, response.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1691117977, response.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(675680646, response.properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.LOW, response.properties().defaultMoveCost()); - Assertions.assertEquals("jvpglydzgk", response.properties().serviceTypeName()); + Assertions.assertEquals(1609928566, response.properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1510056241, response.properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(687349800, response.properties().serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.MEDIUM, response.properties().defaultMoveCost()); + Assertions.assertEquals("zgkrvqe", response.properties().serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.SHARED_PROCESS, response.properties().servicePackageActivationMode()); - Assertions.assertEquals("vtoepryutnw", response.properties().serviceDnsName()); - Assertions.assertEquals("mldgxobfirc", response.location()); - Assertions.assertEquals("kciayzri", response.tags().get("khyawfvjlboxqv")); + Assertions.assertEquals("pryu", response.properties().serviceDnsName()); + Assertions.assertEquals("t", response.location()); + Assertions.assertEquals("gxobfirclnp", response.tags().get("ciayzriykhya")); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesListMockTests.java index 5dd9b12285c3..66413e47350a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesListMockTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/ServicesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicefabric.ServiceFabricManager; import com.azure.resourcemanager.servicefabric.models.ArmServicePackageActivationMode; @@ -26,38 +26,38 @@ public final class ServicesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"uwmncs\",\"serviceTypeName\":\"ijf\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"ekrsgs\",\"placementConstraints\":\"dhuzqgnjdgk\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"liqhzvhx\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"omtkub\"}],\"serviceLoadMetrics\":[{\"name\":\"pnvdxz\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1207165403,\"secondaryDefaultLoad\":670431250,\"defaultLoad\":589968603},{\"name\":\"evqagtl\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1706986082,\"secondaryDefaultLoad\":1272275597,\"defaultLoad\":2094473580}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"},\"location\":\"trdcnifmzzs\",\"tags\":{\"suxmpraf\":\"brn\"},\"etag\":\"ckh\",\"id\":\"xvd\",\"name\":\"ffwafq\",\"type\":\"oudaspavehhrvk\"}]}"; + = "{\"value\":[{\"properties\":{\"serviceKind\":\"ServiceResourceProperties\",\"provisioningState\":\"jfybvpoekrsgsgb\",\"serviceTypeName\":\"uzqgnjdgkynsc\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"vhxnk\",\"placementConstraints\":\"tkubotppn\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"xhihfrbbcevqagtl\"}],\"serviceLoadMetrics\":[{\"name\":\"lfkqojpy\",\"weight\":\"Zero\",\"primaryDefaultLoad\":904889038,\"secondaryDefaultLoad\":1334213198,\"defaultLoad\":1625047918},{\"name\":\"fmzzsdymbrny\",\"weight\":\"Low\",\"primaryDefaultLoad\":718092493,\"secondaryDefaultLoad\":214541271,\"defaultLoad\":1016215887},{\"name\":\"g\",\"weight\":\"High\",\"primaryDefaultLoad\":2089880576,\"secondaryDefaultLoad\":1062558115,\"defaultLoad\":1919982879}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"},\"location\":\"qrouda\",\"tags\":{\"hcxgkmoyx\":\"vehhrvkbunzozu\",\"mfdn\":\"dyuib\",\"jnaeois\":\"zydvfvf\",\"vwmzhwplefaxvxil\":\"vhmgorffukis\"},\"etag\":\"tg\",\"id\":\"nzeyqxtjj\",\"name\":\"zqlqhyc\",\"type\":\"vodggxdbee\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ServiceFabricManager manager = ServiceFabricManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.services().list("uvvfonkp", "hqyikvy", "auy", com.azure.core.util.Context.NONE); + = manager.services().list("vyl", "uyav", "uwmncs", com.azure.core.util.Context.NONE); - Assertions.assertEquals("dhuzqgnjdgk", response.iterator().next().properties().placementConstraints()); + Assertions.assertEquals("tkubotppn", response.iterator().next().properties().placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.INVALID, response.iterator().next().properties().correlationScheme().get(0).scheme()); - Assertions.assertEquals("liqhzvhx", + Assertions.assertEquals("xhihfrbbcevqagtl", response.iterator().next().properties().correlationScheme().get(0).serviceName()); - Assertions.assertEquals("pnvdxz", response.iterator().next().properties().serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, + Assertions.assertEquals("lfkqojpy", response.iterator().next().properties().serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.ZERO, response.iterator().next().properties().serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1207165403, + Assertions.assertEquals(904889038, response.iterator().next().properties().serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(670431250, + Assertions.assertEquals(1334213198, response.iterator().next().properties().serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(589968603, + Assertions.assertEquals(1625047918, response.iterator().next().properties().serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.HIGH, response.iterator().next().properties().defaultMoveCost()); - Assertions.assertEquals("ijf", response.iterator().next().properties().serviceTypeName()); + Assertions.assertEquals(MoveCost.ZERO, response.iterator().next().properties().defaultMoveCost()); + Assertions.assertEquals("uzqgnjdgkynsc", response.iterator().next().properties().serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, response.iterator().next().properties().servicePackageActivationMode()); - Assertions.assertEquals("ekrsgs", response.iterator().next().properties().serviceDnsName()); - Assertions.assertEquals("trdcnifmzzs", response.iterator().next().location()); - Assertions.assertEquals("brn", response.iterator().next().tags().get("suxmpraf")); + Assertions.assertEquals("vhxnk", response.iterator().next().properties().serviceDnsName()); + Assertions.assertEquals("qrouda", response.iterator().next().location()); + Assertions.assertEquals("vehhrvkbunzozu", response.iterator().next().tags().get("hcxgkmoyx")); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsParameterDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsParameterDescriptionTests.java index a3e7ee761567..71b302d8eb37 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsParameterDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsParameterDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,18 +11,19 @@ public final class SettingsParameterDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SettingsParameterDescription model = BinaryData.fromString("{\"name\":\"xzdxtayrlhmwh\",\"value\":\"pmrqobm\"}") - .toObject(SettingsParameterDescription.class); - Assertions.assertEquals("xzdxtayrlhmwh", model.name()); - Assertions.assertEquals("pmrqobm", model.value()); + SettingsParameterDescription model + = BinaryData.fromString("{\"name\":\"lxofpdvhpfxxypin\",\"value\":\"nmayhuybb\"}") + .toObject(SettingsParameterDescription.class); + Assertions.assertEquals("lxofpdvhpfxxypin", model.name()); + Assertions.assertEquals("nmayhuybb", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SettingsParameterDescription model - = new SettingsParameterDescription().withName("xzdxtayrlhmwh").withValue("pmrqobm"); + = new SettingsParameterDescription().withName("lxofpdvhpfxxypin").withValue("nmayhuybb"); model = BinaryData.fromObject(model).toObject(SettingsParameterDescription.class); - Assertions.assertEquals("xzdxtayrlhmwh", model.name()); - Assertions.assertEquals("pmrqobm", model.value()); + Assertions.assertEquals("lxofpdvhpfxxypin", model.name()); + Assertions.assertEquals("nmayhuybb", model.value()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsSectionDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsSectionDescriptionTests.java index ee13c5746be8..0f2542a02d8d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsSectionDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SettingsSectionDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -14,22 +14,24 @@ public final class SettingsSectionDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SettingsSectionDescription model = BinaryData.fromString( - "{\"name\":\"jzyflu\",\"parameters\":[{\"name\":\"rh\",\"value\":\"ofcqhsm\"},{\"name\":\"urkdtmlx\",\"value\":\"ekuksjtx\"},{\"name\":\"kc\",\"value\":\"mparcryuanzw\"}]}") + "{\"name\":\"fdosyg\",\"parameters\":[{\"name\":\"paojakhmsbzjh\",\"value\":\"rzevdphlxaol\"},{\"name\":\"hqtrgqjbpf\",\"value\":\"fsinzgvfcjrwzoxx\"},{\"name\":\"tfell\",\"value\":\"wfzitonpeqfpjk\"}]}") .toObject(SettingsSectionDescription.class); - Assertions.assertEquals("jzyflu", model.name()); - Assertions.assertEquals("rh", model.parameters().get(0).name()); - Assertions.assertEquals("ofcqhsm", model.parameters().get(0).value()); + Assertions.assertEquals("fdosyg", model.name()); + Assertions.assertEquals("paojakhmsbzjh", model.parameters().get(0).name()); + Assertions.assertEquals("rzevdphlxaol", model.parameters().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SettingsSectionDescription model = new SettingsSectionDescription().withName("jzyflu") - .withParameters(Arrays.asList(new SettingsParameterDescription().withName("rh").withValue("ofcqhsm"), - new SettingsParameterDescription().withName("urkdtmlx").withValue("ekuksjtx"), - new SettingsParameterDescription().withName("kc").withValue("mparcryuanzw"))); + SettingsSectionDescription model + = new SettingsSectionDescription().withName("fdosyg") + .withParameters(Arrays.asList( + new SettingsParameterDescription().withName("paojakhmsbzjh").withValue("rzevdphlxaol"), + new SettingsParameterDescription().withName("hqtrgqjbpf").withValue("fsinzgvfcjrwzoxx"), + new SettingsParameterDescription().withName("tfell").withValue("wfzitonpeqfpjk"))); model = BinaryData.fromObject(model).toObject(SettingsSectionDescription.class); - Assertions.assertEquals("jzyflu", model.name()); - Assertions.assertEquals("rh", model.parameters().get(0).name()); - Assertions.assertEquals("ofcqhsm", model.parameters().get(0).value()); + Assertions.assertEquals("fdosyg", model.name()); + Assertions.assertEquals("paojakhmsbzjh", model.parameters().get(0).name()); + Assertions.assertEquals("rzevdphlxaol", model.parameters().get(0).value()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SingletonPartitionSchemeDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SingletonPartitionSchemeDescriptionTests.java index 0442826727e3..ae0120e29fca 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SingletonPartitionSchemeDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/SingletonPartitionSchemeDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServicePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServicePropertiesTests.java index a939feed0dc6..d31b93137b29 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServicePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServicePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -22,84 +22,85 @@ public final class StatefulServicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StatefulServiceProperties model = BinaryData.fromString( - "{\"serviceKind\":\"Stateful\",\"hasPersistedState\":true,\"targetReplicaSetSize\":1117462910,\"minReplicaSetSize\":394204922,\"replicaRestartWaitDuration\":\"2021-08-30T01:40:48Z\",\"quorumLossWaitDuration\":\"2021-03-14T13:52:20Z\",\"standByReplicaKeepDuration\":\"2021-09-22T23:43:14Z\",\"provisioningState\":\"ystawfsdjpvkvp\",\"serviceTypeName\":\"xbkzbzkdvncj\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"r\",\"placementConstraints\":\"akmokzhjjklf\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"uwqlgzrfzeey\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"izikayuhq\"},{\"scheme\":\"Affinity\",\"serviceName\":\"jbsybbqw\"},{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"t\"}],\"serviceLoadMetrics\":[{\"name\":\"mfpgv\",\"weight\":\"High\",\"primaryDefaultLoad\":299337354,\"secondaryDefaultLoad\":1000390440,\"defaultLoad\":753407395},{\"name\":\"aqfxss\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1174161651,\"secondaryDefaultLoad\":1781178234,\"defaultLoad\":1417218644}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"}") + "{\"serviceKind\":\"Stateful\",\"hasPersistedState\":true,\"targetReplicaSetSize\":1117894218,\"minReplicaSetSize\":1621122974,\"replicaRestartWaitDuration\":\"2021-09-05T13:34:39Z\",\"quorumLossWaitDuration\":\"2021-09-06T08:21:41Z\",\"standByReplicaKeepDuration\":\"2021-05-13T14:00:03Z\",\"provisioningState\":\"nvxbvt\",\"serviceTypeName\":\"dut\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"r\",\"placementConstraints\":\"qtvcofudflvkgj\",\"correlationScheme\":[{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"knnqvsaznq\"},{\"scheme\":\"Invalid\",\"serviceName\":\"orudsgsa\"}],\"serviceLoadMetrics\":[{\"name\":\"yc\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1064161892,\"secondaryDefaultLoad\":1286362135,\"defaultLoad\":515836708},{\"name\":\"aeburuvdmo\",\"weight\":\"Zero\",\"primaryDefaultLoad\":28452682,\"secondaryDefaultLoad\":866846651,\"defaultLoad\":45388045},{\"name\":\"mqoefkifrvtpuqu\",\"weight\":\"Low\",\"primaryDefaultLoad\":829159187,\"secondaryDefaultLoad\":288305104,\"defaultLoad\":604272323}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") .toObject(StatefulServiceProperties.class); - Assertions.assertEquals("akmokzhjjklf", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("uwqlgzrfzeey", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("mfpgv", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(299337354, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1000390440, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(753407395, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.defaultMoveCost()); - Assertions.assertEquals("xbkzbzkdvncj", model.serviceTypeName()); + Assertions.assertEquals("qtvcofudflvkgj", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("knnqvsaznq", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("yc", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1064161892, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1286362135, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(515836708, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); + Assertions.assertEquals("dut", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.servicePackageActivationMode()); Assertions.assertEquals("r", model.serviceDnsName()); - Assertions.assertEquals(true, model.hasPersistedState()); - Assertions.assertEquals(1117462910, model.targetReplicaSetSize()); - Assertions.assertEquals(394204922, model.minReplicaSetSize()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T01:40:48Z"), model.replicaRestartWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T13:52:20Z"), model.quorumLossWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T23:43:14Z"), model.standByReplicaKeepDuration()); + Assertions.assertTrue(model.hasPersistedState()); + Assertions.assertEquals(1117894218, model.targetReplicaSetSize()); + Assertions.assertEquals(1621122974, model.minReplicaSetSize()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T13:34:39Z"), model.replicaRestartWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T08:21:41Z"), model.quorumLossWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T14:00:03Z"), model.standByReplicaKeepDuration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StatefulServiceProperties model = new StatefulServiceProperties().withPlacementConstraints("akmokzhjjklf") + StatefulServiceProperties model = new StatefulServiceProperties().withPlacementConstraints("qtvcofudflvkgj") .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("uwqlgzrfzeey"), new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) - .withServiceName("izikayuhq"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("jbsybbqw"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) - .withServiceName("t"))) + .withServiceName("knnqvsaznq"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("orudsgsa"))) .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("mfpgv") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(299337354) - .withSecondaryDefaultLoad(1000390440) - .withDefaultLoad(753407395), - new ServiceLoadMetricDescription().withName("aqfxss") + new ServiceLoadMetricDescription().withName("yc") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(1064161892) + .withSecondaryDefaultLoad(1286362135) + .withDefaultLoad(515836708), + new ServiceLoadMetricDescription().withName("aeburuvdmo") .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(1174161651) - .withSecondaryDefaultLoad(1781178234) - .withDefaultLoad(1417218644))) + .withPrimaryDefaultLoad(28452682) + .withSecondaryDefaultLoad(866846651) + .withDefaultLoad(45388045), + new ServiceLoadMetricDescription().withName("mqoefkifrvtpuqu") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(829159187) + .withSecondaryDefaultLoad(288305104) + .withDefaultLoad(604272323))) .withServicePlacementPolicies( Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.MEDIUM) - .withServiceTypeName("xbkzbzkdvncj") + .withDefaultMoveCost(MoveCost.LOW) + .withServiceTypeName("dut") .withPartitionDescription(new PartitionSchemeDescription()) .withServicePackageActivationMode(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS) .withServiceDnsName("r") .withHasPersistedState(true) - .withTargetReplicaSetSize(1117462910) - .withMinReplicaSetSize(394204922) - .withReplicaRestartWaitDuration(OffsetDateTime.parse("2021-08-30T01:40:48Z")) - .withQuorumLossWaitDuration(OffsetDateTime.parse("2021-03-14T13:52:20Z")) - .withStandByReplicaKeepDuration(OffsetDateTime.parse("2021-09-22T23:43:14Z")); + .withTargetReplicaSetSize(1117894218) + .withMinReplicaSetSize(1621122974) + .withReplicaRestartWaitDuration(OffsetDateTime.parse("2021-09-05T13:34:39Z")) + .withQuorumLossWaitDuration(OffsetDateTime.parse("2021-09-06T08:21:41Z")) + .withStandByReplicaKeepDuration(OffsetDateTime.parse("2021-05-13T14:00:03Z")); model = BinaryData.fromObject(model).toObject(StatefulServiceProperties.class); - Assertions.assertEquals("akmokzhjjklf", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("uwqlgzrfzeey", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("mfpgv", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(299337354, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(1000390440, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(753407395, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.MEDIUM, model.defaultMoveCost()); - Assertions.assertEquals("xbkzbzkdvncj", model.serviceTypeName()); + Assertions.assertEquals("qtvcofudflvkgj", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.ALIGNED_AFFINITY, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("knnqvsaznq", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("yc", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1064161892, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(1286362135, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(515836708, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); + Assertions.assertEquals("dut", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.servicePackageActivationMode()); Assertions.assertEquals("r", model.serviceDnsName()); - Assertions.assertEquals(true, model.hasPersistedState()); - Assertions.assertEquals(1117462910, model.targetReplicaSetSize()); - Assertions.assertEquals(394204922, model.minReplicaSetSize()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-30T01:40:48Z"), model.replicaRestartWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T13:52:20Z"), model.quorumLossWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T23:43:14Z"), model.standByReplicaKeepDuration()); + Assertions.assertTrue(model.hasPersistedState()); + Assertions.assertEquals(1117894218, model.targetReplicaSetSize()); + Assertions.assertEquals(1621122974, model.minReplicaSetSize()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T13:34:39Z"), model.replicaRestartWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-06T08:21:41Z"), model.quorumLossWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T14:00:03Z"), model.standByReplicaKeepDuration()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServiceUpdatePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServiceUpdatePropertiesTests.java index f1e41f55023c..2d69271a83b0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServiceUpdatePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatefulServiceUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -20,63 +20,71 @@ public final class StatefulServiceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StatefulServiceUpdateProperties model = BinaryData.fromString( - "{\"serviceKind\":\"Stateful\",\"targetReplicaSetSize\":481709550,\"minReplicaSetSize\":1948740846,\"replicaRestartWaitDuration\":\"2021-09-27T12:02:20Z\",\"quorumLossWaitDuration\":\"2021-10-12T10:01:16Z\",\"standByReplicaKeepDuration\":\"2020-12-23T03:39:10Z\",\"placementConstraints\":\"wyt\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"ircgpikpz\"}],\"serviceLoadMetrics\":[{\"name\":\"j\",\"weight\":\"Medium\",\"primaryDefaultLoad\":108512766,\"secondaryDefaultLoad\":453149058,\"defaultLoad\":386879497},{\"name\":\"vrmbzono\",\"weight\":\"High\",\"primaryDefaultLoad\":485732763,\"secondaryDefaultLoad\":1432241544,\"defaultLoad\":749799353}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"}") + "{\"serviceKind\":\"Stateful\",\"targetReplicaSetSize\":1905526604,\"minReplicaSetSize\":1093949584,\"replicaRestartWaitDuration\":\"2021-02-11T03:05:15Z\",\"quorumLossWaitDuration\":\"2021-07-04T05:46:22Z\",\"standByReplicaKeepDuration\":\"2021-03-04T04:22:45Z\",\"placementConstraints\":\"vfvpdbodaciz\",\"correlationScheme\":[{\"scheme\":\"NonAlignedAffinity\",\"serviceName\":\"hkr\"}],\"serviceLoadMetrics\":[{\"name\":\"deibqip\",\"weight\":\"High\",\"primaryDefaultLoad\":1234217414,\"secondaryDefaultLoad\":370586550,\"defaultLoad\":939289474},{\"name\":\"wm\",\"weight\":\"Low\",\"primaryDefaultLoad\":1155749150,\"secondaryDefaultLoad\":754811246,\"defaultLoad\":1983061775},{\"name\":\"rwkq\",\"weight\":\"Low\",\"primaryDefaultLoad\":234711061,\"secondaryDefaultLoad\":132694968,\"defaultLoad\":809935790}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") .toObject(StatefulServiceUpdateProperties.class); - Assertions.assertEquals("wyt", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("ircgpikpz", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("j", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(108512766, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(453149058, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(386879497, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); - Assertions.assertEquals(481709550, model.targetReplicaSetSize()); - Assertions.assertEquals(1948740846, model.minReplicaSetSize()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T12:02:20Z"), model.replicaRestartWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T10:01:16Z"), model.quorumLossWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T03:39:10Z"), model.standByReplicaKeepDuration()); + Assertions.assertEquals("vfvpdbodaciz", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, + model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("hkr", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("deibqip", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1234217414, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(370586550, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(939289474, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); + Assertions.assertEquals(1905526604, model.targetReplicaSetSize()); + Assertions.assertEquals(1093949584, model.minReplicaSetSize()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T03:05:15Z"), model.replicaRestartWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T05:46:22Z"), model.quorumLossWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T04:22:45Z"), model.standByReplicaKeepDuration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StatefulServiceUpdateProperties model = new StatefulServiceUpdateProperties().withPlacementConstraints("wyt") - .withCorrelationScheme( - Arrays.asList(new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("ircgpikpz"))) + StatefulServiceUpdateProperties model = new StatefulServiceUpdateProperties() + .withPlacementConstraints("vfvpdbodaciz") + .withCorrelationScheme(Arrays + .asList(new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY) + .withServiceName("hkr"))) .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("j") - .withWeight(ServiceLoadMetricWeight.MEDIUM) - .withPrimaryDefaultLoad(108512766) - .withSecondaryDefaultLoad(453149058) - .withDefaultLoad(386879497), - new ServiceLoadMetricDescription().withName("vrmbzono") + new ServiceLoadMetricDescription().withName("deibqip") .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(485732763) - .withSecondaryDefaultLoad(1432241544) - .withDefaultLoad(749799353))) + .withPrimaryDefaultLoad(1234217414) + .withSecondaryDefaultLoad(370586550) + .withDefaultLoad(939289474), + new ServiceLoadMetricDescription().withName("wm") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(1155749150) + .withSecondaryDefaultLoad(754811246) + .withDefaultLoad(1983061775), + new ServiceLoadMetricDescription().withName("rwkq") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(234711061) + .withSecondaryDefaultLoad(132694968) + .withDefaultLoad(809935790))) .withServicePlacementPolicies( Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.ZERO) - .withTargetReplicaSetSize(481709550) - .withMinReplicaSetSize(1948740846) - .withReplicaRestartWaitDuration(OffsetDateTime.parse("2021-09-27T12:02:20Z")) - .withQuorumLossWaitDuration(OffsetDateTime.parse("2021-10-12T10:01:16Z")) - .withStandByReplicaKeepDuration(OffsetDateTime.parse("2020-12-23T03:39:10Z")); + .withDefaultMoveCost(MoveCost.LOW) + .withTargetReplicaSetSize(1905526604) + .withMinReplicaSetSize(1093949584) + .withReplicaRestartWaitDuration(OffsetDateTime.parse("2021-02-11T03:05:15Z")) + .withQuorumLossWaitDuration(OffsetDateTime.parse("2021-07-04T05:46:22Z")) + .withStandByReplicaKeepDuration(OffsetDateTime.parse("2021-03-04T04:22:45Z")); model = BinaryData.fromObject(model).toObject(StatefulServiceUpdateProperties.class); - Assertions.assertEquals("wyt", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("ircgpikpz", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("j", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(108512766, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(453149058, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(386879497, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); - Assertions.assertEquals(481709550, model.targetReplicaSetSize()); - Assertions.assertEquals(1948740846, model.minReplicaSetSize()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T12:02:20Z"), model.replicaRestartWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T10:01:16Z"), model.quorumLossWaitDuration()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T03:39:10Z"), model.standByReplicaKeepDuration()); + Assertions.assertEquals("vfvpdbodaciz", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.NON_ALIGNED_AFFINITY, + model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("hkr", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("deibqip", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1234217414, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(370586550, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(939289474, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); + Assertions.assertEquals(1905526604, model.targetReplicaSetSize()); + Assertions.assertEquals(1093949584, model.minReplicaSetSize()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T03:05:15Z"), model.replicaRestartWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T05:46:22Z"), model.quorumLossWaitDuration()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T04:22:45Z"), model.standByReplicaKeepDuration()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServicePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServicePropertiesTests.java index 627107570a37..29eb766fef61 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServicePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServicePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -21,73 +21,84 @@ public final class StatelessServicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StatelessServiceProperties model = BinaryData.fromString( - "{\"serviceKind\":\"Stateless\",\"instanceCount\":1656770527,\"instanceCloseDelayDuration\":\"zszrnwoiindfpw\",\"provisioningState\":\"ylwbtlhflsjcdhsz\",\"serviceTypeName\":\"vfbgofeljagrqmqh\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"iiojnal\",\"placementConstraints\":\"fk\",\"correlationScheme\":[{\"scheme\":\"Affinity\",\"serviceName\":\"ex\"},{\"scheme\":\"Affinity\",\"serviceName\":\"wueluqhhahhxv\"},{\"scheme\":\"Invalid\",\"serviceName\":\"mzkwpjg\"}],\"serviceLoadMetrics\":[{\"name\":\"pughftqsxh\",\"weight\":\"Medium\",\"primaryDefaultLoad\":318834407,\"secondaryDefaultLoad\":649615996,\"defaultLoad\":1485711526},{\"name\":\"xdigrjg\",\"weight\":\"Zero\",\"primaryDefaultLoad\":1159016951,\"secondaryDefaultLoad\":1563611736,\"defaultLoad\":1621102365},{\"name\":\"tfih\",\"weight\":\"High\",\"primaryDefaultLoad\":720488968,\"secondaryDefaultLoad\":1701702807,\"defaultLoad\":867678631}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Zero\"}") + "{\"serviceKind\":\"Stateless\",\"instanceCount\":146248988,\"instanceCloseDelayDuration\":\"bjcntujitc\",\"minInstanceCount\":307486773,\"provisioningState\":\"wwa\",\"serviceTypeName\":\"kojvd\",\"partitionDescription\":{\"partitionScheme\":\"PartitionSchemeDescription\"},\"servicePackageActivationMode\":\"ExclusiveProcess\",\"serviceDnsName\":\"qouicybxarzgsz\",\"placementConstraints\":\"oxciqopidoamcio\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"azxkhnzbonlwnto\"},{\"scheme\":\"AlignedAffinity\",\"serviceName\":\"okdwb\"},{\"scheme\":\"Invalid\",\"serviceName\":\"kszzcmrvexztv\"},{\"scheme\":\"Invalid\",\"serviceName\":\"qgsfraoyzkoow\"}],\"serviceLoadMetrics\":[{\"name\":\"nguxawqaldsy\",\"weight\":\"High\",\"primaryDefaultLoad\":1091934004,\"secondaryDefaultLoad\":646205101,\"defaultLoad\":1334975440},{\"name\":\"obwyznkb\",\"weight\":\"Low\",\"primaryDefaultLoad\":1183252215,\"secondaryDefaultLoad\":1465227251,\"defaultLoad\":951051183},{\"name\":\"a\",\"weight\":\"Medium\",\"primaryDefaultLoad\":1165571898,\"secondaryDefaultLoad\":1595958724,\"defaultLoad\":803916344},{\"name\":\"fdsd\",\"weight\":\"Medium\",\"primaryDefaultLoad\":513525209,\"secondaryDefaultLoad\":978154118,\"defaultLoad\":849845593}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"High\"}") .toObject(StatelessServiceProperties.class); - Assertions.assertEquals("fk", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("ex", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("pughftqsxh", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(318834407, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(649615996, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1485711526, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); - Assertions.assertEquals("vfbgofeljagrqmqh", model.serviceTypeName()); + Assertions.assertEquals("oxciqopidoamcio", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("azxkhnzbonlwnto", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("nguxawqaldsy", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1091934004, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(646205101, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1334975440, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("kojvd", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.servicePackageActivationMode()); - Assertions.assertEquals("iiojnal", model.serviceDnsName()); - Assertions.assertEquals(1656770527, model.instanceCount()); - Assertions.assertEquals("zszrnwoiindfpw", model.instanceCloseDelayDuration()); + Assertions.assertEquals("qouicybxarzgsz", model.serviceDnsName()); + Assertions.assertEquals(146248988, model.instanceCount()); + Assertions.assertEquals("bjcntujitc", model.instanceCloseDelayDuration()); + Assertions.assertEquals(307486773, model.minInstanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StatelessServiceProperties model = new StatelessServiceProperties().withPlacementConstraints("fk") + StatelessServiceProperties model = new StatelessServiceProperties().withPlacementConstraints("oxciqopidoamcio") .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY).withServiceName("ex"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("wueluqhhahhxv"), new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("mzkwpjg"))) + .withServiceName("azxkhnzbonlwnto"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.ALIGNED_AFFINITY) + .withServiceName("okdwb"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("kszzcmrvexztv"), + new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("qgsfraoyzkoow"))) .withServiceLoadMetrics(Arrays.asList( - new ServiceLoadMetricDescription().withName("pughftqsxh") - .withWeight(ServiceLoadMetricWeight.MEDIUM) - .withPrimaryDefaultLoad(318834407) - .withSecondaryDefaultLoad(649615996) - .withDefaultLoad(1485711526), - new ServiceLoadMetricDescription().withName("xdigrjg") - .withWeight(ServiceLoadMetricWeight.ZERO) - .withPrimaryDefaultLoad(1159016951) - .withSecondaryDefaultLoad(1563611736) - .withDefaultLoad(1621102365), - new ServiceLoadMetricDescription().withName("tfih") + new ServiceLoadMetricDescription().withName("nguxawqaldsy") .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(720488968) - .withSecondaryDefaultLoad(1701702807) - .withDefaultLoad(867678631))) + .withPrimaryDefaultLoad(1091934004) + .withSecondaryDefaultLoad(646205101) + .withDefaultLoad(1334975440), + new ServiceLoadMetricDescription().withName("obwyznkb") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(1183252215) + .withSecondaryDefaultLoad(1465227251) + .withDefaultLoad(951051183), + new ServiceLoadMetricDescription().withName("a") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(1165571898) + .withSecondaryDefaultLoad(1595958724) + .withDefaultLoad(803916344), + new ServiceLoadMetricDescription().withName("fdsd") + .withWeight(ServiceLoadMetricWeight.MEDIUM) + .withPrimaryDefaultLoad(513525209) + .withSecondaryDefaultLoad(978154118) + .withDefaultLoad(849845593))) .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.ZERO) - .withServiceTypeName("vfbgofeljagrqmqh") + .withDefaultMoveCost(MoveCost.HIGH) + .withServiceTypeName("kojvd") .withPartitionDescription(new PartitionSchemeDescription()) .withServicePackageActivationMode(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS) - .withServiceDnsName("iiojnal") - .withInstanceCount(1656770527) - .withInstanceCloseDelayDuration("zszrnwoiindfpw"); + .withServiceDnsName("qouicybxarzgsz") + .withInstanceCount(146248988) + .withInstanceCloseDelayDuration("bjcntujitc") + .withMinInstanceCount(307486773); model = BinaryData.fromObject(model).toObject(StatelessServiceProperties.class); - Assertions.assertEquals("fk", model.placementConstraints()); - Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("ex", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("pughftqsxh", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.MEDIUM, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(318834407, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(649615996, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(1485711526, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.ZERO, model.defaultMoveCost()); - Assertions.assertEquals("vfbgofeljagrqmqh", model.serviceTypeName()); + Assertions.assertEquals("oxciqopidoamcio", model.placementConstraints()); + Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); + Assertions.assertEquals("azxkhnzbonlwnto", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("nguxawqaldsy", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(1091934004, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(646205101, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1334975440, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.HIGH, model.defaultMoveCost()); + Assertions.assertEquals("kojvd", model.serviceTypeName()); Assertions.assertEquals(ArmServicePackageActivationMode.EXCLUSIVE_PROCESS, model.servicePackageActivationMode()); - Assertions.assertEquals("iiojnal", model.serviceDnsName()); - Assertions.assertEquals(1656770527, model.instanceCount()); - Assertions.assertEquals("zszrnwoiindfpw", model.instanceCloseDelayDuration()); + Assertions.assertEquals("qouicybxarzgsz", model.serviceDnsName()); + Assertions.assertEquals(146248988, model.instanceCount()); + Assertions.assertEquals("bjcntujitc", model.instanceCloseDelayDuration()); + Assertions.assertEquals(307486773, model.minInstanceCount()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServiceUpdatePropertiesTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServiceUpdatePropertiesTests.java index 03393455d2db..91cf142effaf 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServiceUpdatePropertiesTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/StatelessServiceUpdatePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -19,53 +19,50 @@ public final class StatelessServiceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { StatelessServiceUpdateProperties model = BinaryData.fromString( - "{\"serviceKind\":\"Stateless\",\"instanceCount\":313573135,\"instanceCloseDelayDuration\":\"szqzudphqamv\",\"placementConstraints\":\"fwynwcvtbvkay\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"vyqia\"},{\"scheme\":\"Affinity\",\"serviceName\":\"zwpcnpwzcjaesg\"},{\"scheme\":\"Invalid\",\"serviceName\":\"sccyajguqf\"}],\"serviceLoadMetrics\":[{\"name\":\"gzlvdnkfxu\",\"weight\":\"High\",\"primaryDefaultLoad\":1547666647,\"secondaryDefaultLoad\":252265287,\"defaultLoad\":372421736}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Low\"}") + "{\"serviceKind\":\"Stateless\",\"instanceCount\":1649484823,\"instanceCloseDelayDuration\":\"ab\",\"placementConstraints\":\"systawfsdjp\",\"correlationScheme\":[{\"scheme\":\"Invalid\",\"serviceName\":\"bjxbkzbzk\"}],\"serviceLoadMetrics\":[{\"name\":\"cjabudurgkakmo\",\"weight\":\"Low\",\"primaryDefaultLoad\":523614486,\"secondaryDefaultLoad\":615814676,\"defaultLoad\":1622584038}],\"servicePlacementPolicies\":[{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"},{\"type\":\"ServicePlacementPolicyDescription\"}],\"defaultMoveCost\":\"Medium\"}") .toObject(StatelessServiceUpdateProperties.class); - Assertions.assertEquals("fwynwcvtbvkay", model.placementConstraints()); + Assertions.assertEquals("systawfsdjp", model.placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("vyqia", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("gzlvdnkfxu", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1547666647, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(252265287, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(372421736, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); - Assertions.assertEquals(313573135, model.instanceCount()); - Assertions.assertEquals("szqzudphqamv", model.instanceCloseDelayDuration()); + Assertions.assertEquals("bjxbkzbzk", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("cjabudurgkakmo", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(523614486, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(615814676, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1622584038, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.MEDIUM, model.defaultMoveCost()); + Assertions.assertEquals(1649484823, model.instanceCount()); + Assertions.assertEquals("ab", model.instanceCloseDelayDuration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { StatelessServiceUpdateProperties model - = new StatelessServiceUpdateProperties().withPlacementConstraints("fwynwcvtbvkay") - .withCorrelationScheme(Arrays.asList( - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("vyqia"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.AFFINITY) - .withServiceName("zwpcnpwzcjaesg"), - new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) - .withServiceName("sccyajguqf"))) - .withServiceLoadMetrics(Arrays.asList(new ServiceLoadMetricDescription().withName("gzlvdnkfxu") - .withWeight(ServiceLoadMetricWeight.HIGH) - .withPrimaryDefaultLoad(1547666647) - .withSecondaryDefaultLoad(252265287) - .withDefaultLoad(372421736))) - .withServicePlacementPolicies(Arrays.asList(new ServicePlacementPolicyDescription(), - new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) - .withDefaultMoveCost(MoveCost.LOW) - .withInstanceCount(313573135) - .withInstanceCloseDelayDuration("szqzudphqamv"); + = new StatelessServiceUpdateProperties().withPlacementConstraints("systawfsdjp") + .withCorrelationScheme( + Arrays.asList(new ServiceCorrelationDescription().withScheme(ServiceCorrelationScheme.INVALID) + .withServiceName("bjxbkzbzk"))) + .withServiceLoadMetrics(Arrays.asList(new ServiceLoadMetricDescription().withName("cjabudurgkakmo") + .withWeight(ServiceLoadMetricWeight.LOW) + .withPrimaryDefaultLoad(523614486) + .withSecondaryDefaultLoad(615814676) + .withDefaultLoad(1622584038))) + .withServicePlacementPolicies( + Arrays.asList(new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription(), + new ServicePlacementPolicyDescription(), new ServicePlacementPolicyDescription())) + .withDefaultMoveCost(MoveCost.MEDIUM) + .withInstanceCount(1649484823) + .withInstanceCloseDelayDuration("ab"); model = BinaryData.fromObject(model).toObject(StatelessServiceUpdateProperties.class); - Assertions.assertEquals("fwynwcvtbvkay", model.placementConstraints()); + Assertions.assertEquals("systawfsdjp", model.placementConstraints()); Assertions.assertEquals(ServiceCorrelationScheme.INVALID, model.correlationScheme().get(0).scheme()); - Assertions.assertEquals("vyqia", model.correlationScheme().get(0).serviceName()); - Assertions.assertEquals("gzlvdnkfxu", model.serviceLoadMetrics().get(0).name()); - Assertions.assertEquals(ServiceLoadMetricWeight.HIGH, model.serviceLoadMetrics().get(0).weight()); - Assertions.assertEquals(1547666647, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); - Assertions.assertEquals(252265287, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); - Assertions.assertEquals(372421736, model.serviceLoadMetrics().get(0).defaultLoad()); - Assertions.assertEquals(MoveCost.LOW, model.defaultMoveCost()); - Assertions.assertEquals(313573135, model.instanceCount()); - Assertions.assertEquals("szqzudphqamv", model.instanceCloseDelayDuration()); + Assertions.assertEquals("bjxbkzbzk", model.correlationScheme().get(0).serviceName()); + Assertions.assertEquals("cjabudurgkakmo", model.serviceLoadMetrics().get(0).name()); + Assertions.assertEquals(ServiceLoadMetricWeight.LOW, model.serviceLoadMetrics().get(0).weight()); + Assertions.assertEquals(523614486, model.serviceLoadMetrics().get(0).primaryDefaultLoad()); + Assertions.assertEquals(615814676, model.serviceLoadMetrics().get(0).secondaryDefaultLoad()); + Assertions.assertEquals(1622584038, model.serviceLoadMetrics().get(0).defaultLoad()); + Assertions.assertEquals(MoveCost.MEDIUM, model.defaultMoveCost()); + Assertions.assertEquals(1649484823, model.instanceCount()); + Assertions.assertEquals("ab", model.instanceCloseDelayDuration()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetWithResponseMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetWithResponseMockTests.java new file mode 100644 index 000000000000..36bd8ad7f108 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.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.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.models.VMSizeResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class UnsupportedVmSizesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"size\":\"wuenvr\"},\"id\":\"yo\",\"name\":\"aibrebqaaysjkixq\",\"type\":\"nqttezl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ServiceFabricManager manager = ServiceFabricManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VMSizeResource response = manager.unsupportedVmSizes() + .getWithResponse("fhsxttaugz", "nfaazpxdtnkdmkq", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListMockTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListMockTests.java new file mode 100644 index 000000000000..b10a99d1e3cd --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UnsupportedVmSizesListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.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.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.models.VMSizeResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class UnsupportedVmSizesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"size\":\"qqmtedltmmji\"},\"id\":\"eozphv\",\"name\":\"auyqncygupkv\",\"type\":\"p\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ServiceFabricManager manager = ServiceFabricManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.unsupportedVmSizes().list("fffiak", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionPathResultInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionPathResultInnerTests.java index 2ebf3febdfc0..51db1d0537c3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionPathResultInnerTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionPathResultInnerTests.java @@ -1,27 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicefabric.fluent.models.UpgradableVersionPathResultInner; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class UpgradableVersionPathResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UpgradableVersionPathResultInner model = BinaryData.fromString("{\"supportedPath\":[\"gpbtoqcjmklj\"]}") + UpgradableVersionPathResultInner model = BinaryData.fromString("{\"supportedPath\":[\"c\",\"pmivkwlzu\"]}") .toObject(UpgradableVersionPathResultInner.class); - Assertions.assertEquals("gpbtoqcjmklj", model.supportedPath().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpgradableVersionPathResultInner model - = new UpgradableVersionPathResultInner().withSupportedPath(Arrays.asList("gpbtoqcjmklj")); - model = BinaryData.fromObject(model).toObject(UpgradableVersionPathResultInner.class); - Assertions.assertEquals("gpbtoqcjmklj", model.supportedPath().get(0)); + Assertions.assertEquals("c", model.supportedPath().get(0)); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionsDescriptionTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionsDescriptionTests.java index 04b7ea8b8089..7877f350b367 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionsDescriptionTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UpgradableVersionsDescriptionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -11,15 +11,15 @@ public final class UpgradableVersionsDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UpgradableVersionsDescription model - = BinaryData.fromString("{\"targetVersion\":\"zafb\"}").toObject(UpgradableVersionsDescription.class); - Assertions.assertEquals("zafb", model.targetVersion()); + UpgradableVersionsDescription model = BinaryData.fromString("{\"targetVersion\":\"sxlzevgbmqj\"}") + .toObject(UpgradableVersionsDescription.class); + Assertions.assertEquals("sxlzevgbmqj", model.targetVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpgradableVersionsDescription model = new UpgradableVersionsDescription().withTargetVersion("zafb"); + UpgradableVersionsDescription model = new UpgradableVersionsDescription().withTargetVersion("sxlzevgbmqj"); model = BinaryData.fromObject(model).toObject(UpgradableVersionsDescription.class); - Assertions.assertEquals("zafb", model.targetVersion()); + Assertions.assertEquals("sxlzevgbmqj", model.targetVersion()); } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UserAssignedIdentityTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UserAssignedIdentityTests.java index 00cc3cf92f82..5863208fb335 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UserAssignedIdentityTests.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/UserAssignedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.servicefabric.generated; @@ -10,9 +10,8 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model - = BinaryData.fromString("{\"principalId\":\"liourqhak\",\"clientId\":\"hashsfwxosow\"}") - .toObject(UserAssignedIdentity.class); + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"plvwiwubmwmbes\",\"clientId\":\"nkww\"}") + .toObject(UserAssignedIdentity.class); } @org.junit.jupiter.api.Test diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeResourceInnerTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeResourceInnerTests.java new file mode 100644 index 000000000000..033c9fb83667 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeResourceInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicefabric.fluent.models.VMSizeResourceInner; + +public final class VMSizeResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMSizeResourceInner model = BinaryData.fromString( + "{\"properties\":{\"size\":\"fwnfnb\"},\"id\":\"fionl\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"}") + .toObject(VMSizeResourceInner.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeTests.java new file mode 100644 index 000000000000..9f2c752e2580 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizeTests.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicefabric.models.VMSize; + +public final class VMSizeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMSize model = BinaryData.fromString("{\"size\":\"al\"}").toObject(VMSize.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizesResultTests.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizesResultTests.java new file mode 100644 index 000000000000..741c31c650c6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/test/java/com/azure/resourcemanager/servicefabric/generated/VMSizesResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicefabric.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicefabric.implementation.models.VMSizesResult; +import org.junit.jupiter.api.Assertions; + +public final class VMSizesResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VMSizesResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"size\":\"ubisnjampmng\"},\"id\":\"scxaq\",\"name\":\"ooch\",\"type\":\"bonqvpkvlrxnjeas\"},{\"properties\":{\"size\":\"heoflokeyyienjbd\"},\"id\":\"tgrhpdjpjumas\",\"name\":\"azjpqyegualhbxxh\",\"type\":\"jj\"},{\"properties\":{\"size\":\"dudgwdslfhot\"},\"id\":\"cynpwlbjnp\",\"name\":\"acfta\",\"type\":\"ehxnltyfsop\"}],\"nextLink\":\"suesnzw\"}") + .toObject(VMSizesResult.class); + Assertions.assertEquals("suesnzw", model.nextLink()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/tsp-location.yaml b/sdk/servicefabric/azure-resourcemanager-servicefabric/tsp-location.yaml new file mode 100644 index 000000000000..18e798e3ac86 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/servicefabric/resource-manager/Microsoft.ServiceFabric/ServiceFabric +commit: a3fd1efe038ca9c4a0042c3ee3afe6b279079ff6 +repo: Azure/azure-rest-api-specs +additionalDirectories: