From fb5519d58f4d0f4953dce826b2314a83ba953b59 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 23 Feb 2021 00:32:51 +0000 Subject: [PATCH] CodeGen from PR 11614 in Azure/azure-rest-api-specs Adding service fabric api version 2020-12-01-preview - rebased with master (#11614) --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 67 + .../servicefabric/ServiceFabricManager.java | 324 +++ .../fluent/ApplicationTypeVersionsClient.java | 242 ++ .../fluent/ApplicationTypesClient.java | 181 ++ .../fluent/ApplicationsClient.java | 288 ++ .../fluent/ClusterVersionsClient.java | 127 + .../servicefabric/fluent/ClustersClient.java | 246 ++ .../fluent/ManagedClusterVersionsClient.java | 44 + .../fluent/ManagedClustersClient.java | 271 ++ .../servicefabric/fluent/NodeTypesClient.java | 501 ++++ .../fluent/OperationsClient.java | 102 + .../fluent/ServiceFabricManagementClient.java | 109 + .../servicefabric/fluent/ServicesClient.java | 325 +++ .../models/ApplicationResourceInner.java | 415 +++ .../models/ApplicationResourceListInner.java | 69 + .../models/ApplicationTypeResourceInner.java | 113 + .../ApplicationTypeResourceListInner.java | 70 + .../ApplicationTypeVersionResourceInner.java | 156 ++ ...plicationTypeVersionResourceListInner.java | 70 + .../ClusterCodeVersionsListResultInner.java | 81 + .../fluent/models/ClusterInner.java | 808 ++++++ .../fluent/models/ClusterListResultInner.java | 80 + .../fluent/models/ManagedClusterInner.java | 479 ++++ .../ManagedClusterVersionDetailsInner.java | 103 + .../fluent/models/NodeTypeInner.java | 466 ++++ .../fluent/models/OperationResultInner.java | 132 + .../fluent/models/ServiceResourceInner.java | 388 +++ .../models/ServiceResourceListInner.java | 69 + .../fluent/models/package-info.java | 6 + .../servicefabric/fluent/package-info.java | 6 + .../ApplicationResourceImpl.java | 333 +++ .../ApplicationResourceListImpl.java | 51 + .../ApplicationTypeResourceImpl.java | 178 ++ .../ApplicationTypeResourceListImpl.java | 51 + .../ApplicationTypeVersionResourceImpl.java | 200 ++ ...pplicationTypeVersionResourceListImpl.java | 52 + .../ApplicationTypeVersionsClientImpl.java | 1146 ++++++++ .../ApplicationTypeVersionsImpl.java | 246 ++ .../ApplicationTypesClientImpl.java | 927 +++++++ .../implementation/ApplicationTypesImpl.java | 212 ++ .../ApplicationsClientImpl.java | 1365 ++++++++++ .../implementation/ApplicationsImpl.java | 203 ++ .../ClusterCodeVersionsListResultImpl.java | 45 + .../implementation/ClusterImpl.java | 487 ++++ .../implementation/ClusterListResultImpl.java | 48 + .../ClusterVersionsClientImpl.java | 707 +++++ .../implementation/ClusterVersionsImpl.java | 134 + .../implementation/ClustersClientImpl.java | 1229 +++++++++ .../implementation/ClustersImpl.java | 196 ++ .../implementation/ManagedClusterImpl.java | 371 +++ .../ManagedClusterVersionDetailsImpl.java | 42 + .../ManagedClusterVersionsClientImpl.java | 225 ++ .../ManagedClusterVersionsImpl.java | 74 + .../ManagedClustersClientImpl.java | 1549 +++++++++++ .../implementation/ManagedClustersImpl.java | 174 ++ .../implementation/NodeTypeImpl.java | 341 +++ .../implementation/NodeTypesClientImpl.java | 2401 +++++++++++++++++ .../implementation/NodeTypesImpl.java | 237 ++ .../implementation/OperationResultImpl.java | 45 + .../implementation/OperationsClientImpl.java | 651 +++++ .../implementation/OperationsImpl.java | 76 + .../ServiceFabricManagementClientBuilder.java | 146 + .../ServiceFabricManagementClientImpl.java | 406 +++ .../implementation/ServiceResourceImpl.java | 319 +++ .../ServiceResourceListImpl.java | 51 + .../implementation/ServicesClientImpl.java | 1504 +++++++++++ .../implementation/ServicesImpl.java | 236 ++ .../servicefabric/implementation/Utils.java | 196 ++ .../implementation/package-info.java | 6 + .../servicefabric/models/AddOnFeatures.java | 40 + .../models/ApplicationDeltaHealthPolicy.java | 101 + .../models/ApplicationHealthPolicy.java | 98 + .../models/ApplicationMetricDescription.java | 185 ++ .../models/ApplicationResource.java | 518 ++++ .../models/ApplicationResourceList.java | 32 + .../models/ApplicationResourceProperties.java | 128 + .../models/ApplicationResourceUpdate.java | 339 +++ .../ApplicationResourceUpdateProperties.java | 269 ++ .../models/ApplicationTypeResource.java | 205 ++ .../models/ApplicationTypeResourceList.java | 32 + .../ApplicationTypeVersionResource.java | 243 ++ .../ApplicationTypeVersionResourceList.java | 33 + .../models/ApplicationTypeVersions.java | 162 ++ .../ApplicationTypeVersionsCleanupPolicy.java | 50 + .../models/ApplicationTypes.java | 154 ++ .../models/ApplicationUpgradePolicy.java | 183 ++ .../ApplicationUserAssignedIdentity.java | 88 + .../servicefabric/models/Applications.java | 151 ++ .../models/ArmApplicationHealthPolicy.java | 171 ++ .../ArmRollingUpgradeMonitoringPolicy.java | 219 ++ .../ArmServicePackageActivationMode.java | 34 + .../models/ArmServiceTypeHealthPolicy.java | 116 + .../models/ArmUpgradeFailureAction.java | 34 + .../models/AvailableOperationDisplay.java | 128 + .../models/AzureActiveDirectory.java | 102 + .../models/CertificateDescription.java | 108 + .../models/ClientCertificate.java | 129 + .../models/ClientCertificateCommonName.java | 117 + .../models/ClientCertificateThumbprint.java | 85 + .../servicefabric/models/Cluster.java | 866 ++++++ .../models/ClusterCodeVersionsListResult.java | 32 + .../models/ClusterCodeVersionsResult.java | 182 ++ .../models/ClusterEnvironment.java | 34 + .../models/ClusterHealthPolicy.java | 183 ++ .../models/ClusterListResult.java | 32 + .../servicefabric/models/ClusterOsType.java | 40 + .../servicefabric/models/ClusterState.java | 58 + .../models/ClusterUpdateParameters.java | 521 ++++ .../ClusterUpgradeDeltaHealthPolicy.java | 190 ++ .../models/ClusterUpgradePolicy.java | 344 +++ .../models/ClusterVersionDetails.java | 102 + .../servicefabric/models/ClusterVersions.java | 114 + .../models/ClusterVersionsEnvironment.java | 34 + .../servicefabric/models/Clusters.java | 160 ++ .../DiagnosticsStorageAccountConfig.java | 214 ++ .../servicefabric/models/DurabilityLevel.java | 37 + .../models/EndpointRangeDescription.java | 76 + .../models/LoadBalancingRule.java | 172 ++ .../servicefabric/models/ManagedCluster.java | 557 ++++ .../models/ManagedClusterAddOnFeature.java | 37 + .../models/ManagedClusterListResult.java | 81 + .../ManagedClusterUpdateParameters.java | 284 ++ .../models/ManagedClusterVersionDetails.java | 38 + .../models/ManagedClusterVersions.java | 38 + .../models/ManagedClusterVersionsOsType.java | 40 + .../servicefabric/models/ManagedClusters.java | 164 ++ .../servicefabric/models/ManagedIdentity.java | 128 + .../models/ManagedIdentityType.java | 53 + .../models/ManagedProxyResource.java | 52 + .../ManagedResourceProvisioningState.java | 58 + .../servicefabric/models/MoveCost.java | 40 + .../NamedPartitionSchemeDescription.java | 90 + .../servicefabric/models/NodeType.java | 530 ++++ .../models/NodeTypeActionParameters.java | 82 + .../models/NodeTypeDescription.java | 361 +++ .../models/NodeTypeListResult.java | 81 + .../models/NodeTypeUpdateParameters.java | 261 ++ .../servicefabric/models/NodeTypes.java | 247 ++ .../models/OperationListResult.java | 70 + .../servicefabric/models/OperationResult.java | 45 + .../servicefabric/models/Operations.java | 91 + .../servicefabric/models/PartitionScheme.java | 40 + .../models/PartitionSchemeDescription.java | 37 + .../servicefabric/models/ProbeProtocol.java | 37 + .../servicefabric/models/Protocol.java | 34 + .../models/ProvisioningState.java | 40 + .../models/ReliabilityLevel.java | 43 + .../models/RollingUpgradeMode.java | 40 + .../models/ServerCertificateCommonName.java | 88 + .../models/ServerCertificateCommonNames.java | 83 + .../models/ServiceCorrelationDescription.java | 92 + .../models/ServiceCorrelationScheme.java | 40 + .../servicefabric/models/ServiceKind.java | 37 + .../models/ServiceLoadMetricDescription.java | 178 ++ .../models/ServiceLoadMetricWeight.java | 40 + .../ServicePlacementPolicyDescription.java | 27 + .../models/ServicePlacementPolicyType.java | 47 + .../servicefabric/models/ServiceResource.java | 455 ++++ .../models/ServiceResourceList.java | 32 + .../models/ServiceResourceProperties.java | 204 ++ .../models/ServiceResourcePropertiesBase.java | 182 ++ .../models/ServiceResourceUpdate.java | 254 ++ .../ServiceResourceUpdateProperties.java | 77 + .../models/ServiceTypeDeltaHealthPolicy.java | 66 + .../models/ServiceTypeHealthPolicy.java | 54 + .../servicefabric/models/Services.java | 159 ++ .../models/SettingsParameterDescription.java | 88 + .../models/SettingsSectionDescription.java | 90 + .../SingletonPartitionSchemeDescription.java | 29 + .../servicefabric/models/Sku.java | 54 + .../servicefabric/models/SkuName.java | 34 + .../models/StatefulServiceProperties.java | 266 ++ .../StatefulServiceUpdateProperties.java | 209 ++ .../models/StatelessServiceProperties.java | 165 ++ .../StatelessServiceUpdateProperties.java | 138 + .../servicefabric/models/StoreName.java | 52 + ...mInt64RangePartitionSchemeDescription.java | 128 + .../servicefabric/models/UpgradeMode.java | 34 + .../models/UserAssignedIdentity.java | 54 + .../models/VaultCertificate.java | 118 + .../models/VaultSecretGroup.java | 95 + .../servicefabric/models/VmssExtension.java | 315 +++ .../servicefabric/models/package-info.java | 6 + .../servicefabric/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/servicefabric/ci.yml | 31 + sdk/servicefabric/pom.xml | 53 + 191 files changed, 38747 insertions(+) create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/README.md create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceListInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceListInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceListInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterListResultInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/OperationResultInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceListInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceListImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceListImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceListImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterListResultImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceListImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/Utils.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceList.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResourceList.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResourceList.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AzureActiveDirectory.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/CertificateDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateCommonName.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateThumbprint.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterEnvironment.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionDetails.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationScheme.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceList.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java create mode 100644 sdk/servicefabric/ci.yml create mode 100644 sdk/servicefabric/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 1666c59f2daba..70ef835412fa4 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -204,6 +204,7 @@ com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-servicefabric;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index b5983de344d21..139f978fb1578 100644 --- a/pom.xml +++ b/pom.xml @@ -603,6 +603,7 @@ sdk/schemaregistry sdk/search sdk/servicebus + sdk/servicefabric sdk/spring sdk/sqlvirtualmachine sdk/storage diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md new file mode 100644 index 0000000000000..d18d50f60bd4b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-23) + +- Azure Resource Manager ServiceFabric client library for Java. This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md new file mode 100644 index 0000000000000..90bc805469e5b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager ServiceFabric client library for Java + +Azure Resource Manager ServiceFabric client library for Java. + +This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-servicefabric;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-servicefabric + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ServiceFabricManager manager = ServiceFabricManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml new file mode 100644 index 0000000000000..6432313597a07 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-servicefabric + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ServiceFabric Management + This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.13.0 + + + com.azure + azure-core-management + 1.1.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + 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 new file mode 100644 index 0000000000000..3e70f22b8044f --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java @@ -0,0 +1,324 @@ +// 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; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ServiceFabricManagementClient; +import com.azure.resourcemanager.servicefabric.implementation.ApplicationTypeVersionsImpl; +import com.azure.resourcemanager.servicefabric.implementation.ApplicationTypesImpl; +import com.azure.resourcemanager.servicefabric.implementation.ApplicationsImpl; +import com.azure.resourcemanager.servicefabric.implementation.ClusterVersionsImpl; +import com.azure.resourcemanager.servicefabric.implementation.ClustersImpl; +import com.azure.resourcemanager.servicefabric.implementation.ManagedClusterVersionsImpl; +import com.azure.resourcemanager.servicefabric.implementation.ManagedClustersImpl; +import com.azure.resourcemanager.servicefabric.implementation.NodeTypesImpl; +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.models.ApplicationTypeVersions; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypes; +import com.azure.resourcemanager.servicefabric.models.Applications; +import com.azure.resourcemanager.servicefabric.models.ClusterVersions; +import com.azure.resourcemanager.servicefabric.models.Clusters; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersions; +import com.azure.resourcemanager.servicefabric.models.ManagedClusters; +import com.azure.resourcemanager.servicefabric.models.NodeTypes; +import com.azure.resourcemanager.servicefabric.models.Operations; +import com.azure.resourcemanager.servicefabric.models.Services; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ServiceFabricManager. Service Fabric Management Client. */ +public final class ServiceFabricManager { + private Clusters clusters; + + private ClusterVersions clusterVersions; + + private Operations operations; + + private ApplicationTypes applicationTypes; + + private ApplicationTypeVersions applicationTypeVersions; + + private Applications applications; + + private Services services; + + private ManagedClusters managedClusters; + + private ManagedClusterVersions managedClusterVersions; + + private NodeTypes nodeTypes; + + private final ServiceFabricManagementClient clientObject; + + private ServiceFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ServiceFabricManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ServiceFabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceFabric service API instance. + */ + public static ServiceFabricManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ServiceFabricManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ServiceFabricManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ServiceFabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ServiceFabric service API instance. + */ + public ServiceFabricManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.servicefabric") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ServiceFabricManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @return Resource collection API of ClusterVersions. */ + public ClusterVersions clusterVersions() { + if (this.clusterVersions == null) { + this.clusterVersions = new ClusterVersionsImpl(clientObject.getClusterVersions(), this); + } + return clusterVersions; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ApplicationTypes. */ + public ApplicationTypes applicationTypes() { + if (this.applicationTypes == null) { + this.applicationTypes = new ApplicationTypesImpl(clientObject.getApplicationTypes(), this); + } + return applicationTypes; + } + + /** @return Resource collection API of ApplicationTypeVersions. */ + public ApplicationTypeVersions applicationTypeVersions() { + if (this.applicationTypeVersions == null) { + this.applicationTypeVersions = + new ApplicationTypeVersionsImpl(clientObject.getApplicationTypeVersions(), this); + } + return applicationTypeVersions; + } + + /** @return Resource collection API of Applications. */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + } + return applications; + } + + /** @return Resource collection API of Services. */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** @return Resource collection API of ManagedClusters. */ + public ManagedClusters managedClusters() { + if (this.managedClusters == null) { + this.managedClusters = new ManagedClustersImpl(clientObject.getManagedClusters(), this); + } + return managedClusters; + } + + /** @return Resource collection API of ManagedClusterVersions. */ + public ManagedClusterVersions managedClusterVersions() { + if (this.managedClusterVersions == null) { + this.managedClusterVersions = + new ManagedClusterVersionsImpl(clientObject.getManagedClusterVersions(), this); + } + return managedClusterVersions; + } + + /** @return Resource collection API of NodeTypes. */ + public NodeTypes nodeTypes() { + if (this.nodeTypes == null) { + this.nodeTypes = new NodeTypesImpl(clientObject.getNodeTypes(), this); + } + return nodeTypes; + } + + /** + * @return Wrapped service client ServiceFabricManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ServiceFabricManagementClient serviceClient() { + return this.clientObject; + } +} 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 new file mode 100644 index 0000000000000..95b6614416a5e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypeVersionsClient.java @@ -0,0 +1,242 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceListInner; + +/** An instance of this class provides access to all the operations defined in ApplicationTypeVersionsClient. */ +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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeVersionResourceInner get( + String resourceGroupName, String clusterName, String applicationTypeName, String version); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationTypeVersionResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationTypeVersionResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeVersionResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeVersionResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, String version); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); + + /** + * 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 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 + * application type name resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeVersionResourceListInner list( + String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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 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 + * application type name resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context); +} 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 new file mode 100644 index 0000000000000..b4b6d2f5e55d7 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationTypesClient.java @@ -0,0 +1,181 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceListInner; + +/** An instance of this class provides access to all the operations defined in ApplicationTypesClient. */ +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 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 + * Fabric cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeResourceInner get(String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + ApplicationTypeResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String clusterName, + String applicationTypeName, + ApplicationTypeResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationTypeResourceListInner list(String resourceGroupName, String clusterName); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + 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 new file mode 100644 index 0000000000000..c2132aa035569 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ApplicationsClient.java @@ -0,0 +1,288 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +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 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 + * cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceInner get(String resourceGroupName, String clusterName, String applicationName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceInner createOrUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationResourceInner> beginUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceUpdate parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceInner update( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceInner update( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceUpdate parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationResourceListInner list(String resourceGroupName, String clusterName); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + 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 new file mode 100644 index 0000000000000..85144b21b1cca --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClusterVersionsClient.java @@ -0,0 +1,127 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment; + +/** An instance of this class provides access to all the operations defined in ClusterVersionsClient. */ +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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterCodeVersionsListResultInner get(String location, String clusterVersion); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String clusterVersion, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterCodeVersionsListResultInner getByEnvironment( + String location, ClusterVersionsEnvironment environment, String clusterVersion); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, String clusterVersion, Context context); + + /** + * 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterCodeVersionsListResultInner list(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String location, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterCodeVersionsListResultInner listByEnvironment(String location, ClusterVersionsEnvironment environment); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, Context context); +} 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 new file mode 100644 index 0000000000000..377c4ea46824d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ClustersClient.java @@ -0,0 +1,246 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterListResultInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterListResultInner list(); + + /** + * 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java new file mode 100644 index 0000000000000..1f1699472cc8c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java @@ -0,0 +1,44 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ManagedClusterVersionsClient. */ +public interface ManagedClusterVersionsClient { + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listByOS(String location, ManagedClusterVersionsOsType osType); + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java new file mode 100644 index 0000000000000..cca6ea83ca25d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java @@ -0,0 +1,271 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ +public interface ManagedClustersClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a Service Fabric managed 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 com.azure.core.management.exception.ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Get a Service Fabric managed 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters); + + /** + * Create or update a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context); + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate(String resourceGroupName, String clusterName, ManagedClusterInner parameters); + + /** + * Create or update a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner update(String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java new file mode 100644 index 0000000000000..46598e01097aa --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java @@ -0,0 +1,501 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; + +/** An instance of this class provides access to all the operations defined in NodeTypesClient. */ +public interface NodeTypesClient { + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.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 Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName); + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.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 Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner get(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner update( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner update( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context); +} 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 new file mode 100644 index 0000000000000..cbf375dc3b19a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java @@ -0,0 +1,102 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Get the list of available Service Fabric resource provider API 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @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 new file mode 100644 index 0000000000000..5d0f115693ee2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java @@ -0,0 +1,109 @@ +// 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.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ServiceFabricManagementClient class. */ +public interface ServiceFabricManagementClient { + /** + * Gets The customer subscription identifier. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the ClusterVersionsClient object to access its operations. + * + * @return the ClusterVersionsClient object. + */ + ClusterVersionsClient getClusterVersions(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ApplicationTypesClient object to access its operations. + * + * @return the ApplicationTypesClient object. + */ + ApplicationTypesClient getApplicationTypes(); + + /** + * Gets the ApplicationTypeVersionsClient object to access its operations. + * + * @return the ApplicationTypeVersionsClient object. + */ + ApplicationTypeVersionsClient getApplicationTypeVersions(); + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + ApplicationsClient getApplications(); + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + ServicesClient getServices(); + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + ManagedClustersClient getManagedClusters(); + + /** + * Gets the ManagedClusterVersionsClient object to access its operations. + * + * @return the ManagedClusterVersionsClient object. + */ + ManagedClusterVersionsClient getManagedClusterVersions(); + + /** + * Gets the NodeTypesClient object to access its operations. + * + * @return the NodeTypesClient object. + */ + NodeTypesClient getNodeTypes(); +} 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 new file mode 100644 index 0000000000000..8a6e3e36e0341 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServicesClient.java @@ -0,0 +1,325 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdate; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +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 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 + * application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner get(String resourceGroupName, String clusterName, String applicationName, String serviceName); + + /** + * 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}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner update( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner update( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters, + Context context); + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, String serviceName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context); + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceListInner list(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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String clusterName, String applicationName, 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 new file mode 100644 index 0000000000000..35f053f820250 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java @@ -0,0 +1,415 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.ApplicationMetricDescription; +import com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity; +import com.azure.resourcemanager.servicefabric.models.ManagedIdentity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The application resource. */ +@JsonFlatten +@Fluent +public class ApplicationResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceInner.class); + + /* + * Describes the managed identities for an Azure resource. + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /* + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /* + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "properties.parameters") + private Map parameters; + + /* + * Describes the policy for a monitored application upgrade. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /* + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /* + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /* + * Remove the current application capacity settings. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /* + * List of application capacity metric description. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "properties.managedIdentities") + private List managedIdentities; + + /* + * The current deployment or provisioning state, which only appears in the + * response + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "properties.typeName") + private String typeName; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the identity property: Describes the managed identities for an Azure resource. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Describes the managed identities for an Azure resource. + * + * @param identity the identity value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the typeVersion property: The version of the application type as defined in the application manifest. + * + * @return the typeVersion value. + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion property: The version of the application type as defined in the application manifest. + * + * @param typeVersion the typeVersion value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @param parameters the parameters value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @return the upgradePolicy value. + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @return the minimumNodes value. + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value. + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @return the removeApplicationCapacity value. + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics property: List of application capacity metric description. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: List of application capacity metric description. + * + * @param metrics the metrics value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + public List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withManagedIdentities(List managedIdentities) { + this.managedIdentities = managedIdentities; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the typeName property: The application type name as defined in the application manifest. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The application type name as defined in the application manifest. + * + * @param typeName the typeName value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + if (managedIdentities() != null) { + managedIdentities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceListInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceListInner.java new file mode 100644 index 0000000000000..740db258de6de --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceListInner.java @@ -0,0 +1,69 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of application resources. */ +@Fluent +public final class ApplicationResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceListInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of application list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ApplicationResourceListInner object itself. + */ + public ApplicationResourceListInner 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..3c30d436b29d9 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java @@ -0,0 +1,113 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The application type name resource. */ +@JsonFlatten +@Fluent +public class ApplicationTypeResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeResourceInner.class); + + /* + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ApplicationTypeResourceInner object itself. + */ + public ApplicationTypeResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ApplicationTypeResourceInner object itself. + */ + public ApplicationTypeResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceListInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceListInner.java new file mode 100644 index 0000000000000..afeaccfa19429 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceListInner.java @@ -0,0 +1,70 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of application type names. */ +@Fluent +public final class ApplicationTypeResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeResourceListInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of application type list results if there are + * any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ApplicationTypeResourceListInner object itself. + */ + public ApplicationTypeResourceListInner 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..2e2e2844737ff --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java @@ -0,0 +1,156 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An application type version resource for the specified application type name resource. */ +@JsonFlatten +@Fluent +public class ApplicationTypeVersionResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionResourceInner.class); + + /* + * The current deployment or provisioning state, which only appears in the + * response + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The URL to the application package + */ + @JsonProperty(value = "properties.appPackageUrl") + private String appPackageUrl; + + /* + * List of application type parameters that can be overridden when creating + * or updating the application. + */ + @JsonProperty(value = "properties.defaultParameterList", access = JsonProperty.Access.WRITE_ONLY) + private Map defaultParameterList; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the appPackageUrl property: The URL to the application package. + * + * @return the appPackageUrl value. + */ + public String appPackageUrl() { + return this.appPackageUrl; + } + + /** + * Set the appPackageUrl property: The URL to the application package. + * + * @param appPackageUrl the appPackageUrl value to set. + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withAppPackageUrl(String appPackageUrl) { + this.appPackageUrl = appPackageUrl; + return this; + } + + /** + * Get the defaultParameterList property: List of application type parameters that can be overridden when creating + * or updating the application. + * + * @return the defaultParameterList value. + */ + public Map defaultParameterList() { + return this.defaultParameterList; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ApplicationTypeVersionResourceInner object itself. + */ + public ApplicationTypeVersionResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceListInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceListInner.java new file mode 100644 index 0000000000000..3684625c7bc38 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceListInner.java @@ -0,0 +1,70 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of application type version resources for the specified application type name resource. */ +@Fluent +public final class ApplicationTypeVersionResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionResourceListInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of application type version list results if + * there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ApplicationTypeVersionResourceListInner object itself. + */ + public ApplicationTypeVersionResourceListInner 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..77400a50a509e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterCodeVersionsListResultInner.java @@ -0,0 +1,81 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.ClusterCodeVersionsResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list results of the Service Fabric runtime versions. */ +@Fluent +public final class ClusterCodeVersionsListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterCodeVersionsListResultInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + 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()); + } + } +} 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 new file mode 100644 index 0000000000000..adba667b960c6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java @@ -0,0 +1,808 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.AddOnFeatures; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionsCleanupPolicy; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.CertificateDescription; +import com.azure.resourcemanager.servicefabric.models.ClientCertificateCommonName; +import com.azure.resourcemanager.servicefabric.models.ClientCertificateThumbprint; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.ClusterUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ClusterVersionDetails; +import com.azure.resourcemanager.servicefabric.models.DiagnosticsStorageAccountConfig; +import com.azure.resourcemanager.servicefabric.models.NodeTypeDescription; +import com.azure.resourcemanager.servicefabric.models.ProvisioningState; +import com.azure.resourcemanager.servicefabric.models.ReliabilityLevel; +import com.azure.resourcemanager.servicefabric.models.ServerCertificateCommonNames; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.UpgradeMode; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The cluster resource properties. */ +@JsonFlatten +@Fluent +public class ClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); + + /* + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /* + * The Service Fabric runtime versions available for this cluster. + */ + @JsonProperty(value = "properties.availableClusterVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableClusterVersions; + + /* + * The AAD authentication settings of the cluster. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /* + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; + + /* + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /* + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /* + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /* + * The Azure Resource Provider endpoint. A system service in the cluster + * connects to this endpoint. + */ + @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterEndpoint; + + /* + * A service generated unique identifier for the cluster resource. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * 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. + * + */ + @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterState clusterState; + + /* + * The storage account information for storing Service Fabric diagnostic + * logs. + */ + @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") + private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; + + /* + * Indicates if the event store service is enabled. + */ + @JsonProperty(value = "properties.eventStoreServiceEnabled") + private Boolean eventStoreServiceEnabled; + + /* + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * The http management endpoint of the cluster. + */ + @JsonProperty(value = "properties.managementEndpoint") + private String managementEndpoint; + + /* + * The list of node types in the cluster. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /* + * The provisioning state of the cluster resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * 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. + * + */ + @JsonProperty(value = "properties.reliabilityLevel") + private ReliabilityLevel reliabilityLevel; + + /* + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /* + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.reverseProxyCertificateCommonNames") + private ServerCertificateCommonNames reverseProxyCertificateCommonNames; + + /* + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /* + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - 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. + * + */ + @JsonProperty(value = "properties.upgradeMode") + private UpgradeMode upgradeMode; + + /* + * The policy used to clean up unused versions. + */ + @JsonProperty(value = "properties.applicationTypeVersionsCleanupPolicy") + private ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy; + + /* + * The VM image VMSS has been configured with. Generic names such as + * Windows or Linux can be used. + */ + @JsonProperty(value = "properties.vmImage") + private String vmImage; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the addOnFeatures property: The list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value. + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the addOnFeatures property: The list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get the availableClusterVersions property: The Service Fabric runtime versions available for this cluster. + * + * @return the availableClusterVersions value. + */ + public List availableClusterVersions() { + return this.availableClusterVersions; + } + + /** + * Get the azureActiveDirectory property: The AAD authentication settings of the cluster. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: The AAD authentication settings of the cluster. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the certificate property: The certificate to use for securing the cluster. The certificate provided will be + * used for node to node security within the cluster, SSL certificate for cluster management endpoint and default + * admin client. + * + * @return the certificate value. + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate property: The certificate to use for securing the cluster. The certificate provided will be + * used for node to node security within the cluster, SSL certificate for cluster management endpoint and default + * admin client. + * + * @param certificate the certificate value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the certificateCommonNames property: Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + * + * @return the certificateCommonNames value. + */ + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; + } + + /** + * Set the certificateCommonNames property: Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + * + * @param certificateCommonNames the certificateCommonNames value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; + return this; + } + + /** + * Get the clientCertificateCommonNames property: The list of client certificates referenced by common name that are + * allowed to manage the cluster. + * + * @return the clientCertificateCommonNames value. + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the clientCertificateCommonNames property: The list of client certificates referenced by common name that are + * allowed to manage the cluster. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateCommonNames( + List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the clientCertificateThumbprints property: The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + * + * @return the clientCertificateThumbprints value. + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the clientCertificateThumbprints property: The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateThumbprints( + List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the clusterEndpoint property: The Azure Resource Provider endpoint. A system service in the cluster connects + * to this endpoint. + * + * @return the clusterEndpoint value. + */ + public String clusterEndpoint() { + return this.clusterEndpoint; + } + + /** + * Get the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the clusterState property: 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. + * + * @return the clusterState value. + */ + public ClusterState clusterState() { + return this.clusterState; + } + + /** + * Get the diagnosticsStorageAccountConfig property: The storage account information for storing Service Fabric + * diagnostic logs. + * + * @return the diagnosticsStorageAccountConfig value. + */ + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.diagnosticsStorageAccountConfig; + } + + /** + * Set the diagnosticsStorageAccountConfig property: The storage account information for storing Service Fabric + * diagnostic logs. + * + * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withDiagnosticsStorageAccountConfig( + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; + return this; + } + + /** + * Get the eventStoreServiceEnabled property: Indicates if the event store service is enabled. + * + * @return the eventStoreServiceEnabled value. + */ + public Boolean eventStoreServiceEnabled() { + return this.eventStoreServiceEnabled; + } + + /** + * Set the eventStoreServiceEnabled property: Indicates if the event store service is enabled. + * + * @param eventStoreServiceEnabled the eventStoreServiceEnabled value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEventStoreServiceEnabled(Boolean eventStoreServiceEnabled) { + this.eventStoreServiceEnabled = eventStoreServiceEnabled; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the managementEndpoint property: The http management endpoint of the cluster. + * + * @return the managementEndpoint value. + */ + public String managementEndpoint() { + return this.managementEndpoint; + } + + /** + * Set the managementEndpoint property: The http management endpoint of the cluster. + * + * @param managementEndpoint the managementEndpoint value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withManagementEndpoint(String managementEndpoint) { + this.managementEndpoint = managementEndpoint; + return this; + } + + /** + * Get the nodeTypes property: The list of node types in the cluster. + * + * @return the nodeTypes value. + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes property: The list of node types in the cluster. + * + * @param nodeTypes the nodeTypes value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the reliabilityLevel property: 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. + * + * @return the reliabilityLevel value. + */ + public ReliabilityLevel reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliabilityLevel property: 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. + * + * @param reliabilityLevel the reliabilityLevel value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withReliabilityLevel(ReliabilityLevel reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get the reverseProxyCertificate property: The server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value. + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the reverseProxyCertificate property: The server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the reverseProxyCertificateCommonNames property: Describes a list of server certificates referenced by common + * name that are used to secure the cluster. + * + * @return the reverseProxyCertificateCommonNames value. + */ + public ServerCertificateCommonNames reverseProxyCertificateCommonNames() { + return this.reverseProxyCertificateCommonNames; + } + + /** + * Set the reverseProxyCertificateCommonNames property: Describes a list of server certificates referenced by common + * name that are used to secure the cluster. + * + * @param reverseProxyCertificateCommonNames the reverseProxyCertificateCommonNames value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withReverseProxyCertificateCommonNames( + ServerCertificateCommonNames reverseProxyCertificateCommonNames) { + this.reverseProxyCertificateCommonNames = reverseProxyCertificateCommonNames; + return this; + } + + /** + * Get the upgradeDescription property: The policy to use when upgrading the cluster. + * + * @return the upgradeDescription value. + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the upgradeDescription property: The policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime version is + * available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon + * as it is available. - Manual - 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. + * + * @return the upgradeMode value. + */ + public UpgradeMode upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime version is + * available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon + * as it is available. - Manual - 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. + * + * @param upgradeMode the upgradeMode value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeMode(UpgradeMode upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.applicationTypeVersionsCleanupPolicy; + } + + /** + * Set the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @param applicationTypeVersionsCleanupPolicy the applicationTypeVersionsCleanupPolicy value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + this.applicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + return this; + } + + /** + * Get the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows or Linux can + * be used. + * + * @return the vmImage value. + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows or Linux can + * be used. + * + * @param vmImage the vmImage value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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 (nodeTypes() != null) { + 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(); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterListResultInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterListResultInner.java new file mode 100644 index 0000000000000..26d90cb9688ee --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterListResultInner.java @@ -0,0 +1,80 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster list results. */ +@Fluent +public final class ClusterListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterListResultInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ClusterListResultInner object itself. + */ + public ClusterListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ClusterListResultInner object itself. + */ + public ClusterListResultInner 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()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java new file mode 100644 index 0000000000000..8dd5287c3bec2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java @@ -0,0 +1,479 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.ClientCertificate; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.LoadBalancingRule; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterAddOnFeature; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The manged cluster resource. */ +@JsonFlatten +@Fluent +public class ManagedClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterInner.class); + + /* + * The sku of the managed cluster + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The cluster dns name. + */ + @JsonProperty(value = "properties.dnsName") + private String dnsName; + + /* + * the cluster Fully qualified domain name. + */ + @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * A service generated unique identifier for the cluster resource. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The current state of the cluster. + */ + @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterState clusterState; + + /* + * The cluster certificate thumbprint used node to node communication. + */ + @JsonProperty(value = "properties.clusterCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterCertificateThumbprint; + + /* + * The port used for client connections to the cluster. + */ + @JsonProperty(value = "properties.clientConnectionPort") + private Integer clientConnectionPort; + + /* + * The port used for http connections to the cluster. + */ + @JsonProperty(value = "properties.httpGatewayConnectionPort") + private Integer httpGatewayConnectionPort; + + /* + * vm admin user name. + */ + @JsonProperty(value = "properties.adminUserName") + private String adminUsername; + + /* + * vm admin user password. + */ + @JsonProperty(value = "properties.adminPassword") + private String adminPassword; + + /* + * Describes load balancing rules. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.clients") + private List clients; + + /* + * Azure active directory. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * The provisioning state of the managed cluster resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedResourceProvisioningState provisioningState; + + /* + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.addonFeatures") + private List addonFeatures; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the sku property: The sku of the managed cluster. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of the managed cluster. + * + * @param sku the sku value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the dnsName property: The cluster dns name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: The cluster dns name. + * + * @param dnsName the dnsName value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the fqdn property: the cluster Fully qualified domain name. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the clusterState property: The current state of the cluster. + * + * @return the clusterState value. + */ + public ClusterState clusterState() { + return this.clusterState; + } + + /** + * Get the clusterCertificateThumbprint property: The cluster certificate thumbprint used node to node + * communication. + * + * @return the clusterCertificateThumbprint value. + */ + public String clusterCertificateThumbprint() { + return this.clusterCertificateThumbprint; + } + + /** + * Get the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + public Integer clientConnectionPort() { + return this.clientConnectionPort; + } + + /** + * Set the clientConnectionPort property: The port used for client connections to the cluster. + * + * @param clientConnectionPort the clientConnectionPort value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withClientConnectionPort(Integer clientConnectionPort) { + this.clientConnectionPort = clientConnectionPort; + return this; + } + + /** + * Get the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + public Integer httpGatewayConnectionPort() { + return this.httpGatewayConnectionPort; + } + + /** + * Set the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @param httpGatewayConnectionPort the httpGatewayConnectionPort value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + this.httpGatewayConnectionPort = httpGatewayConnectionPort; + return this; + } + + /** + * Get the adminUsername property: vm admin user name. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: vm admin user name. + * + * @param adminUsername the adminUsername value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: vm admin user password. + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: vm admin user password. + * + * @param adminPassword the adminPassword value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set the loadBalancingRules property: Describes load balancing rules. + * + * @param loadBalancingRules the loadBalancingRules value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + public List clients() { + return this.clients; + } + + /** + * Set the clients property: client certificates for the cluster. + * + * @param clients the clients value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withClients(List clients) { + this.clients = clients; + return this; + } + + /** + * Get the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: Azure active directory. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + public ManagedResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + public List addonFeatures() { + return this.addonFeatures; + } + + /** + * Set the addonFeatures property: client certificates for the cluster. + * + * @param addonFeatures the addonFeatures value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAddonFeatures(List addonFeatures) { + this.addonFeatures = addonFeatures; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (loadBalancingRules() != null) { + loadBalancingRules().forEach(e -> e.validate()); + } + if (clients() != null) { + clients().forEach(e -> e.validate()); + } + if (azureActiveDirectory() != null) { + azureActiveDirectory().validate(); + } + if (fabricSettings() != null) { + fabricSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java new file mode 100644 index 0000000000000..6d8c1241e9732 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java @@ -0,0 +1,103 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.ClusterOsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The detail of the Service Fabric runtime version. */ +@Fluent +public final class ManagedClusterVersionDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterVersionDetailsInner.class); + + /* + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "msiVersion") + private String msiVersion; + + /* + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /* + * Indicates the operating system of the cluster. + */ + @JsonProperty(value = "osType") + private ClusterOsType osType; + + /** + * Get the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @return the msiVersion value. + */ + public String msiVersion() { + return this.msiVersion; + } + + /** + * Set the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @param msiVersion the msiVersion value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withMsiVersion(String msiVersion) { + this.msiVersion = msiVersion; + return this; + } + + /** + * Get the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the supportExpiryUtc property: The date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get the osType property: Indicates the operating system of the cluster. + * + * @return the osType value. + */ + public ClusterOsType osType() { + return this.osType; + } + + /** + * Set the osType property: Indicates the operating system of the cluster. + * + * @param osType the osType value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withOsType(ClusterOsType osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java new file mode 100644 index 0000000000000..bfa6fbb0ecb2f --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java @@ -0,0 +1,466 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription; +import com.azure.resourcemanager.servicefabric.models.ManagedProxyResource; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.VaultSecretGroup; +import com.azure.resourcemanager.servicefabric.models.VmssExtension; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. */ +@JsonFlatten +@Fluent +public class NodeTypeInner extends ManagedProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeInner.class); + + /* + * The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or + * changed for existing clusters. + */ + @JsonProperty(value = "properties.isPrimary") + private Boolean isPrimary; + + /* + * The number of nodes in the node type. + */ + @JsonProperty(value = "properties.vmInstanceCount") + private Integer vmInstanceCount; + + /* + * Disk size for each vm in the node type in GBs. + */ + @JsonProperty(value = "properties.dataDiskSizeGB") + private Integer dataDiskSizeGB; + + /* + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "properties.placementProperties") + private Map placementProperties; + + /* + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node + * has. + */ + @JsonProperty(value = "properties.capacities") + private Map capacities; + + /* + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "properties.applicationPorts") + private EndpointRangeDescription applicationPorts; + + /* + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "properties.ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /* + * The size of virtual machines in the pool. All virtual machines in a pool + * are the same size. For example, Standard_D3. + */ + @JsonProperty(value = "properties.vmSize") + private String vmSize; + + /* + * The publisher of the Azure Virtual Machines Marketplace image. For + * example, Canonical or MicrosoftWindowsServer. + */ + @JsonProperty(value = "properties.vmImagePublisher") + private String vmImagePublisher; + + /* + * The offer type of the Azure Virtual Machines Marketplace image. For + * example, UbuntuServer or WindowsServer. + */ + @JsonProperty(value = "properties.vmImageOffer") + private String vmImageOffer; + + /* + * The SKU of the Azure Virtual Machines Marketplace image. For example, + * 14.04.0-LTS or 2012-R2-Datacenter. + */ + @JsonProperty(value = "properties.vmImageSku") + private String vmImageSku; + + /* + * The version of the Azure Virtual Machines Marketplace image. A value of + * 'latest' can be specified to select the latest version of an image. If + * omitted, the default is 'latest'. + */ + @JsonProperty(value = "properties.vmImageVersion") + private String vmImageVersion; + + /* + * The secrets to install in the virtual machines. + */ + @JsonProperty(value = "properties.vmSecrets") + private List vmSecrets; + + /* + * Set of extensions that should be installed onto the virtual machines. + */ + @JsonProperty(value = "properties.vmExtensions") + private List vmExtensions; + + /* + * The provisioning state of the managed cluster resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedResourceProvisioningState provisioningState; + + /** + * Get the isPrimary property: The node type on which system services will run. Only one node type should be marked + * as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @return the isPrimary value. + */ + public Boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the isPrimary property: The node type on which system services will run. Only one node type should be marked + * as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @param isPrimary the isPrimary value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + public Integer vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the vmInstanceCount property: The number of nodes in the node type. + * + * @param vmInstanceCount the vmInstanceCount value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmInstanceCount(Integer vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @return the dataDiskSizeGB value. + */ + public Integer dataDiskSizeGB() { + return this.dataDiskSizeGB; + } + + /** + * Set the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @param dataDiskSizeGB the dataDiskSizeGB value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withDataDiskSizeGB(Integer dataDiskSizeGB) { + this.dataDiskSizeGB = dataDiskSizeGB; + return this; + } + + /** + * Get the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @return the placementProperties value. + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @return the capacities value. + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @param capacities the capacities value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @return the applicationPorts value. + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @param applicationPorts the applicationPorts value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @return the ephemeralPorts value. + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @param ephemeralPorts the ephemeralPorts value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @param vmSize the vmSize value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @return the vmImagePublisher value. + */ + public String vmImagePublisher() { + return this.vmImagePublisher; + } + + /** + * Set the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @param vmImagePublisher the vmImagePublisher value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImagePublisher(String vmImagePublisher) { + this.vmImagePublisher = vmImagePublisher; + return this; + } + + /** + * Get the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @return the vmImageOffer value. + */ + public String vmImageOffer() { + return this.vmImageOffer; + } + + /** + * Set the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @param vmImageOffer the vmImageOffer value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageOffer(String vmImageOffer) { + this.vmImageOffer = vmImageOffer; + return this; + } + + /** + * Get the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * + * @return the vmImageSku value. + */ + public String vmImageSku() { + return this.vmImageSku; + } + + /** + * Set the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * + * @param vmImageSku the vmImageSku value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageSku(String vmImageSku) { + this.vmImageSku = vmImageSku; + return this; + } + + /** + * Get the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @return the vmImageVersion value. + */ + public String vmImageVersion() { + return this.vmImageVersion; + } + + /** + * Set the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @param vmImageVersion the vmImageVersion value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageVersion(String vmImageVersion) { + this.vmImageVersion = vmImageVersion; + return this; + } + + /** + * Get the vmSecrets property: The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + public List vmSecrets() { + return this.vmSecrets; + } + + /** + * Set the vmSecrets property: The secrets to install in the virtual machines. + * + * @param vmSecrets the vmSecrets value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmSecrets(List vmSecrets) { + this.vmSecrets = vmSecrets; + return this; + } + + /** + * Get the vmExtensions property: Set of extensions that should be installed onto the virtual machines. + * + * @return the vmExtensions value. + */ + public List vmExtensions() { + return this.vmExtensions; + } + + /** + * Set the vmExtensions property: Set of extensions that should be installed onto the virtual machines. + * + * @param vmExtensions the vmExtensions value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmExtensions(List vmExtensions) { + this.vmExtensions = vmExtensions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + public ManagedResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public NodeTypeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (applicationPorts() != null) { + applicationPorts().validate(); + } + if (ephemeralPorts() != null) { + ephemeralPorts().validate(); + } + if (vmSecrets() != null) { + vmSecrets().forEach(e -> e.validate()); + } + if (vmExtensions() != null) { + vmExtensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/OperationResultInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/OperationResultInner.java new file mode 100644 index 0000000000000..0fded240ded85 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/OperationResultInner.java @@ -0,0 +1,132 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Available operation list result. */ +@Fluent +public final class OperationResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInner.class); + + /* + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /* + * Origin result + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation. + * + * @param name the name value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin result. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin result. + * + * @param origin the origin value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java new file mode 100644 index 0000000000000..c415e83332002 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java @@ -0,0 +1,388 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.ServiceLoadMetricDescription; +import com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyDescription; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The service resource. */ +@JsonFlatten +@Fluent +public class ServiceResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceInner.class); + + /* + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /* + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /* + * Specifies the move cost for the service. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private MoveCost defaultMoveCost; + + /* + * The current deployment or provisioning state, which only appears in the + * response + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The name of the service type + */ + @JsonProperty(value = "properties.serviceTypeName") + private String serviceTypeName; + + /* + * Describes how the service is partitioned. + */ + @JsonProperty(value = "properties.partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /* + * The activation Mode of the service package + */ + @JsonProperty(value = "properties.servicePackageActivationMode") + 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. + */ + @JsonProperty(value = "properties.serviceDnsName") + private String serviceDnsName; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @return the placementConstraints value. + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @param placementConstraints the placementConstraints value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @return the correlationScheme value. + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @param correlationScheme the correlationScheme value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @return the serviceLoadMetrics value. + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @return the servicePlacementPolicies value. + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServicePlacementPolicies( + List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost property: Specifies the move cost for the service. + * + * @return the defaultMoveCost value. + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost property: Specifies the move cost for the service. + * + * @param defaultMoveCost the defaultMoveCost value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceTypeName property: The name of the service type. + * + * @return the serviceTypeName value. + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the serviceTypeName property: The name of the service type. + * + * @param serviceTypeName the serviceTypeName value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription property: Describes how the service is partitioned. + * + * @return the partitionDescription value. + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription property: Describes how the service is partitioned. + * + * @param partitionDescription the partitionDescription value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get the servicePackageActivationMode property: The activation Mode of the service package. + * + * @return the servicePackageActivationMode value. + */ + public ArmServicePackageActivationMode servicePackageActivationMode() { + return this.servicePackageActivationMode; + } + + /** + * Set the servicePackageActivationMode property: The activation Mode of the service package. + * + * @param servicePackageActivationMode the servicePackageActivationMode value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServicePackageActivationMode( + ArmServicePackageActivationMode servicePackageActivationMode) { + this.servicePackageActivationMode = servicePackageActivationMode; + return this; + } + + /** + * 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. + * + * @return the serviceDnsName value. + */ + public String serviceDnsName() { + return this.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. + * + * @param serviceDnsName the serviceDnsName value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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()); + } + if (partitionDescription() != null) { + partitionDescription().validate(); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceListInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceListInner.java new file mode 100644 index 0000000000000..beaaa753f70b6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceListInner.java @@ -0,0 +1,69 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of service resources. */ +@Fluent +public final class ServiceResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceListInner.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of service list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..c88aa4b76eeeb --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ServiceFabricManagementClient. Service Fabric Management 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 new file mode 100644 index 0000000000000..6360be298531a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ServiceFabricManagementClient. Service Fabric Management 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 new file mode 100644 index 0000000000000..f9a0bf1b65c47 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java @@ -0,0 +1,333 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationMetricDescription; +import com.azure.resourcemanager.servicefabric.models.ApplicationResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate; +import com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity; +import com.azure.resourcemanager.servicefabric.models.ManagedIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationResourceImpl + implements ApplicationResource, ApplicationResource.Definition, ApplicationResource.Update { + private ApplicationResourceInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedIdentity identity() { + return this.innerModel().identity(); + } + + public String typeVersion() { + return this.innerModel().typeVersion(); + } + + public Map parameters() { + Map inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApplicationUpgradePolicy upgradePolicy() { + return this.innerModel().upgradePolicy(); + } + + public Long minimumNodes() { + return this.innerModel().minimumNodes(); + } + + public Long maximumNodes() { + return this.innerModel().maximumNodes(); + } + + public Boolean removeApplicationCapacity() { + return this.innerModel().removeApplicationCapacity(); + } + + public List metrics() { + List inner = this.innerModel().metrics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List managedIdentities() { + List inner = this.innerModel().managedIdentities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String typeName() { + return this.innerModel().typeName(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationResourceInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String applicationName; + + private ApplicationResourceUpdate updateParameters; + + public ApplicationResourceImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ApplicationResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, clusterName, applicationName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, clusterName, applicationName, this.innerModel(), context); + return this; + } + + ApplicationResourceImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ApplicationResourceInner(); + this.serviceManager = serviceManager; + this.applicationName = name; + } + + public ApplicationResourceImpl update() { + this.updateParameters = new ApplicationResourceUpdate(); + return this; + } + + public ApplicationResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .update(resourceGroupName, clusterName, applicationName, updateParameters, Context.NONE); + return this; + } + + public ApplicationResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .update(resourceGroupName, clusterName, applicationName, updateParameters, context); + return this; + } + + ApplicationResourceImpl(ApplicationResourceInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + } + + public ApplicationResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, clusterName, applicationName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, clusterName, applicationName, context) + .getValue(); + return this; + } + + public ApplicationResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplicationResourceImpl withIdentity(ManagedIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ApplicationResourceImpl withTypeVersion(String typeVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeVersion(typeVersion); + return this; + } else { + this.updateParameters.withTypeVersion(typeVersion); + return this; + } + } + + public ApplicationResourceImpl withParameters(Map parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateParameters.withParameters(parameters); + return this; + } + } + + public ApplicationResourceImpl withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + if (isInCreateMode()) { + this.innerModel().withUpgradePolicy(upgradePolicy); + return this; + } else { + this.updateParameters.withUpgradePolicy(upgradePolicy); + return this; + } + } + + public ApplicationResourceImpl withMinimumNodes(Long minimumNodes) { + if (isInCreateMode()) { + this.innerModel().withMinimumNodes(minimumNodes); + return this; + } else { + this.updateParameters.withMinimumNodes(minimumNodes); + return this; + } + } + + public ApplicationResourceImpl withMaximumNodes(Long maximumNodes) { + if (isInCreateMode()) { + this.innerModel().withMaximumNodes(maximumNodes); + return this; + } else { + this.updateParameters.withMaximumNodes(maximumNodes); + return this; + } + } + + public ApplicationResourceImpl withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + if (isInCreateMode()) { + this.innerModel().withRemoveApplicationCapacity(removeApplicationCapacity); + return this; + } else { + this.updateParameters.withRemoveApplicationCapacity(removeApplicationCapacity); + return this; + } + } + + public ApplicationResourceImpl withMetrics(List metrics) { + if (isInCreateMode()) { + this.innerModel().withMetrics(metrics); + return this; + } else { + this.updateParameters.withMetrics(metrics); + return this; + } + } + + public ApplicationResourceImpl withManagedIdentities(List managedIdentities) { + if (isInCreateMode()) { + this.innerModel().withManagedIdentities(managedIdentities); + return this; + } else { + this.updateParameters.withManagedIdentities(managedIdentities); + return this; + } + } + + public ApplicationResourceImpl withTypeName(String typeName) { + this.innerModel().withTypeName(typeName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceListImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceListImpl.java new file mode 100644 index 0000000000000..191c478e358ba --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceListImpl.java @@ -0,0 +1,51 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationResourceList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ApplicationResourceListImpl implements ApplicationResourceList { + private ApplicationResourceListInner innerObject; + + private final ServiceFabricManager serviceManager; + + ApplicationResourceListImpl(ApplicationResourceListInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ApplicationResourceListInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceImpl.java new file mode 100644 index 0000000000000..a377863880c69 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceImpl.java @@ -0,0 +1,178 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; +import java.util.Collections; +import java.util.Map; + +public final class ApplicationTypeResourceImpl + implements ApplicationTypeResource, ApplicationTypeResource.Definition, ApplicationTypeResource.Update { + private ApplicationTypeResourceInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationTypeResourceInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String applicationTypeName; + + public ApplicationTypeResourceImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ApplicationTypeResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .createOrUpdateWithResponse( + resourceGroupName, clusterName, applicationTypeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ApplicationTypeResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .createOrUpdateWithResponse( + resourceGroupName, clusterName, applicationTypeName, this.innerModel(), context) + .getValue(); + return this; + } + + ApplicationTypeResourceImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ApplicationTypeResourceInner(); + this.serviceManager = serviceManager; + this.applicationTypeName = name; + } + + public ApplicationTypeResourceImpl update() { + return this; + } + + public ApplicationTypeResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .createOrUpdateWithResponse( + resourceGroupName, clusterName, applicationTypeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ApplicationTypeResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .createOrUpdateWithResponse( + resourceGroupName, clusterName, applicationTypeName, this.innerModel(), context) + .getValue(); + return this; + } + + ApplicationTypeResourceImpl(ApplicationTypeResourceInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.applicationTypeName = Utils.getValueFromIdByName(innerObject.id(), "applicationTypes"); + } + + public ApplicationTypeResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .getWithResponse(resourceGroupName, clusterName, applicationTypeName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationTypeResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypes() + .getWithResponse(resourceGroupName, clusterName, applicationTypeName, context) + .getValue(); + return this; + } + + public ApplicationTypeResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationTypeResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationTypeResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceListImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceListImpl.java new file mode 100644 index 0000000000000..d659f61d60ca3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeResourceListImpl.java @@ -0,0 +1,51 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResourceList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ApplicationTypeResourceListImpl implements ApplicationTypeResourceList { + private ApplicationTypeResourceListInner innerObject; + + private final ServiceFabricManager serviceManager; + + ApplicationTypeResourceListImpl(ApplicationTypeResourceListInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationTypeResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ApplicationTypeResourceListInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..d62290614006f --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceImpl.java @@ -0,0 +1,200 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResource; +import java.util.Collections; +import java.util.Map; + +public final class ApplicationTypeVersionResourceImpl + implements ApplicationTypeVersionResource, + ApplicationTypeVersionResource.Definition, + ApplicationTypeVersionResource.Update { + private ApplicationTypeVersionResourceInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String appPackageUrl() { + return this.innerModel().appPackageUrl(); + } + + public Map defaultParameterList() { + Map inner = this.innerModel().defaultParameterList(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApplicationTypeVersionResourceInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String applicationTypeName; + + private String version; + + public ApplicationTypeVersionResourceImpl withExistingApplicationType( + String resourceGroupName, String clusterName, String applicationTypeName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.applicationTypeName = applicationTypeName; + return this; + } + + public ApplicationTypeVersionResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .createOrUpdate( + resourceGroupName, clusterName, applicationTypeName, version, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationTypeVersionResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .createOrUpdate( + resourceGroupName, clusterName, applicationTypeName, version, this.innerModel(), context); + return this; + } + + ApplicationTypeVersionResourceImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ApplicationTypeVersionResourceInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public ApplicationTypeVersionResourceImpl update() { + return this; + } + + public ApplicationTypeVersionResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .createOrUpdate( + resourceGroupName, clusterName, applicationTypeName, version, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationTypeVersionResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .createOrUpdate( + resourceGroupName, clusterName, applicationTypeName, version, this.innerModel(), context); + return this; + } + + ApplicationTypeVersionResourceImpl( + ApplicationTypeVersionResourceInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.applicationTypeName = Utils.getValueFromIdByName(innerObject.id(), "applicationTypes"); + this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public ApplicationTypeVersionResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .getWithResponse(resourceGroupName, clusterName, applicationTypeName, version, Context.NONE) + .getValue(); + return this; + } + + public ApplicationTypeVersionResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationTypeVersions() + .getWithResponse(resourceGroupName, clusterName, applicationTypeName, version, context) + .getValue(); + return this; + } + + public ApplicationTypeVersionResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationTypeVersionResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationTypeVersionResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + 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/ApplicationTypeVersionResourceListImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceListImpl.java new file mode 100644 index 0000000000000..5be8d874b559d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionResourceListImpl.java @@ -0,0 +1,52 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResourceList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ApplicationTypeVersionResourceListImpl implements ApplicationTypeVersionResourceList { + private ApplicationTypeVersionResourceListInner innerObject; + + private final ServiceFabricManager serviceManager; + + ApplicationTypeVersionResourceListImpl( + ApplicationTypeVersionResourceListInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationTypeVersionResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ApplicationTypeVersionResourceListInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..61656b2ff5ca5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java @@ -0,0 +1,1146 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +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.fluent.models.ApplicationTypeVersionResourceListInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationTypeVersionsClient. */ +public final class ApplicationTypeVersionsClientImpl implements ApplicationTypeVersionsClient { + private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationTypeVersionsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationTypeVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationTypeVersionsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy + .create(ApplicationTypeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientApplicationTypeVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @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); + + @Headers({"Content-Type: application/json"}) + @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, + @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); + + @Headers({"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, + @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); + + @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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("applicationTypeName") String applicationTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationTypeVersionResourceInner get( + String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return getAsync(resourceGroupName, clusterName, applicationTypeName, version).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationTypeVersionResourceInner.class, + ApplicationTypeVersionResourceInner.class, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationTypeVersionResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters) + .getSyncPoller(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationTypeVersionResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, applicationTypeName, version, parameters, context) + .getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String applicationTypeName, + String version, + ApplicationTypeVersionResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, version, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + version, + apiVersion, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version).getSyncPoller(); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String applicationTypeName, String version) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 the completion. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + deleteAsync(resourceGroupName, clusterName, applicationTypeName, version).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { + deleteAsync(resourceGroupName, clusterName, applicationTypeName, version, context).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String clusterName, String applicationTypeName) { + return listWithResponseAsync(resourceGroupName, clusterName, applicationTypeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationTypeVersionResourceListInner list( + String resourceGroupName, String clusterName, String applicationTypeName) { + return listAsync(resourceGroupName, clusterName, applicationTypeName).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + return listWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, context).block(); + } +} 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 new file mode 100644 index 0000000000000..ead35698a0909 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsImpl.java @@ -0,0 +1,246 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionResourceList; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationTypeVersionsImpl implements ApplicationTypeVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionsImpl.class); + + private final ApplicationTypeVersionsClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ApplicationTypeVersionsImpl(ApplicationTypeVersionsClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApplicationTypeVersionResource get( + String resourceGroupName, String clusterName, String applicationTypeName, String version) { + ApplicationTypeVersionResourceInner inner = + this.serviceClient().get(resourceGroupName, clusterName, applicationTypeName, version); + if (inner != null) { + return new ApplicationTypeVersionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, 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; + } + } + + public void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationTypeName, version); + } + + public void delete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationTypeName, version, context); + } + + public ApplicationTypeVersionResourceList list( + String resourceGroupName, String clusterName, String applicationTypeName) { + ApplicationTypeVersionResourceListInner inner = + this.serviceClient().list(resourceGroupName, clusterName, applicationTypeName); + if (inner != null) { + return new ApplicationTypeVersionResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, clusterName, applicationTypeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationTypeVersionResourceListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationTypeVersionResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, applicationTypeName, version, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationTypeName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationTypeName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationTypeName, version, context); + } + + private ApplicationTypeVersionsClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ApplicationTypeVersionResourceImpl define(String name) { + return new ApplicationTypeVersionResourceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 0000000000000..46751dcaa3201 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java @@ -0,0 +1,927 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +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.fluent.models.ApplicationTypeResourceListInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationTypesClient. */ +public final class ApplicationTypesClientImpl implements ApplicationTypesClient { + private final ClientLogger logger = new ClientLogger(ApplicationTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationTypesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationTypesClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientApplicationTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @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"}) + @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, + @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); + + @Headers({"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, + @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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String applicationTypeName) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationTypeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationTypeResourceInner get(String resourceGroupName, String clusterName, String applicationTypeName) { + return getAsync(resourceGroupName, clusterName, applicationTypeName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String applicationTypeName, + ApplicationTypeResourceInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationTypeResourceInner createOrUpdate( + String resourceGroupName, + String clusterName, + String applicationTypeName, + ApplicationTypeResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, parameters).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationTypeName, + apiVersion, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationTypeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName).getSyncPoller(); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationTypeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 the completion. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationTypeName) { + deleteAsync(resourceGroupName, clusterName, applicationTypeName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + deleteAsync(resourceGroupName, clusterName, applicationTypeName, context).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + apiVersion, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String clusterName) { + return listWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationTypeResourceListInner list(String resourceGroupName, String clusterName) { + return listAsync(resourceGroupName, clusterName).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + return listWithResponseAsync(resourceGroupName, clusterName, context).block(); + } +} 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 new file mode 100644 index 0000000000000..dc900256bf971 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesImpl.java @@ -0,0 +1,212 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeResourceList; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationTypesImpl implements ApplicationTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypesImpl.class); + + private final ApplicationTypesClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ApplicationTypesImpl(ApplicationTypesClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApplicationTypeResource get(String resourceGroupName, String clusterName, String applicationTypeName) { + ApplicationTypeResourceInner inner = + this.serviceClient().get(resourceGroupName, clusterName, applicationTypeName); + if (inner != null) { + return new ApplicationTypeResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, 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; + } + } + + public void delete(String resourceGroupName, String clusterName, String applicationTypeName) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationTypeName); + } + + public void delete(String resourceGroupName, String clusterName, String applicationTypeName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationTypeName, context); + } + + public ApplicationTypeResourceList list(String resourceGroupName, String clusterName) { + ApplicationTypeResourceListInner inner = this.serviceClient().list(resourceGroupName, clusterName); + if (inner != null) { + return new ApplicationTypeResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationTypeResourceListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationTypeResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationTypeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationTypeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationTypeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationTypeName = Utils.getValueFromIdByName(id, "applicationTypes"); + if (applicationTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationTypeName, context); + } + + private ApplicationTypesClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ApplicationTypeResourceImpl define(String name) { + return new ApplicationTypeResourceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 0000000000000..5883e490450d9 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java @@ -0,0 +1,1365 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +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.fluent.models.ApplicationResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +public final class ApplicationsClientImpl implements ApplicationsClient { + private final ClientLogger logger = new ClientLogger(ApplicationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientApplications to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @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"}) + @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, + @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, + 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, + @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, + Context context); + + @Headers({"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, + @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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String applicationName) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceInner get(String resourceGroupName, String clusterName, String applicationName) { + return getAsync(resourceGroupName, clusterName, applicationName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationResourceInner.class, + ApplicationResourceInner.class, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters).getSyncPoller(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context) + .getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceInner createOrUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationResourceInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationResourceInner.class, + ApplicationResourceInner.class, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationResourceInner> beginUpdate( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters).getSyncPoller(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationResourceUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceInner update( + String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters) { + return updateAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName).getSyncPoller(); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 the completion. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteAsync(resourceGroupName, clusterName, applicationName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { + deleteAsync(resourceGroupName, clusterName, applicationName, context).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + apiVersion, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String clusterName) { + return listWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationResourceListInner list(String resourceGroupName, String clusterName) { + return listAsync(resourceGroupName, clusterName).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + return listWithResponseAsync(resourceGroupName, clusterName, context).block(); + } +} 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 new file mode 100644 index 0000000000000..9fbd9cee9d4bf --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsImpl.java @@ -0,0 +1,203 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ApplicationResource; +import com.azure.resourcemanager.servicefabric.models.ApplicationResourceList; +import com.azure.resourcemanager.servicefabric.models.Applications; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationsImpl implements Applications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationsImpl.class); + + private final ApplicationsClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ApplicationsImpl(ApplicationsClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApplicationResource get(String resourceGroupName, String clusterName, String applicationName) { + ApplicationResourceInner inner = this.serviceClient().get(resourceGroupName, clusterName, applicationName); + if (inner != null) { + return new ApplicationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, 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; + } + } + + public void delete(String resourceGroupName, String clusterName, String applicationName) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName); + } + + public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName, context); + } + + public ApplicationResourceList list(String resourceGroupName, String clusterName) { + ApplicationResourceListInner inner = this.serviceClient().list(resourceGroupName, clusterName); + if (inner != null) { + return new ApplicationResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationResourceListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, context); + } + + private ApplicationsClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ApplicationResourceImpl define(String name) { + return new ApplicationResourceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 0000000000000..32ded02209146 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterCodeVersionsListResultImpl.java @@ -0,0 +1,45 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterCodeVersionsListResult; +import com.azure.resourcemanager.servicefabric.models.ClusterCodeVersionsResult; +import java.util.Collections; +import java.util.List; + +public final class ClusterCodeVersionsListResultImpl implements ClusterCodeVersionsListResult { + private ClusterCodeVersionsListResultInner innerObject; + + private final ServiceFabricManager serviceManager; + + ClusterCodeVersionsListResultImpl( + ClusterCodeVersionsListResultInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ClusterCodeVersionsListResultInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..155edc9c1df14 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java @@ -0,0 +1,487 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import com.azure.resourcemanager.servicefabric.models.AddOnFeatures; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionsCleanupPolicy; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.CertificateDescription; +import com.azure.resourcemanager.servicefabric.models.ClientCertificateCommonName; +import com.azure.resourcemanager.servicefabric.models.ClientCertificateThumbprint; +import com.azure.resourcemanager.servicefabric.models.Cluster; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.ClusterUpdateParameters; +import com.azure.resourcemanager.servicefabric.models.ClusterUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ClusterVersionDetails; +import com.azure.resourcemanager.servicefabric.models.DiagnosticsStorageAccountConfig; +import com.azure.resourcemanager.servicefabric.models.NodeTypeDescription; +import com.azure.resourcemanager.servicefabric.models.ProvisioningState; +import com.azure.resourcemanager.servicefabric.models.ReliabilityLevel; +import com.azure.resourcemanager.servicefabric.models.ServerCertificateCommonNames; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.UpgradeMode; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List addOnFeatures() { + List inner = this.innerModel().addOnFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List availableClusterVersions() { + List inner = this.innerModel().availableClusterVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureActiveDirectory azureActiveDirectory() { + return this.innerModel().azureActiveDirectory(); + } + + public CertificateDescription certificate() { + return this.innerModel().certificate(); + } + + public ServerCertificateCommonNames certificateCommonNames() { + return this.innerModel().certificateCommonNames(); + } + + public List clientCertificateCommonNames() { + List inner = this.innerModel().clientCertificateCommonNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clientCertificateThumbprints() { + List inner = this.innerModel().clientCertificateThumbprints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String clusterCodeVersion() { + return this.innerModel().clusterCodeVersion(); + } + + public String clusterEndpoint() { + return this.innerModel().clusterEndpoint(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public ClusterState clusterState() { + return this.innerModel().clusterState(); + } + + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.innerModel().diagnosticsStorageAccountConfig(); + } + + public Boolean eventStoreServiceEnabled() { + return this.innerModel().eventStoreServiceEnabled(); + } + + public List fabricSettings() { + List inner = this.innerModel().fabricSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String managementEndpoint() { + return this.innerModel().managementEndpoint(); + } + + public List nodeTypes() { + List inner = this.innerModel().nodeTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ReliabilityLevel reliabilityLevel() { + return this.innerModel().reliabilityLevel(); + } + + public CertificateDescription reverseProxyCertificate() { + return this.innerModel().reverseProxyCertificate(); + } + + public ServerCertificateCommonNames reverseProxyCertificateCommonNames() { + return this.innerModel().reverseProxyCertificateCommonNames(); + } + + public ClusterUpgradePolicy upgradeDescription() { + return this.innerModel().upgradeDescription(); + } + + public UpgradeMode upgradeMode() { + return this.innerModel().upgradeMode(); + } + + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.innerModel().applicationTypeVersionsCleanupPolicy(); + } + + public String vmImage() { + return this.innerModel().vmImage(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ClusterUpdateParameters updateParameters; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateParameters = new ClusterUpdateParameters(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateParameters, Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateParameters, context); + return this; + } + + ClusterImpl(ClusterInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ClusterImpl withAddOnFeatures(List addOnFeatures) { + if (isInCreateMode()) { + this.innerModel().withAddOnFeatures(addOnFeatures); + return this; + } else { + this.updateParameters.withAddOnFeatures(addOnFeatures); + return this; + } + } + + public ClusterImpl withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.innerModel().withAzureActiveDirectory(azureActiveDirectory); + return this; + } + + public ClusterImpl withCertificate(CertificateDescription certificate) { + if (isInCreateMode()) { + this.innerModel().withCertificate(certificate); + return this; + } else { + this.updateParameters.withCertificate(certificate); + return this; + } + } + + public ClusterImpl withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + if (isInCreateMode()) { + this.innerModel().withCertificateCommonNames(certificateCommonNames); + return this; + } else { + this.updateParameters.withCertificateCommonNames(certificateCommonNames); + return this; + } + } + + public ClusterImpl withClientCertificateCommonNames( + List clientCertificateCommonNames) { + if (isInCreateMode()) { + this.innerModel().withClientCertificateCommonNames(clientCertificateCommonNames); + return this; + } else { + this.updateParameters.withClientCertificateCommonNames(clientCertificateCommonNames); + return this; + } + } + + public ClusterImpl withClientCertificateThumbprints( + List clientCertificateThumbprints) { + if (isInCreateMode()) { + this.innerModel().withClientCertificateThumbprints(clientCertificateThumbprints); + return this; + } else { + this.updateParameters.withClientCertificateThumbprints(clientCertificateThumbprints); + return this; + } + } + + public ClusterImpl withClusterCodeVersion(String clusterCodeVersion) { + if (isInCreateMode()) { + this.innerModel().withClusterCodeVersion(clusterCodeVersion); + return this; + } else { + this.updateParameters.withClusterCodeVersion(clusterCodeVersion); + return this; + } + } + + public ClusterImpl withDiagnosticsStorageAccountConfig( + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.innerModel().withDiagnosticsStorageAccountConfig(diagnosticsStorageAccountConfig); + return this; + } + + public ClusterImpl withEventStoreServiceEnabled(Boolean eventStoreServiceEnabled) { + if (isInCreateMode()) { + this.innerModel().withEventStoreServiceEnabled(eventStoreServiceEnabled); + return this; + } else { + this.updateParameters.withEventStoreServiceEnabled(eventStoreServiceEnabled); + return this; + } + } + + public ClusterImpl withFabricSettings(List fabricSettings) { + if (isInCreateMode()) { + this.innerModel().withFabricSettings(fabricSettings); + return this; + } else { + this.updateParameters.withFabricSettings(fabricSettings); + return this; + } + } + + public ClusterImpl withManagementEndpoint(String managementEndpoint) { + this.innerModel().withManagementEndpoint(managementEndpoint); + return this; + } + + public ClusterImpl withNodeTypes(List nodeTypes) { + if (isInCreateMode()) { + this.innerModel().withNodeTypes(nodeTypes); + return this; + } else { + this.updateParameters.withNodeTypes(nodeTypes); + return this; + } + } + + public ClusterImpl withReliabilityLevel(ReliabilityLevel reliabilityLevel) { + if (isInCreateMode()) { + this.innerModel().withReliabilityLevel(reliabilityLevel); + return this; + } else { + this.updateParameters.withReliabilityLevel(reliabilityLevel); + return this; + } + } + + public ClusterImpl withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + if (isInCreateMode()) { + this.innerModel().withReverseProxyCertificate(reverseProxyCertificate); + return this; + } else { + this.updateParameters.withReverseProxyCertificate(reverseProxyCertificate); + return this; + } + } + + public ClusterImpl withReverseProxyCertificateCommonNames( + ServerCertificateCommonNames reverseProxyCertificateCommonNames) { + this.innerModel().withReverseProxyCertificateCommonNames(reverseProxyCertificateCommonNames); + return this; + } + + public ClusterImpl withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + if (isInCreateMode()) { + this.innerModel().withUpgradeDescription(upgradeDescription); + return this; + } else { + this.updateParameters.withUpgradeDescription(upgradeDescription); + return this; + } + } + + public ClusterImpl withUpgradeMode(UpgradeMode upgradeMode) { + if (isInCreateMode()) { + this.innerModel().withUpgradeMode(upgradeMode); + return this; + } else { + this.updateParameters.withUpgradeMode(upgradeMode); + return this; + } + } + + public ClusterImpl withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + if (isInCreateMode()) { + this.innerModel().withApplicationTypeVersionsCleanupPolicy(applicationTypeVersionsCleanupPolicy); + return this; + } else { + this.updateParameters.withApplicationTypeVersionsCleanupPolicy(applicationTypeVersionsCleanupPolicy); + return this; + } + } + + public ClusterImpl withVmImage(String vmImage) { + this.innerModel().withVmImage(vmImage); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterListResultImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterListResultImpl.java new file mode 100644 index 0000000000000..89167ceff1c17 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterListResultImpl.java @@ -0,0 +1,48 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner; +import com.azure.resourcemanager.servicefabric.models.Cluster; +import com.azure.resourcemanager.servicefabric.models.ClusterListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ClusterListResultImpl implements ClusterListResult { + private ClusterListResultInner innerObject; + + private final ServiceFabricManager serviceManager; + + ClusterListResultImpl(ClusterListResultInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new ClusterImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ClusterListResultInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..76738f9708cb5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java @@ -0,0 +1,707 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ClusterVersionsClient. */ +public final class ClusterVersionsClientImpl implements ClusterVersionsClient { + private final ClientLogger logger = new ClientLogger(ClusterVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClusterVersionsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ClusterVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterVersionsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(ClusterVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientClusterVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @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, + @PathParam("location") String location, + @PathParam("environment") ClusterVersionsEnvironment environment, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + + @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, + @PathParam("location") String location, + @PathParam("environment") ClusterVersionsEnvironment environment, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + clusterVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + clusterVersion, + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String clusterVersion) { + return getWithResponseAsync(location, clusterVersion) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterCodeVersionsListResultInner get(String location, String clusterVersion) { + return getAsync(location, clusterVersion).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String clusterVersion, Context context) { + return getWithResponseAsync(location, clusterVersion, context).block(); + } + + /** + * 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 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByEnvironment( + this.client.getEndpoint(), + location, + environment, + apiVersion, + this.client.getSubscriptionId(), + clusterVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByEnvironment( + this.client.getEndpoint(), + location, + environment, + apiVersion, + this.client.getSubscriptionId(), + clusterVersion, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByEnvironmentAsync( + String location, ClusterVersionsEnvironment environment, String clusterVersion) { + return getByEnvironmentWithResponseAsync(location, environment, clusterVersion) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterCodeVersionsListResultInner getByEnvironment( + String location, ClusterVersionsEnvironment environment, String clusterVersion) { + return getByEnvironmentAsync(location, environment, clusterVersion).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, String clusterVersion, Context context) { + return getByEnvironmentWithResponseAsync(location, environment, clusterVersion, context).block(); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String location) { + return listWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterCodeVersionsListResultInner list(String location) { + return listAsync(location).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String location, Context context) { + return listWithResponseAsync(location, context).block(); + } + + /** + * 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 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByEnvironment( + this.client.getEndpoint(), + location, + environment, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEnvironment( + this.client.getEndpoint(), + location, + environment, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByEnvironmentAsync( + String location, ClusterVersionsEnvironment environment) { + return listByEnvironmentWithResponseAsync(location, environment) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterCodeVersionsListResultInner listByEnvironment( + String location, ClusterVersionsEnvironment environment) { + return listByEnvironmentAsync(location, environment).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, Context context) { + return listByEnvironmentWithResponseAsync(location, environment, context).block(); + } +} 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 new file mode 100644 index 0000000000000..dc524b65e2321 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterCodeVersionsListResult; +import com.azure.resourcemanager.servicefabric.models.ClusterVersions; +import com.azure.resourcemanager.servicefabric.models.ClusterVersionsEnvironment; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClusterVersionsImpl implements ClusterVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterVersionsImpl.class); + + private final ClusterVersionsClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ClusterVersionsImpl(ClusterVersionsClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ClusterCodeVersionsListResult get(String location, String clusterVersion) { + ClusterCodeVersionsListResultInner inner = this.serviceClient().get(location, clusterVersion); + if (inner != null) { + return new ClusterCodeVersionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, String clusterVersion, 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; + } + } + + public ClusterCodeVersionsListResult getByEnvironment( + String location, ClusterVersionsEnvironment environment, String clusterVersion) { + ClusterCodeVersionsListResultInner inner = + this.serviceClient().getByEnvironment(location, environment, clusterVersion); + if (inner != null) { + return new ClusterCodeVersionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByEnvironmentWithResponse( + String location, 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; + } + } + + public ClusterCodeVersionsListResult list(String location) { + ClusterCodeVersionsListResultInner inner = this.serviceClient().list(location); + if (inner != null) { + return new ClusterCodeVersionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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; + } + } + + public ClusterCodeVersionsListResult listByEnvironment(String location, ClusterVersionsEnvironment environment) { + ClusterCodeVersionsListResultInner inner = this.serviceClient().listByEnvironment(location, environment); + if (inner != null) { + return new ClusterCodeVersionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByEnvironmentWithResponse( + String location, 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; + } + } + + private ClusterVersionsClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..c152293b75e18 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java @@ -0,0 +1,1229 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.ClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner; +import com.azure.resourcemanager.servicefabric.models.ClusterUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public final class ClustersClientImpl implements ClustersClient { + private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(ServiceFabricManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientClusters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/clusters/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ClusterInner parameters, + @HeaderParam("Accept") String accept, + 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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ClusterUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 properties. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 properties. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 properties. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 properties. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * 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 properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithResponseAsync(resourceGroupName, clusterName).flatMap((Response res) -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + return deleteWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync(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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithResponseAsync(resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterListResultInner listByResourceGroup(String resourceGroupName) { + return listByResourceGroupAsync(resourceGroupName).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceGroupWithResponse(String resourceGroupName, Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterListResultInner list() { + return listAsync().block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } +} 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 new file mode 100644 index 0000000000000..cfa091751e875 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersImpl.java @@ -0,0 +1,196 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner; +import com.azure.resourcemanager.servicefabric.models.Cluster; +import com.azure.resourcemanager.servicefabric.models.ClusterListResult; +import com.azure.resourcemanager.servicefabric.models.Clusters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClustersImpl implements Clusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, 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; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, clusterName, context); + } + + public ClusterListResult listByResourceGroup(String resourceGroupName) { + ClusterListResultInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new ClusterListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByResourceGroupWithResponse(String resourceGroupName, Context context) { + Response inner = + this.serviceClient().listByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterListResult list() { + ClusterListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new ClusterListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Cluster getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.deleteWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.deleteWithResponse(resourceGroupName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java new file mode 100644 index 0000000000000..9503aea77b4d2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java @@ -0,0 +1,371 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.ClientCertificate; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.LoadBalancingRule; +import com.azure.resourcemanager.servicefabric.models.ManagedCluster; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterAddOnFeature; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ManagedClusterImpl implements ManagedCluster, ManagedCluster.Definition, ManagedCluster.Update { + private ManagedClusterInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public ClusterState clusterState() { + return this.innerModel().clusterState(); + } + + public String clusterCertificateThumbprint() { + return this.innerModel().clusterCertificateThumbprint(); + } + + public Integer clientConnectionPort() { + return this.innerModel().clientConnectionPort(); + } + + public Integer httpGatewayConnectionPort() { + return this.innerModel().httpGatewayConnectionPort(); + } + + public String adminUsername() { + return this.innerModel().adminUsername(); + } + + public String adminPassword() { + return this.innerModel().adminPassword(); + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clients() { + List inner = this.innerModel().clients(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureActiveDirectory azureActiveDirectory() { + return this.innerModel().azureActiveDirectory(); + } + + public List fabricSettings() { + List inner = this.innerModel().fabricSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String clusterCodeVersion() { + return this.innerModel().clusterCodeVersion(); + } + + public List addonFeatures() { + List inner = this.innerModel().addonFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedClusterInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ManagedClusterUpdateParameters updateParameters; + + public ManagedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ManagedClusterImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ManagedClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ManagedClusterImpl update() { + this.updateParameters = new ManagedClusterUpdateParameters(); + return this; + } + + public ManagedCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .update(resourceGroupName, clusterName, updateParameters, Context.NONE); + return this; + } + + public ManagedCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .update(resourceGroupName, clusterName, updateParameters, context); + return this; + } + + ManagedClusterImpl(ManagedClusterInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + } + + public ManagedCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public ManagedCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ManagedClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ManagedClusterImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ManagedClusterImpl withDnsName(String dnsName) { + this.innerModel().withDnsName(dnsName); + return this; + } + + public ManagedClusterImpl withClientConnectionPort(Integer clientConnectionPort) { + if (isInCreateMode()) { + this.innerModel().withClientConnectionPort(clientConnectionPort); + return this; + } else { + this.updateParameters.withClientConnectionPort(clientConnectionPort); + return this; + } + } + + public ManagedClusterImpl withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + if (isInCreateMode()) { + this.innerModel().withHttpGatewayConnectionPort(httpGatewayConnectionPort); + return this; + } else { + this.updateParameters.withHttpGatewayConnectionPort(httpGatewayConnectionPort); + return this; + } + } + + public ManagedClusterImpl withAdminUsername(String adminUsername) { + this.innerModel().withAdminUsername(adminUsername); + return this; + } + + public ManagedClusterImpl withAdminPassword(String adminPassword) { + this.innerModel().withAdminPassword(adminPassword); + return this; + } + + public ManagedClusterImpl withLoadBalancingRules(List loadBalancingRules) { + if (isInCreateMode()) { + this.innerModel().withLoadBalancingRules(loadBalancingRules); + return this; + } else { + this.updateParameters.withLoadBalancingRules(loadBalancingRules); + return this; + } + } + + public ManagedClusterImpl withClients(List clients) { + if (isInCreateMode()) { + this.innerModel().withClients(clients); + return this; + } else { + this.updateParameters.withClients(clients); + return this; + } + } + + public ManagedClusterImpl withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + if (isInCreateMode()) { + this.innerModel().withAzureActiveDirectory(azureActiveDirectory); + return this; + } else { + this.updateParameters.withAzureActiveDirectory(azureActiveDirectory); + return this; + } + } + + public ManagedClusterImpl withFabricSettings(List fabricSettings) { + if (isInCreateMode()) { + this.innerModel().withFabricSettings(fabricSettings); + return this; + } else { + this.updateParameters.withFabricSettings(fabricSettings); + return this; + } + } + + public ManagedClusterImpl withClusterCodeVersion(String clusterCodeVersion) { + if (isInCreateMode()) { + this.innerModel().withClusterCodeVersion(clusterCodeVersion); + return this; + } else { + this.updateParameters.withClusterCodeVersion(clusterCodeVersion); + return this; + } + } + + public ManagedClusterImpl withAddonFeatures(List addonFeatures) { + if (isInCreateMode()) { + this.innerModel().withAddonFeatures(addonFeatures); + return this; + } else { + this.updateParameters.withAddonFeatures(addonFeatures); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java new file mode 100644 index 0000000000000..6119a94a744b2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java @@ -0,0 +1,42 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ClusterOsType; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionDetails; + +public final class ManagedClusterVersionDetailsImpl implements ManagedClusterVersionDetails { + private ManagedClusterVersionDetailsInner innerObject; + + private final ServiceFabricManager serviceManager; + + ManagedClusterVersionDetailsImpl( + ManagedClusterVersionDetailsInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String msiVersion() { + return this.innerModel().msiVersion(); + } + + public String supportExpiryUtc() { + return this.innerModel().supportExpiryUtc(); + } + + public ClusterOsType osType() { + return this.innerModel().osType(); + } + + public ManagedClusterVersionDetailsInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java new file mode 100644 index 0000000000000..63fb33ab0f12d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java @@ -0,0 +1,225 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedClusterVersionsClient. */ +public final class ManagedClusterVersionsClientImpl implements ManagedClusterVersionsClient { + private final ClientLogger logger = new ClientLogger(ManagedClusterVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedClusterVersionsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ManagedClusterVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClusterVersionsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy + .create(ManagedClusterVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientManagedClusterVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface ManagedClusterVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}" + + "/osType/{osType}/clusterVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listByOS( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osType") ManagedClusterVersionsOsType osType, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByOSWithResponseAsync( + String location, ManagedClusterVersionsOsType osType) { + 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 (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOS( + this.client.getEndpoint(), + location, + osType, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByOSWithResponseAsync( + String location, ManagedClusterVersionsOsType osType, 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 (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOS( + this.client.getEndpoint(), + location, + osType, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOSAsync( + String location, ManagedClusterVersionsOsType osType) { + return listByOSWithResponseAsync(location, osType) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listByOS(String location, ManagedClusterVersionsOsType osType) { + return listByOSAsync(location, osType).block(); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context) { + return listByOSWithResponseAsync(location, osType, context).block(); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java new file mode 100644 index 0000000000000..a3232eeb38496 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java @@ -0,0 +1,74 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionDetails; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersions; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ManagedClusterVersionsImpl implements ManagedClusterVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterVersionsImpl.class); + + private final ManagedClusterVersionsClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ManagedClusterVersionsImpl(ManagedClusterVersionsClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listByOS(String location, ManagedClusterVersionsOsType osType) { + List inner = this.serviceClient().listByOS(location, osType); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ManagedClusterVersionDetailsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context) { + Response> inner = + this.serviceClient().listByOSWithResponse(location, osType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new ManagedClusterVersionDetailsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private ManagedClusterVersionsClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java new file mode 100644 index 0000000000000..f30df0e6da5e1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java @@ -0,0 +1,1549 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterListResult; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ +public final class ManagedClustersClientImpl implements ManagedClustersClient { + private final ClientLogger logger = new ClientLogger(ManagedClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedClustersService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ManagedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClustersClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(ManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientManagedClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface ManagedClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters") + @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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedClusterUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a Service Fabric managed 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Service Fabric managed 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get a Service Fabric managed 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service Fabric managed 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Get a Service Fabric managed 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterInner 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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a Service Fabric managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterInner 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(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Create or update a Service Fabric managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Create or update a Service Fabric managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric managed 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Create or update a Service Fabric managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters 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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters 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(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed 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 manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 completion. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a Service Fabric managed 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 completion. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Service Fabric managed 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete a Service Fabric managed 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric managed 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete a Service Fabric managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @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.")); + } + 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java new file mode 100644 index 0000000000000..fe0561534c0a3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java @@ -0,0 +1,174 @@ +// 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.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.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedCluster; +import com.azure.resourcemanager.servicefabric.models.ManagedClusters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedClustersImpl implements ManagedClusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClustersImpl.class); + + private final ManagedClustersClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ManagedClustersImpl(ManagedClustersClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public ManagedCluster getByResourceGroup(String resourceGroupName, String clusterName) { + ManagedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ManagedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public ManagedCluster getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ManagedClustersClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ManagedClusterImpl define(String name) { + return new ManagedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java new file mode 100644 index 0000000000000..9f688198ffbd7 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java @@ -0,0 +1,341 @@ +// 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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.NodeType; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; +import com.azure.resourcemanager.servicefabric.models.VaultSecretGroup; +import com.azure.resourcemanager.servicefabric.models.VmssExtension; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NodeTypeImpl implements NodeType, NodeType.Definition, NodeType.Update { + private NodeTypeInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Boolean isPrimary() { + return this.innerModel().isPrimary(); + } + + public Integer vmInstanceCount() { + return this.innerModel().vmInstanceCount(); + } + + public Integer dataDiskSizeGB() { + return this.innerModel().dataDiskSizeGB(); + } + + public Map placementProperties() { + Map inner = this.innerModel().placementProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map capacities() { + Map inner = this.innerModel().capacities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EndpointRangeDescription applicationPorts() { + return this.innerModel().applicationPorts(); + } + + public EndpointRangeDescription ephemeralPorts() { + return this.innerModel().ephemeralPorts(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String vmImagePublisher() { + return this.innerModel().vmImagePublisher(); + } + + public String vmImageOffer() { + return this.innerModel().vmImageOffer(); + } + + public String vmImageSku() { + return this.innerModel().vmImageSku(); + } + + public String vmImageVersion() { + return this.innerModel().vmImageVersion(); + } + + public List vmSecrets() { + List inner = this.innerModel().vmSecrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vmExtensions() { + List inner = this.innerModel().vmExtensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NodeTypeInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String nodeTypeName; + + private NodeTypeUpdateParameters updateParameters; + + public NodeTypeImpl withExistingManagedCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public NodeType create() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .createOrUpdate(resourceGroupName, clusterName, nodeTypeName, this.innerModel(), Context.NONE); + return this; + } + + public NodeType create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .createOrUpdate(resourceGroupName, clusterName, nodeTypeName, this.innerModel(), context); + return this; + } + + NodeTypeImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new NodeTypeInner(); + this.serviceManager = serviceManager; + this.nodeTypeName = name; + } + + public NodeTypeImpl update() { + this.updateParameters = new NodeTypeUpdateParameters(); + return this; + } + + public NodeType apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .update(resourceGroupName, clusterName, nodeTypeName, updateParameters, Context.NONE); + return this; + } + + public NodeType apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .update(resourceGroupName, clusterName, nodeTypeName, updateParameters, context); + return this; + } + + NodeTypeImpl(NodeTypeInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.nodeTypeName = Utils.getValueFromIdByName(innerObject.id(), "nodeTypes"); + } + + public NodeType refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .getWithResponse(resourceGroupName, clusterName, nodeTypeName, Context.NONE) + .getValue(); + return this; + } + + public NodeType refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .getWithResponse(resourceGroupName, clusterName, nodeTypeName, context) + .getValue(); + return this; + } + + public NodeTypeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NodeTypeImpl withIsPrimary(Boolean isPrimary) { + this.innerModel().withIsPrimary(isPrimary); + return this; + } + + public NodeTypeImpl withVmInstanceCount(Integer vmInstanceCount) { + if (isInCreateMode()) { + this.innerModel().withVmInstanceCount(vmInstanceCount); + return this; + } else { + this.updateParameters.withVmInstanceCount(vmInstanceCount); + return this; + } + } + + public NodeTypeImpl withDataDiskSizeGB(Integer dataDiskSizeGB) { + this.innerModel().withDataDiskSizeGB(dataDiskSizeGB); + return this; + } + + public NodeTypeImpl withPlacementProperties(Map placementProperties) { + if (isInCreateMode()) { + this.innerModel().withPlacementProperties(placementProperties); + return this; + } else { + this.updateParameters.withPlacementProperties(placementProperties); + return this; + } + } + + public NodeTypeImpl withCapacities(Map capacities) { + if (isInCreateMode()) { + this.innerModel().withCapacities(capacities); + return this; + } else { + this.updateParameters.withCapacities(capacities); + return this; + } + } + + public NodeTypeImpl withApplicationPorts(EndpointRangeDescription applicationPorts) { + if (isInCreateMode()) { + this.innerModel().withApplicationPorts(applicationPorts); + return this; + } else { + this.updateParameters.withApplicationPorts(applicationPorts); + return this; + } + } + + public NodeTypeImpl withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + if (isInCreateMode()) { + this.innerModel().withEphemeralPorts(ephemeralPorts); + return this; + } else { + this.updateParameters.withEphemeralPorts(ephemeralPorts); + return this; + } + } + + public NodeTypeImpl withVmSize(String vmSize) { + this.innerModel().withVmSize(vmSize); + return this; + } + + public NodeTypeImpl withVmImagePublisher(String vmImagePublisher) { + this.innerModel().withVmImagePublisher(vmImagePublisher); + return this; + } + + public NodeTypeImpl withVmImageOffer(String vmImageOffer) { + this.innerModel().withVmImageOffer(vmImageOffer); + return this; + } + + public NodeTypeImpl withVmImageSku(String vmImageSku) { + this.innerModel().withVmImageSku(vmImageSku); + return this; + } + + public NodeTypeImpl withVmImageVersion(String vmImageVersion) { + this.innerModel().withVmImageVersion(vmImageVersion); + return this; + } + + public NodeTypeImpl withVmSecrets(List vmSecrets) { + if (isInCreateMode()) { + this.innerModel().withVmSecrets(vmSecrets); + return this; + } else { + this.updateParameters.withVmSecrets(vmSecrets); + return this; + } + } + + public NodeTypeImpl withVmExtensions(List vmExtensions) { + if (isInCreateMode()) { + this.innerModel().withVmExtensions(vmExtensions); + return this; + } else { + this.updateParameters.withVmExtensions(vmExtensions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java new file mode 100644 index 0000000000000..932fdcb535171 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java @@ -0,0 +1,2401 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypeListResult; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NodeTypesClient. */ +public final class NodeTypesClientImpl implements NodeTypesClient { + private final ClientLogger logger = new ClientLogger(NodeTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NodeTypesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of NodeTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NodeTypesClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(NodeTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientNodeTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface NodeTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClusters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteNode( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClustersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersSinglePageAsync( + 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByManagedClusters( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + clusterName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersSinglePageAsync( + 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagedClusters( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + clusterName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClustersAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByManagedClustersSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByManagedClustersNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClustersAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByManagedClustersSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByManagedClustersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedClusters(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByManagedClustersAsync(resourceGroupName, clusterName)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedClusters( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByManagedClustersAsync(resourceGroupName, clusterName, context)); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + restartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + restartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + reimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + reimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteNodeWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNode( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteNodeWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNode( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteNodeAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + deleteNodeWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteNodeAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteNodeWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + deleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + deleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String nodeTypeName) { + return getWithResponseAsync(resourceGroupName, clusterName, nodeTypeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner get(String resourceGroupName, String clusterName, String nodeTypeName) { + return getAsync(resourceGroupName, clusterName, nodeTypeName).block(); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, context).block(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, Context.NONE); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, context); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, Context.NONE); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, context); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner update( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return updateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type 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 describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner update( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, 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 (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, nodeTypeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName).getSyncPoller(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName, context).getSyncPoller(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String nodeTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String nodeTypeName) { + deleteAsync(resourceGroupName, clusterName, nodeTypeName).block(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + deleteAsync(resourceGroupName, clusterName, nodeTypeName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return node type list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersNextSinglePageAsync(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.listByManagedClustersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return node type list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagedClustersNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java new file mode 100644 index 0000000000000..708334105ae51 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java @@ -0,0 +1,237 @@ +// 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.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.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeType; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NodeTypesImpl implements NodeTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypesImpl.class); + + private final NodeTypesClient innerClient; + + private final ServiceFabricManager serviceManager; + + public NodeTypesImpl(NodeTypesClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByManagedClusters(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByManagedClusters(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new NodeTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByManagedClusters( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByManagedClusters(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new NodeTypeImpl(inner1, this.manager())); + } + + public void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().restart(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().restart(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().reimage(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().reimage(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public NodeType get(String resourceGroupName, String clusterName, String nodeTypeName) { + NodeTypeInner inner = this.serviceClient().get(resourceGroupName, clusterName, nodeTypeName); + if (inner != null) { + return new NodeTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, nodeTypeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NodeTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String nodeTypeName) { + this.serviceClient().delete(resourceGroupName, clusterName, nodeTypeName); + } + + public void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, nodeTypeName, context); + } + + public NodeType getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, nodeTypeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, nodeTypeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, nodeTypeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, nodeTypeName, context); + } + + private NodeTypesClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public NodeTypeImpl define(String name) { + return new NodeTypeImpl(name, this.manager()); + } +} 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 new file mode 100644 index 0000000000000..12c9caa2bd089 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationResultImpl.java @@ -0,0 +1,45 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabric.models.AvailableOperationDisplay; +import com.azure.resourcemanager.servicefabric.models.OperationResult; + +public final class OperationResultImpl implements OperationResult { + private OperationResultInner innerObject; + + private final ServiceFabricManager serviceManager; + + OperationResultImpl(OperationResultInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public AvailableOperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public OperationResultInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..edfc300e48a3c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java @@ -0,0 +1,651 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabric.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceFabric/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") 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) + Mono> list( + @HostParam("$host") 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) + Mono> list( + @HostParam("$host") 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) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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 apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric resource provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the result of the request to list Service Fabric resource provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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 new file mode 100644 index 0000000000000..7a2b46f43b78c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java @@ -0,0 +1,76 @@ +// 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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; +import com.azure.resourcemanager.servicefabric.models.OperationResult; +import com.azure.resourcemanager.servicefabric.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final ServiceFabricManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..fd8d954df1fe3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientBuilder.java @@ -0,0 +1,146 @@ +// 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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ServiceFabricManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ServiceFabricManagementClientImpl.class}) +public final class ServiceFabricManagementClientBuilder { + /* + * The customer subscription identifier. + */ + private String subscriptionId; + + /** + * Sets The customer subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ServiceFabricManagementClientBuilder. + */ + public ServiceFabricManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ServiceFabricManagementClientImpl with the provided parameters. + * + * @return an instance of ServiceFabricManagementClientImpl. + */ + public ServiceFabricManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ServiceFabricManagementClientImpl client = + new ServiceFabricManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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 new file mode 100644 index 0000000000000..a1e74592806fc --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java @@ -0,0 +1,406 @@ +// 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.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +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.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypeVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient; +import com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.ClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; +import com.azure.resourcemanager.servicefabric.fluent.ServiceFabricManagementClient; +import com.azure.resourcemanager.servicefabric.fluent.ServicesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ServiceFabricManagementClientImpl type. */ +@ServiceClient(builder = ServiceFabricManagementClientBuilder.class) +public final class ServiceFabricManagementClientImpl implements ServiceFabricManagementClient { + private final ClientLogger logger = new ClientLogger(ServiceFabricManagementClientImpl.class); + + /** 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. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** 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; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ApplicationTypesClient object to access its operations. */ + private final ApplicationTypesClient applicationTypes; + + /** + * Gets the ApplicationTypesClient object to access its operations. + * + * @return the ApplicationTypesClient object. + */ + public ApplicationTypesClient getApplicationTypes() { + return this.applicationTypes; + } + + /** The ApplicationTypeVersionsClient object to access its operations. */ + private final ApplicationTypeVersionsClient applicationTypeVersions; + + /** + * Gets the ApplicationTypeVersionsClient object to access its operations. + * + * @return the ApplicationTypeVersionsClient object. + */ + public ApplicationTypeVersionsClient getApplicationTypeVersions() { + return this.applicationTypeVersions; + } + + /** The ApplicationsClient object to access its operations. */ + private final ApplicationsClient applications; + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + public ApplicationsClient getApplications() { + return this.applications; + } + + /** The ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The ManagedClustersClient object to access its operations. */ + private final ManagedClustersClient managedClusters; + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + public ManagedClustersClient getManagedClusters() { + return this.managedClusters; + } + + /** The ManagedClusterVersionsClient object to access its operations. */ + private final ManagedClusterVersionsClient managedClusterVersions; + + /** + * Gets the ManagedClusterVersionsClient object to access its operations. + * + * @return the ManagedClusterVersionsClient object. + */ + public ManagedClusterVersionsClient getManagedClusterVersions() { + return this.managedClusterVersions; + } + + /** The NodeTypesClient object to access its operations. */ + private final NodeTypesClient nodeTypes; + + /** + * Gets the NodeTypesClient object to access its operations. + * + * @return the NodeTypesClient object. + */ + public NodeTypesClient getNodeTypes() { + return this.nodeTypes; + } + + /** + * Initializes an instance of ServiceFabricManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The customer subscription identifier. + * @param endpoint server parameter. + */ + ServiceFabricManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.clusters = new ClustersClientImpl(this); + this.clusterVersions = new ClusterVersionsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.applicationTypes = new ApplicationTypesClientImpl(this); + this.applicationTypeVersions = new ApplicationTypeVersionsClientImpl(this); + this.applications = new ApplicationsClientImpl(this); + this.services = new ServicesClientImpl(this); + this.managedClusters = new ManagedClustersClientImpl(this); + this.managedClusterVersions = new ManagedClusterVersionsClientImpl(this); + this.nodeTypes = new NodeTypesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} 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 new file mode 100644 index 0000000000000..4d66fae9ee948 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java @@ -0,0 +1,319 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +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.ServiceLoadMetricDescription; +import com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyDescription; +import com.azure.resourcemanager.servicefabric.models.ServiceResource; +import com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ServiceResourceImpl implements ServiceResource, ServiceResource.Definition, ServiceResource.Update { + private ServiceResourceInner innerObject; + + private final ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String placementConstraints() { + return this.innerModel().placementConstraints(); + } + + public List correlationScheme() { + List inner = this.innerModel().correlationScheme(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceLoadMetrics() { + List inner = this.innerModel().serviceLoadMetrics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List servicePlacementPolicies() { + List inner = this.innerModel().servicePlacementPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MoveCost defaultMoveCost() { + return this.innerModel().defaultMoveCost(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String serviceTypeName() { + return this.innerModel().serviceTypeName(); + } + + public PartitionSchemeDescription partitionDescription() { + return this.innerModel().partitionDescription(); + } + + public ArmServicePackageActivationMode servicePackageActivationMode() { + return this.innerModel().servicePackageActivationMode(); + } + + public String serviceDnsName() { + return this.innerModel().serviceDnsName(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ServiceResourceInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String applicationName; + + private String serviceName; + + private ServiceResourceUpdate updateParameters; + + public ServiceResourceImpl withExistingApplication( + String resourceGroupName, String clusterName, String applicationName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.applicationName = applicationName; + return this; + } + + public ServiceResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate( + resourceGroupName, clusterName, applicationName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public ServiceResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate( + resourceGroupName, clusterName, applicationName, serviceName, this.innerModel(), context); + return this; + } + + ServiceResourceImpl(String name, ServiceFabricManager serviceManager) { + this.innerObject = new ServiceResourceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public ServiceResourceImpl update() { + this.updateParameters = new ServiceResourceUpdate(); + return this; + } + + public ServiceResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .update(resourceGroupName, clusterName, applicationName, serviceName, updateParameters, Context.NONE); + return this; + } + + public ServiceResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .update(resourceGroupName, clusterName, applicationName, serviceName, updateParameters, context); + return this; + } + + ServiceResourceImpl(ServiceResourceInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + } + + public ServiceResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getWithResponse(resourceGroupName, clusterName, applicationName, serviceName, Context.NONE) + .getValue(); + return this; + } + + public ServiceResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getWithResponse(resourceGroupName, clusterName, applicationName, serviceName, context) + .getValue(); + return this; + } + + public ServiceResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServiceResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServiceResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ServiceResourceImpl withPlacementConstraints(String placementConstraints) { + if (isInCreateMode()) { + this.innerModel().withPlacementConstraints(placementConstraints); + return this; + } else { + this.updateParameters.withPlacementConstraints(placementConstraints); + return this; + } + } + + public ServiceResourceImpl withCorrelationScheme(List correlationScheme) { + if (isInCreateMode()) { + this.innerModel().withCorrelationScheme(correlationScheme); + return this; + } else { + this.updateParameters.withCorrelationScheme(correlationScheme); + return this; + } + } + + public ServiceResourceImpl withServiceLoadMetrics(List serviceLoadMetrics) { + if (isInCreateMode()) { + this.innerModel().withServiceLoadMetrics(serviceLoadMetrics); + return this; + } else { + this.updateParameters.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + } + + public ServiceResourceImpl withServicePlacementPolicies( + List servicePlacementPolicies) { + if (isInCreateMode()) { + this.innerModel().withServicePlacementPolicies(servicePlacementPolicies); + return this; + } else { + this.updateParameters.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + } + + public ServiceResourceImpl withDefaultMoveCost(MoveCost defaultMoveCost) { + if (isInCreateMode()) { + this.innerModel().withDefaultMoveCost(defaultMoveCost); + return this; + } else { + this.updateParameters.withDefaultMoveCost(defaultMoveCost); + return this; + } + } + + public ServiceResourceImpl withServiceTypeName(String serviceTypeName) { + this.innerModel().withServiceTypeName(serviceTypeName); + return this; + } + + public ServiceResourceImpl withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.innerModel().withPartitionDescription(partitionDescription); + return this; + } + + public ServiceResourceImpl withServicePackageActivationMode( + ArmServicePackageActivationMode servicePackageActivationMode) { + this.innerModel().withServicePackageActivationMode(servicePackageActivationMode); + return this; + } + + public ServiceResourceImpl withServiceDnsName(String serviceDnsName) { + this.innerModel().withServiceDnsName(serviceDnsName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceListImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceListImpl.java new file mode 100644 index 0000000000000..be254cc284a59 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceListImpl.java @@ -0,0 +1,51 @@ +// 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.implementation; + +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ServiceResource; +import com.azure.resourcemanager.servicefabric.models.ServiceResourceList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ServiceResourceListImpl implements ServiceResourceList { + private ServiceResourceListInner innerObject; + + private final ServiceFabricManager serviceManager; + + ServiceResourceListImpl(ServiceResourceListInner innerObject, ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ServiceResourceListInner innerModel() { + return this.innerObject; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..942da9dd0f7df --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java @@ -0,0 +1,1504 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +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.fluent.models.ServiceResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ServiceResourceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public final class ServicesClientImpl implements ServicesClient { + private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServicesClientImpl(ServiceFabricManagementClientImpl client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private 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, + @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); + + @Headers({"Content-Type: application/json"}) + @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, + @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); + + @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, + @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"}) + @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, + @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); + + @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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + accept, + context); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner get( + String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return getAsync(resourceGroupName, clusterName, applicationName, serviceName).block(); + } + + /** + * 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}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) + .getSyncPoller(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, applicationName, serviceName, parameters, context) + .getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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(); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + parameters, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) + .getSyncPoller(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters, context) + .getSyncPoller(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String applicationName, + String serviceName, + ServiceResourceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, applicationName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + */ + @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); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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(); + } + + /** + * 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. + */ + @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(); + } + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 the completion. + */ + @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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + serviceName, + apiVersion, + accept, + context); + } + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName).getSyncPoller(); + } + + /** + * 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName, context).getSyncPoller(); + } + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String applicationName, String serviceName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, serviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 the completion. + */ + @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); + } + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + deleteAsync(resourceGroupName, clusterName, applicationName, serviceName).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { + deleteAsync(resourceGroupName, clusterName, applicationName, serviceName, context).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + apiVersion, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String clusterName, String applicationName) { + return listWithResponseAsync(resourceGroupName, clusterName, applicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceListInner list(String resourceGroupName, String clusterName, String applicationName) { + return listAsync(resourceGroupName, clusterName, applicationName).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return listWithResponseAsync(resourceGroupName, clusterName, applicationName, context).block(); + } +} 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 new file mode 100644 index 0000000000000..5ddda92c1e4e8 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesImpl.java @@ -0,0 +1,236 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.ServiceFabricManager; +import com.azure.resourcemanager.servicefabric.fluent.ServicesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceListInner; +import com.azure.resourcemanager.servicefabric.models.ServiceResource; +import com.azure.resourcemanager.servicefabric.models.ServiceResourceList; +import com.azure.resourcemanager.servicefabric.models.Services; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServicesImpl implements Services { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + + private final ServicesClient innerClient; + + private final ServiceFabricManager serviceManager; + + public ServicesImpl(ServicesClient innerClient, ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServiceResource get( + String resourceGroupName, String clusterName, String applicationName, String serviceName) { + ServiceResourceInner inner = + this.serviceClient().get(resourceGroupName, clusterName, applicationName, serviceName); + if (inner != null) { + return new ServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, 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; + } + } + + public void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName, serviceName); + } + + public void delete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName, serviceName, context); + } + + public ServiceResourceList list(String resourceGroupName, String clusterName, String applicationName) { + ServiceResourceListInner inner = this.serviceClient().list(resourceGroupName, clusterName, applicationName); + if (inner != null) { + return new ServiceResourceListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, clusterName, applicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceResourceListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, applicationName, serviceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationName, serviceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, serviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, serviceName, context); + } + + private ServicesClient serviceClient() { + return this.innerClient; + } + + private ServiceFabricManager manager() { + return this.serviceManager; + } + + public ServiceResourceImpl define(String name) { + return new ServiceResourceImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/Utils.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/Utils.java new file mode 100644 index 0000000000000..aea7a51f0c877 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/Utils.java @@ -0,0 +1,196 @@ +// 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.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Mono; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pageIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { + super(new PagedFlux(Mono::empty)); + this.pageIterable = pageIterable; + this.mapper = mapper; + this.pageMapper = + page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pageIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pageIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pageIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pageIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/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 new file mode 100644 index 0000000000000..ea57711da63a6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ServiceFabricManagementClient. Service Fabric Management 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 new file mode 100644 index 0000000000000..d1f1560ed4154 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AddOnFeatures.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AddOnFeatures. */ +public final class AddOnFeatures extends ExpandableStringEnum { + /** Static value RepairManager for AddOnFeatures. */ + public static final AddOnFeatures REPAIR_MANAGER = fromString("RepairManager"); + + /** Static value DnsService for AddOnFeatures. */ + public static final AddOnFeatures DNS_SERVICE = fromString("DnsService"); + + /** Static value BackupRestoreService for AddOnFeatures. */ + public static final AddOnFeatures BACKUP_RESTORE_SERVICE = fromString("BackupRestoreService"); + + /** Static value ResourceMonitorService for AddOnFeatures. */ + public static final AddOnFeatures RESOURCE_MONITOR_SERVICE = fromString("ResourceMonitorService"); + + /** + * Creates or finds a AddOnFeatures from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddOnFeatures. + */ + @JsonCreator + public static AddOnFeatures fromString(String name) { + return fromString(name, AddOnFeatures.class); + } + + /** @return known AddOnFeatures values. */ + public static Collection values() { + return values(AddOnFeatures.class); + } +} 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 new file mode 100644 index 0000000000000..a98073826319e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java @@ -0,0 +1,101 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Defines a delta health policy used to evaluate the health of an application or one of its child entities when + * upgrading the cluster. + */ +@Fluent +public final class ApplicationDeltaHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationDeltaHealthPolicy.class); + + /* + * The delta health policy used by default to evaluate the health of a + * service type when upgrading the cluster. + */ + @JsonProperty(value = "defaultServiceTypeDeltaHealthPolicy") + private ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy; + + /* + * The map with service type delta health policy per service type name. The + * map is empty by default. + */ + @JsonProperty(value = "serviceTypeDeltaHealthPolicies") + private Map serviceTypeDeltaHealthPolicies; + + /** + * Get the defaultServiceTypeDeltaHealthPolicy property: The delta health policy used by default to evaluate the + * health of a service type when upgrading the cluster. + * + * @return the defaultServiceTypeDeltaHealthPolicy value. + */ + public ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy() { + return this.defaultServiceTypeDeltaHealthPolicy; + } + + /** + * Set the defaultServiceTypeDeltaHealthPolicy property: The delta health policy used by default to evaluate the + * health of a service type when upgrading the cluster. + * + * @param defaultServiceTypeDeltaHealthPolicy the defaultServiceTypeDeltaHealthPolicy value to set. + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withDefaultServiceTypeDeltaHealthPolicy( + ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy) { + this.defaultServiceTypeDeltaHealthPolicy = defaultServiceTypeDeltaHealthPolicy; + return this; + } + + /** + * Get the serviceTypeDeltaHealthPolicies property: The map with service type delta health policy per service type + * name. The map is empty by default. + * + * @return the serviceTypeDeltaHealthPolicies value. + */ + public Map serviceTypeDeltaHealthPolicies() { + return this.serviceTypeDeltaHealthPolicies; + } + + /** + * Set the serviceTypeDeltaHealthPolicies property: The map with service type delta health policy per service type + * name. The map is empty by default. + * + * @param serviceTypeDeltaHealthPolicies the serviceTypeDeltaHealthPolicies value to set. + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withServiceTypeDeltaHealthPolicies( + Map serviceTypeDeltaHealthPolicies) { + this.serviceTypeDeltaHealthPolicies = 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(); + } + }); + } + } +} 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 new file mode 100644 index 0000000000000..939320b117220 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java @@ -0,0 +1,98 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines a health policy used to evaluate the health of an application or one of its children entities. */ +@Fluent +public final class ApplicationHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationHealthPolicy.class); + + /* + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "defaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /* + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "serviceTypeHealthPolicies") + private Map serviceTypeHealthPolicies; + + /** + * Get the defaultServiceTypeHealthPolicy property: The health policy used by default to evaluate the health of a + * service type. + * + * @return the defaultServiceTypeHealthPolicy value. + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the defaultServiceTypeHealthPolicy property: The health policy used by default to evaluate the health of a + * service type. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set. + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy( + ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the serviceTypeHealthPolicies property: The map with service type health policy per service type name. The + * map is empty by default. + * + * @return the serviceTypeHealthPolicies value. + */ + public Map serviceTypeHealthPolicies() { + return this.serviceTypeHealthPolicies; + } + + /** + * Set the serviceTypeHealthPolicies property: The map with service type health policy per service type name. The + * map is empty by default. + * + * @param serviceTypeHealthPolicies the serviceTypeHealthPolicies value to set. + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicies( + Map serviceTypeHealthPolicies) { + this.serviceTypeHealthPolicies = 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(); + } + }); + } + } +} 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 new file mode 100644 index 0000000000000..3d53026eedb7c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationMetricDescription.java @@ -0,0 +1,185 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes capacity information for a custom resource balancing metric. This can be used to limit the total + * consumption of this metric by the services of this application. + */ +@Fluent +public final class ApplicationMetricDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationMetricDescription.class); + + /* + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The maximum node capacity for Service Fabric application. + * This is the maximum Load for an instance of this application on a single + * node. Even if the capacity of node is greater than this value, Service + * Fabric will limit the total load of services within the application on + * each node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + * When updating existing application with application capacity, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + * + */ + @JsonProperty(value = "maximumCapacity") + private Long maximumCapacity; + + /* + * The node reservation capacity for Service Fabric application. + * This is the amount of load which is reserved on nodes which have + * instances of this application. + * If MinimumNodes is specified, then the product of these values will be + * the capacity reserved in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; + * this value must be smaller than or equal to MaximumCapacity for each + * metric. + * + */ + @JsonProperty(value = "reservationCapacity") + private Long reservationCapacity; + + /* + * The total metric capacity for Service Fabric application. + * This is the total metric capacity for this application in the cluster. + * Service Fabric will try to limit the sum of loads of services within the + * application to this value. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and MaximumCapacity must always be smaller than + * or equal to this value. + * + */ + @JsonProperty(value = "totalApplicationCapacity") + private Long totalApplicationCapacity; + + /** + * Get the name property: The name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the metric. + * + * @param name the name value to set. + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the maximumCapacity property: The maximum node capacity for Service Fabric application. This is the maximum + * Load for an instance of this application on a single node. Even if the capacity of node is greater than this + * value, Service Fabric will limit the total load of services within the application on each node to this value. If + * set to zero, capacity for this metric is unlimited on each node. When creating a new application with application + * capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to + * TotalApplicationCapacity. When updating existing application with application capacity, the product of + * MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @return the maximumCapacity value. + */ + public Long maximumCapacity() { + return this.maximumCapacity; + } + + /** + * Set the maximumCapacity property: The maximum node capacity for Service Fabric application. This is the maximum + * Load for an instance of this application on a single node. Even if the capacity of node is greater than this + * value, Service Fabric will limit the total load of services within the application on each node to this value. If + * set to zero, capacity for this metric is unlimited on each node. When creating a new application with application + * capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to + * TotalApplicationCapacity. When updating existing application with application capacity, the product of + * MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @param maximumCapacity the maximumCapacity value to set. + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withMaximumCapacity(Long maximumCapacity) { + this.maximumCapacity = maximumCapacity; + return this; + } + + /** + * Get the reservationCapacity property: The node reservation capacity for Service Fabric application. This is the + * amount of load which is reserved on nodes which have instances of this application. If MinimumNodes is specified, + * then the product of these values will be the capacity reserved in the cluster for the application. If set to + * zero, no capacity is reserved for this metric. When setting application capacity or when updating application + * capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @return the reservationCapacity value. + */ + public Long reservationCapacity() { + return this.reservationCapacity; + } + + /** + * Set the reservationCapacity property: The node reservation capacity for Service Fabric application. This is the + * amount of load which is reserved on nodes which have instances of this application. If MinimumNodes is specified, + * then the product of these values will be the capacity reserved in the cluster for the application. If set to + * zero, no capacity is reserved for this metric. When setting application capacity or when updating application + * capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @param reservationCapacity the reservationCapacity value to set. + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withReservationCapacity(Long reservationCapacity) { + this.reservationCapacity = reservationCapacity; + return this; + } + + /** + * Get the totalApplicationCapacity property: The total metric capacity for Service Fabric application. This is the + * total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of + * services within the application to this value. When creating a new application with application capacity defined, + * the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @return the totalApplicationCapacity value. + */ + public Long totalApplicationCapacity() { + return this.totalApplicationCapacity; + } + + /** + * Set the totalApplicationCapacity property: The total metric capacity for Service Fabric application. This is the + * total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of + * services within the application to this value. When creating a new application with application capacity defined, + * the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @param totalApplicationCapacity the totalApplicationCapacity value to set. + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withTotalApplicationCapacity(Long totalApplicationCapacity) { + this.totalApplicationCapacity = totalApplicationCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..84e71fccd87a2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java @@ -0,0 +1,518 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationResource. */ +public interface ApplicationResource { + /** + * 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 identity property: Describes the managed identities for an Azure resource. + * + * @return the identity value. + */ + ManagedIdentity identity(); + + /** + * Gets the typeVersion property: The version of the application type as defined in the application manifest. + * + * @return the typeVersion value. + */ + String typeVersion(); + + /** + * Gets the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @return the parameters value. + */ + Map parameters(); + + /** + * Gets the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @return the upgradePolicy value. + */ + ApplicationUpgradePolicy upgradePolicy(); + + /** + * Gets the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @return the minimumNodes value. + */ + Long minimumNodes(); + + /** + * Gets the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value. + */ + Long maximumNodes(); + + /** + * Gets the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @return the removeApplicationCapacity value. + */ + Boolean removeApplicationCapacity(); + + /** + * Gets the metrics property: List of application capacity metric description. + * + * @return the metrics value. + */ + List metrics(); + + /** + * Gets the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + List managedIdentities(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the typeName property: The application type name as defined in the application manifest. + * + * @return the typeName value. + */ + String typeName(); + + /** + * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner object. + * + * @return the inner object. + */ + ApplicationResourceInner innerModel(); + + /** The entirety of the ApplicationResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApplicationResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApplicationResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * 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.WithTypeVersion, + DefinitionStages.WithParameters, + DefinitionStages.WithUpgradePolicy, + DefinitionStages.WithMinimumNodes, + DefinitionStages.WithMaximumNodes, + DefinitionStages.WithRemoveApplicationCapacity, + DefinitionStages.WithMetrics, + DefinitionStages.WithManagedIdentities, + DefinitionStages.WithTypeName { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationResource create(Context context); + } + /** The stage of the ApplicationResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ApplicationResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ApplicationResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Describes the managed identities for an Azure resource.. + * + * @param identity Describes the managed identities for an Azure resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedIdentity identity); + } + /** The stage of the ApplicationResource definition allowing to specify typeVersion. */ + interface WithTypeVersion { + /** + * Specifies the typeVersion property: The version of the application type as defined in the application + * manifest.. + * + * @param typeVersion The version of the application type as defined in the application manifest. + * @return the next definition stage. + */ + WithCreate withTypeVersion(String typeVersion); + } + /** The stage of the ApplicationResource definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: List of application parameters with overridden values from their + * default values specified in the application manifest.. + * + * @param parameters List of application parameters with overridden values from their default values + * specified in the application manifest. + * @return the next definition stage. + */ + WithCreate withParameters(Map parameters); + } + /** The stage of the ApplicationResource definition allowing to specify upgradePolicy. */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: Describes the policy for a monitored application upgrade.. + * + * @param upgradePolicy Describes the policy for a monitored application upgrade. + * @return the next definition stage. + */ + WithCreate withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy); + } + /** The stage of the ApplicationResource definition allowing to specify minimumNodes. */ + interface WithMinimumNodes { + /** + * Specifies the minimumNodes property: The minimum number of nodes where Service Fabric will reserve + * capacity for this application. Note that this does not mean that the services of this application will be + * placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of + * this property cannot be more than the value of the MaximumNodes property.. + * + * @param minimumNodes The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all + * of those nodes. If this property is set to zero, no capacity will be reserved. The value of this + * property cannot be more than the value of the MaximumNodes property. + * @return the next definition stage. + */ + WithCreate withMinimumNodes(Long minimumNodes); + } + /** The stage of the ApplicationResource definition allowing to specify maximumNodes. */ + interface WithMaximumNodes { + /** + * Specifies the maximumNodes property: The maximum number of nodes where Service Fabric will reserve + * capacity for this application. Note that this does not mean that the services of this application will be + * placed on all of those nodes. By default, the value of this property is zero and it means that the + * services can be placed on any node.. + * + * @param maximumNodes The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all + * of those nodes. By default, the value of this property is zero and it means that the services can be + * placed on any node. + * @return the next definition stage. + */ + WithCreate withMaximumNodes(Long maximumNodes); + } + /** The stage of the ApplicationResource definition allowing to specify removeApplicationCapacity. */ + interface WithRemoveApplicationCapacity { + /** + * Specifies the removeApplicationCapacity property: Remove the current application capacity settings.. + * + * @param removeApplicationCapacity Remove the current application capacity settings. + * @return the next definition stage. + */ + WithCreate withRemoveApplicationCapacity(Boolean removeApplicationCapacity); + } + /** The stage of the ApplicationResource definition allowing to specify metrics. */ + interface WithMetrics { + /** + * Specifies the metrics property: List of application capacity metric description.. + * + * @param metrics List of application capacity metric description. + * @return the next definition stage. + */ + WithCreate withMetrics(List metrics); + } + /** The stage of the ApplicationResource definition allowing to specify managedIdentities. */ + interface WithManagedIdentities { + /** + * Specifies the managedIdentities property: List of user assigned identities for the application, each + * mapped to a friendly name.. + * + * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly + * name. + * @return the next definition stage. + */ + WithCreate withManagedIdentities(List managedIdentities); + } + /** The stage of the ApplicationResource definition allowing to specify typeName. */ + interface WithTypeName { + /** + * Specifies the typeName property: The application type name as defined in the application manifest.. + * + * @param typeName The application type name as defined in the application manifest. + * @return the next definition stage. + */ + WithCreate withTypeName(String typeName); + } + } + /** + * Begins update for the ApplicationResource resource. + * + * @return the stage of resource update. + */ + ApplicationResource.Update update(); + + /** The template for ApplicationResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithTypeVersion, + UpdateStages.WithParameters, + UpdateStages.WithUpgradePolicy, + UpdateStages.WithMinimumNodes, + UpdateStages.WithMaximumNodes, + UpdateStages.WithRemoveApplicationCapacity, + UpdateStages.WithMetrics, + UpdateStages.WithManagedIdentities { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationResource apply(Context context); + } + /** The ApplicationResource update stages. */ + interface UpdateStages { + /** The stage of the ApplicationResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ApplicationResource update allowing to specify typeVersion. */ + interface WithTypeVersion { + /** + * Specifies the typeVersion property: The version of the application type as defined in the application + * manifest.. + * + * @param typeVersion The version of the application type as defined in the application manifest. + * @return the next definition stage. + */ + Update withTypeVersion(String typeVersion); + } + /** The stage of the ApplicationResource update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: List of application parameters with overridden values from their + * default values specified in the application manifest.. + * + * @param parameters List of application parameters with overridden values from their default values + * specified in the application manifest. + * @return the next definition stage. + */ + Update withParameters(Map parameters); + } + /** The stage of the ApplicationResource update allowing to specify upgradePolicy. */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: Describes the policy for a monitored application upgrade.. + * + * @param upgradePolicy Describes the policy for a monitored application upgrade. + * @return the next definition stage. + */ + Update withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy); + } + /** The stage of the ApplicationResource update allowing to specify minimumNodes. */ + interface WithMinimumNodes { + /** + * Specifies the minimumNodes property: The minimum number of nodes where Service Fabric will reserve + * capacity for this application. Note that this does not mean that the services of this application will be + * placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of + * this property cannot be more than the value of the MaximumNodes property.. + * + * @param minimumNodes The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all + * of those nodes. If this property is set to zero, no capacity will be reserved. The value of this + * property cannot be more than the value of the MaximumNodes property. + * @return the next definition stage. + */ + Update withMinimumNodes(Long minimumNodes); + } + /** The stage of the ApplicationResource update allowing to specify maximumNodes. */ + interface WithMaximumNodes { + /** + * Specifies the maximumNodes property: The maximum number of nodes where Service Fabric will reserve + * capacity for this application. Note that this does not mean that the services of this application will be + * placed on all of those nodes. By default, the value of this property is zero and it means that the + * services can be placed on any node.. + * + * @param maximumNodes The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all + * of those nodes. By default, the value of this property is zero and it means that the services can be + * placed on any node. + * @return the next definition stage. + */ + Update withMaximumNodes(Long maximumNodes); + } + /** The stage of the ApplicationResource update allowing to specify removeApplicationCapacity. */ + interface WithRemoveApplicationCapacity { + /** + * Specifies the removeApplicationCapacity property: Remove the current application capacity settings.. + * + * @param removeApplicationCapacity Remove the current application capacity settings. + * @return the next definition stage. + */ + Update withRemoveApplicationCapacity(Boolean removeApplicationCapacity); + } + /** The stage of the ApplicationResource update allowing to specify metrics. */ + interface WithMetrics { + /** + * Specifies the metrics property: List of application capacity metric description.. + * + * @param metrics List of application capacity metric description. + * @return the next definition stage. + */ + Update withMetrics(List metrics); + } + /** The stage of the ApplicationResource update allowing to specify managedIdentities. */ + interface WithManagedIdentities { + /** + * Specifies the managedIdentities property: List of user assigned identities for the application, each + * mapped to a friendly name.. + * + * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly + * name. + * @return the next definition stage. + */ + Update withManagedIdentities(List managedIdentities); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationResource refresh(Context context); +} 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/models/ApplicationResourceList.java new file mode 100644 index 0000000000000..b2e862e21c98c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceList.java @@ -0,0 +1,32 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceListInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationResourceList. */ +public interface ApplicationResourceList { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of application list results if there are any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceListInner object. + * + * @return the inner object. + */ + ApplicationResourceListInner innerModel(); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java new file mode 100644 index 0000000000000..55ead786f04b2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java @@ -0,0 +1,128 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The application resource properties. */ +@Fluent +public final class ApplicationResourceProperties extends ApplicationResourceUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceProperties.class); + + /* + * The current deployment or provisioning state, which only appears in the + * response + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "typeName") + private String typeName; + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the typeName property: The application type name as defined in the application manifest. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The application type name as defined in the application manifest. + * + * @param typeName the typeName value to set. + * @return the ApplicationResourceProperties object itself. + */ + public ApplicationResourceProperties withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withTypeVersion(String typeVersion) { + super.withTypeVersion(typeVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withParameters(Map parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + super.withUpgradePolicy(upgradePolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withMinimumNodes(Long minimumNodes) { + super.withMinimumNodes(minimumNodes); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withMaximumNodes(Long maximumNodes) { + super.withMaximumNodes(maximumNodes); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + super.withRemoveApplicationCapacity(removeApplicationCapacity); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withMetrics(List metrics) { + super.withMetrics(metrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationResourceProperties withManagedIdentities( + List managedIdentities) { + super.withManagedIdentities(managedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..40604da688757 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java @@ -0,0 +1,339 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The application resource for patch operations. */ +@JsonFlatten +@Fluent +public class ApplicationResourceUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceUpdate.class); + + /* + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /* + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "properties.parameters") + private Map parameters; + + /* + * Describes the policy for a monitored application upgrade. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /* + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /* + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /* + * Remove the current application capacity settings. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /* + * List of application capacity metric description. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "properties.managedIdentities") + private List managedIdentities; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the typeVersion property: The version of the application type as defined in the application manifest. + * + * @return the typeVersion value. + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion property: The version of the application type as defined in the application manifest. + * + * @param typeVersion the typeVersion value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @param parameters the parameters value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @return the upgradePolicy value. + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @return the minimumNodes value. + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value. + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @return the removeApplicationCapacity value. + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics property: List of application capacity metric description. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: List of application capacity metric description. + * + * @param metrics the metrics value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + public List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withManagedIdentities(List managedIdentities) { + this.managedIdentities = managedIdentities; + return this; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java new file mode 100644 index 0000000000000..c4267e3b03f1a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java @@ -0,0 +1,269 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The application resource properties for patch operations. */ +@Fluent +public class ApplicationResourceUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceUpdateProperties.class); + + /* + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "typeVersion") + private String typeVersion; + + /* + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "parameters") + private Map parameters; + + /* + * Describes the policy for a monitored application upgrade. + */ + @JsonProperty(value = "upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /* + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "minimumNodes") + private Long minimumNodes; + + /* + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "maximumNodes") + private Long maximumNodes; + + /* + * Remove the current application capacity settings. + */ + @JsonProperty(value = "removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /* + * List of application capacity metric description. + */ + @JsonProperty(value = "metrics") + private List metrics; + + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "managedIdentities") + private List managedIdentities; + + /** + * Get the typeVersion property: The version of the application type as defined in the application manifest. + * + * @return the typeVersion value. + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion property: The version of the application type as defined in the application manifest. + * + * @param typeVersion the typeVersion value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: List of application parameters with overridden values from their default values + * specified in the application manifest. + * + * @param parameters the parameters value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @return the upgradePolicy value. + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: Describes the policy for a monitored application upgrade. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @return the minimumNodes value. + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more + * than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value. + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this + * application. Note that this does not mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @return the removeApplicationCapacity value. + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the removeApplicationCapacity property: Remove the current application capacity settings. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics property: List of application capacity metric description. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: List of application capacity metric description. + * + * @param metrics the metrics value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + public List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withManagedIdentities( + List managedIdentities) { + this.managedIdentities = 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()); + } + } +} 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 new file mode 100644 index 0000000000000..61f1c262448e3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java @@ -0,0 +1,205 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ApplicationTypeResource. */ +public interface ApplicationTypeResource { + /** + * 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 provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceInner object. + * + * @return the inner object. + */ + ApplicationTypeResourceInner innerModel(); + + /** The entirety of the ApplicationTypeResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApplicationTypeResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationTypeResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApplicationTypeResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationTypeResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationTypeResource create(Context context); + } + /** The stage of the ApplicationTypeResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ApplicationTypeResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the ApplicationTypeResource resource. + * + * @return the stage of resource update. + */ + ApplicationTypeResource.Update update(); + + /** The template for ApplicationTypeResource update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationTypeResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationTypeResource apply(Context context); + } + /** The ApplicationTypeResource update stages. */ + interface UpdateStages { + /** The stage of the ApplicationTypeResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationTypeResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationTypeResource refresh(Context context); +} 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/models/ApplicationTypeResourceList.java new file mode 100644 index 0000000000000..a70119e7db742 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResourceList.java @@ -0,0 +1,32 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceListInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationTypeResourceList. */ +public interface ApplicationTypeResourceList { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of application type list results if there are any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeResourceListInner object. + * + * @return the inner object. + */ + ApplicationTypeResourceListInner innerModel(); +} 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 new file mode 100644 index 0000000000000..fa0c73196a3e6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java @@ -0,0 +1,243 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ApplicationTypeVersionResource. */ +public interface ApplicationTypeVersionResource { + /** + * 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 provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the appPackageUrl property: The URL to the application package. + * + * @return the appPackageUrl value. + */ + String appPackageUrl(); + + /** + * Gets the defaultParameterList property: List of application type parameters that can be overridden when creating + * or updating the application. + * + * @return the defaultParameterList value. + */ + Map defaultParameterList(); + + /** + * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceInner object. + * + * @return the inner object. + */ + ApplicationTypeVersionResourceInner innerModel(); + + /** The entirety of the ApplicationTypeVersionResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApplicationTypeVersionResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationTypeVersionResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApplicationTypeVersionResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, applicationTypeName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingApplicationType( + String resourceGroupName, String clusterName, String applicationTypeName); + } + /** + * 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationTypeVersionResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationTypeVersionResource create(Context context); + } + /** The stage of the ApplicationTypeVersionResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ApplicationTypeVersionResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ApplicationTypeVersionResource definition allowing to specify appPackageUrl. */ + interface WithAppPackageUrl { + /** + * Specifies the appPackageUrl property: The URL to the application package. + * + * @param appPackageUrl The URL to the application package. + * @return the next definition stage. + */ + WithCreate withAppPackageUrl(String appPackageUrl); + } + } + /** + * Begins update for the ApplicationTypeVersionResource resource. + * + * @return the stage of resource update. + */ + ApplicationTypeVersionResource.Update update(); + + /** The template for ApplicationTypeVersionResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithAppPackageUrl { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationTypeVersionResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationTypeVersionResource apply(Context context); + } + /** The ApplicationTypeVersionResource update stages. */ + interface UpdateStages { + /** The stage of the ApplicationTypeVersionResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ApplicationTypeVersionResource update allowing to specify appPackageUrl. */ + interface WithAppPackageUrl { + /** + * Specifies the appPackageUrl property: The URL to the application package. + * + * @param appPackageUrl The URL to the application package. + * @return the next definition stage. + */ + Update withAppPackageUrl(String appPackageUrl); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationTypeVersionResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationTypeVersionResource refresh(Context context); +} 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/models/ApplicationTypeVersionResourceList.java new file mode 100644 index 0000000000000..318a46c6ebfef --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResourceList.java @@ -0,0 +1,33 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceListInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationTypeVersionResourceList. */ +public interface ApplicationTypeVersionResourceList { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of application type version list results if there are any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationTypeVersionResourceListInner + * object. + * + * @return the inner object. + */ + ApplicationTypeVersionResourceListInner innerModel(); +} 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 new file mode 100644 index 0000000000000..c49a0cef773e0 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersions.java @@ -0,0 +1,162 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationTypeVersions. */ +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 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. + */ + ApplicationTypeVersionResource get( + String resourceGroupName, String clusterName, String applicationTypeName, String version); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationTypeName, String version); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context); + + /** + * 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 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 + * application type name resource. + */ + ApplicationTypeVersionResourceList list(String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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 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 + * application type name resource. + */ + Response listWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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 id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application type version resource created or in the process of being created in the + * Service Fabric application type name resource. + */ + ApplicationTypeVersionResource getById(String id); + + /** + * 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 id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application type version resource created or in the process of being created in the + * Service Fabric application type name resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric application type version resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric application type version resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationTypeVersionResource resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationTypeVersionResource definition. + */ + ApplicationTypeVersionResource.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..6ab9fc9eeb61a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java @@ -0,0 +1,50 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationTypeVersionsCleanupPolicy model. */ +@Fluent +public final class ApplicationTypeVersionsCleanupPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionsCleanupPolicy.class); + + /* + * Number of unused versions per application type to keep. + */ + @JsonProperty(value = "maxUnusedVersionsToKeep", required = true) + private int maxUnusedVersionsToKeep; + + /** + * Get the maxUnusedVersionsToKeep property: Number of unused versions per application type to keep. + * + * @return the maxUnusedVersionsToKeep value. + */ + public int maxUnusedVersionsToKeep() { + return this.maxUnusedVersionsToKeep; + } + + /** + * Set the maxUnusedVersionsToKeep property: Number of unused versions per application type to keep. + * + * @param maxUnusedVersionsToKeep the maxUnusedVersionsToKeep value to set. + * @return the ApplicationTypeVersionsCleanupPolicy object itself. + */ + public ApplicationTypeVersionsCleanupPolicy withMaxUnusedVersionsToKeep(int maxUnusedVersionsToKeep) { + this.maxUnusedVersionsToKeep = maxUnusedVersionsToKeep; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..51efe6cff5454 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypes.java @@ -0,0 +1,154 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationTypes. */ +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 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 + * Fabric cluster resource. + */ + ApplicationTypeResource get(String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationTypeName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationTypeName, Context context); + + /** + * 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 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. + */ + ApplicationTypeResourceList list(String resourceGroupName, String clusterName); + + /** + * 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 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. + */ + Response listWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Get a Service Fabric application type name resource created or in the process of being created in the Service + * Fabric cluster resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application type name resource created or in the process of being created in the Service + * Fabric cluster resource. + */ + ApplicationTypeResource getById(String id); + + /** + * Get a Service Fabric application type name resource created or in the process of being created in the Service + * Fabric cluster resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application type name resource created or in the process of being created in the Service + * Fabric cluster resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric application type name resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric application type name resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationTypeResource resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationTypeResource definition. + */ + ApplicationTypeResource.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..c4bd4b28deb1b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java @@ -0,0 +1,183 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the policy for a monitored application upgrade. */ +@Fluent +public final class ApplicationUpgradePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationUpgradePolicy.class); + + /* + * The maximum amount of time to block processing of an upgrade domain and + * prevent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. Valid values are between 0 and 42949672925 + * inclusive. (unsigned 32-bit integer). + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout") + private String upgradeReplicaSetCheckTimeout; + + /* + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /* + * The policy used for monitoring the application upgrade + */ + @JsonProperty(value = "rollingUpgradeMonitoringPolicy") + private ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy; + + /* + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + * + */ + @JsonProperty(value = "applicationHealthPolicy") + private ArmApplicationHealthPolicy applicationHealthPolicy; + + /* + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + */ + @JsonProperty(value = "upgradeMode") + private RollingUpgradeMode upgradeMode; + + /** + * Get the upgradeReplicaSetCheckTimeout property: The maximum amount of time to block processing of an upgrade + * domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing + * of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of + * each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + * + * @return the upgradeReplicaSetCheckTimeout value. + */ + public String upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the upgradeReplicaSetCheckTimeout property: The maximum amount of time to block processing of an upgrade + * domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing + * of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of + * each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withUpgradeReplicaSetCheckTimeout(String upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the forceRestart property: If true, then processes are forcefully restarted during upgrade even when the code + * version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value. + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set the forceRestart property: If true, then processes are forcefully restarted during upgrade even when the code + * version has not changed (the upgrade only changes configuration or data). + * + * @param forceRestart the forceRestart value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the rollingUpgradeMonitoringPolicy property: The policy used for monitoring the application upgrade. + * + * @return the rollingUpgradeMonitoringPolicy value. + */ + public ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy() { + return this.rollingUpgradeMonitoringPolicy; + } + + /** + * Set the rollingUpgradeMonitoringPolicy property: The policy used for monitoring the application upgrade. + * + * @param rollingUpgradeMonitoringPolicy the rollingUpgradeMonitoringPolicy value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withRollingUpgradeMonitoringPolicy( + ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy) { + this.rollingUpgradeMonitoringPolicy = rollingUpgradeMonitoringPolicy; + return this; + } + + /** + * Get the applicationHealthPolicy property: Defines a health policy used to evaluate the health of an application + * or one of its children entities. + * + * @return the applicationHealthPolicy value. + */ + public ArmApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set the applicationHealthPolicy property: Defines a health policy used to evaluate the health of an application + * or one of its children entities. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withApplicationHealthPolicy(ArmApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + + /** + * Get the upgradeMode property: The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + * + * @return the upgradeMode value. + */ + public RollingUpgradeMode upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode property: The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + * + * @param upgradeMode the upgradeMode value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withUpgradeMode(RollingUpgradeMode upgradeMode) { + this.upgradeMode = upgradeMode; + 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(); + } + } +} 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 new file mode 100644 index 0000000000000..fe7dddc496e02 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java @@ -0,0 +1,88 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationUserAssignedIdentity model. */ +@Fluent +public class ApplicationUserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationUserAssignedIdentity.class); + + /* + * The friendly name of user assigned identity. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /** + * Get the name property: The friendly name of user assigned identity. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The friendly name of user assigned identity. + * + * @param name the name value to set. + * @return the ApplicationUserAssignedIdentity object itself. + */ + public ApplicationUserAssignedIdentity withName(String name) { + this.name = name; + return this; + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the ApplicationUserAssignedIdentity object itself. + */ + public ApplicationUserAssignedIdentity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ApplicationUserAssignedIdentity")); + } + if (principalId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model ApplicationUserAssignedIdentity")); + } + } +} 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 new file mode 100644 index 0000000000000..6cad51a2502ce --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Applications.java @@ -0,0 +1,151 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Applications. */ +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 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 + * cluster resource. + */ + ApplicationResource get(String resourceGroupName, String clusterName, String applicationName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * 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 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. + */ + ApplicationResourceList list(String resourceGroupName, String clusterName); + + /** + * 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 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. + */ + Response listWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric + * cluster resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * cluster resource. + */ + ApplicationResource getById(String id); + + /** + * Get a Service Fabric application resource created or in the process of being created in the Service Fabric + * cluster resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric application resource created or in the process of being created in the Service Fabric + * cluster resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric application resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric application resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationResource resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationResource definition. + */ + ApplicationResource.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..b31b670bdb523 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java @@ -0,0 +1,171 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines a health policy used to evaluate the health of an application or one of its children entities. */ +@Fluent +public final class ArmApplicationHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmApplicationHealthPolicy.class); + + /* + * Indicates whether warnings are treated with the same severity as errors. + */ + @JsonProperty(value = "considerWarningAsError") + private Boolean considerWarningAsError; + + /* + * The maximum allowed percentage of unhealthy deployed applications. + * Allowed values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered + * in error. + * This is calculated by dividing the number of unhealthy deployed + * applications over the number of nodes where the application is currently + * deployed on in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + */ + @JsonProperty(value = "maxPercentUnhealthyDeployedApplications") + private Integer maxPercentUnhealthyDeployedApplications; + + /* + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "defaultServiceTypeHealthPolicy") + private ArmServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /* + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "serviceTypeHealthPolicyMap") + private Map serviceTypeHealthPolicyMap; + + /** + * Get the considerWarningAsError property: Indicates whether warnings are treated with the same severity as errors. + * + * @return the considerWarningAsError value. + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set the considerWarningAsError property: Indicates whether warnings are treated with the same severity as errors. + * + * @param considerWarningAsError the considerWarningAsError value to set. + * @return the ArmApplicationHealthPolicy object itself. + */ + public ArmApplicationHealthPolicy withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get the maxPercentUnhealthyDeployedApplications property: The maximum allowed percentage of unhealthy deployed + * applications. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated + * percentage of deployed applications that can be unhealthy before the application is considered in error. This is + * calculated by dividing the number of unhealthy deployed applications over the number of nodes where the + * application is currently deployed on in the cluster. The computation rounds up to tolerate one failure on small + * numbers of nodes. Default percentage is zero. + * + * @return the maxPercentUnhealthyDeployedApplications value. + */ + public Integer maxPercentUnhealthyDeployedApplications() { + return this.maxPercentUnhealthyDeployedApplications; + } + + /** + * Set the maxPercentUnhealthyDeployedApplications property: The maximum allowed percentage of unhealthy deployed + * applications. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated + * percentage of deployed applications that can be unhealthy before the application is considered in error. This is + * calculated by dividing the number of unhealthy deployed applications over the number of nodes where the + * application is currently deployed on in the cluster. The computation rounds up to tolerate one failure on small + * numbers of nodes. Default percentage is zero. + * + * @param maxPercentUnhealthyDeployedApplications the maxPercentUnhealthyDeployedApplications value to set. + * @return the ArmApplicationHealthPolicy object itself. + */ + public ArmApplicationHealthPolicy withMaxPercentUnhealthyDeployedApplications( + Integer maxPercentUnhealthyDeployedApplications) { + this.maxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications; + return this; + } + + /** + * Get the defaultServiceTypeHealthPolicy property: The health policy used by default to evaluate the health of a + * service type. + * + * @return the defaultServiceTypeHealthPolicy value. + */ + public ArmServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the defaultServiceTypeHealthPolicy property: The health policy used by default to evaluate the health of a + * service type. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set. + * @return the ArmApplicationHealthPolicy object itself. + */ + public ArmApplicationHealthPolicy withDefaultServiceTypeHealthPolicy( + ArmServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the serviceTypeHealthPolicyMap property: The map with service type health policy per service type name. The + * map is empty by default. + * + * @return the serviceTypeHealthPolicyMap value. + */ + public Map serviceTypeHealthPolicyMap() { + return this.serviceTypeHealthPolicyMap; + } + + /** + * Set the serviceTypeHealthPolicyMap property: The map with service type health policy per service type name. The + * map is empty by default. + * + * @param serviceTypeHealthPolicyMap the serviceTypeHealthPolicyMap value to set. + * @return the ArmApplicationHealthPolicy object itself. + */ + public ArmApplicationHealthPolicy withServiceTypeHealthPolicyMap( + Map serviceTypeHealthPolicyMap) { + this.serviceTypeHealthPolicyMap = 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(); + } + }); + } + } +} 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 new file mode 100644 index 0000000000000..b49739282eb50 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmRollingUpgradeMonitoringPolicy.java @@ -0,0 +1,219 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The policy used for monitoring the application upgrade. */ +@Fluent +public final class ArmRollingUpgradeMonitoringPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmRollingUpgradeMonitoringPolicy.class); + + /* + * The activation Mode of the service package + */ + @JsonProperty(value = "failureAction") + 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. + */ + @JsonProperty(value = "healthCheckWaitDuration") + 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. + */ + @JsonProperty(value = "healthCheckStableDuration") + 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. + */ + @JsonProperty(value = "healthCheckRetryTimeout") + 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. + */ + @JsonProperty(value = "upgradeTimeout") + 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. + */ + @JsonProperty(value = "upgradeDomainTimeout") + private String upgradeDomainTimeout; + + /** + * Get the failureAction property: The activation Mode of the service package. + * + * @return the failureAction value. + */ + public ArmUpgradeFailureAction failureAction() { + return this.failureAction; + } + + /** + * Set the failureAction property: The activation Mode of the service package. + * + * @param failureAction the failureAction value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withFailureAction(ArmUpgradeFailureAction failureAction) { + this.failureAction = failureAction; + return this; + } + + /** + * 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. + * + * @return the healthCheckWaitDuration value. + */ + public String healthCheckWaitDuration() { + return this.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. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * 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. + * + * @return the healthCheckStableDuration value. + */ + public String healthCheckStableDuration() { + return this.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. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * 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. + * + * @return the healthCheckRetryTimeout value. + */ + public String healthCheckRetryTimeout() { + return this.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. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * 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. + * + * @return the upgradeTimeout value. + */ + public String upgradeTimeout() { + return this.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. + * + * @param upgradeTimeout the upgradeTimeout value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * 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. + * + * @return the upgradeDomainTimeout value. + */ + public String upgradeDomainTimeout() { + return this.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. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set. + * @return the ArmRollingUpgradeMonitoringPolicy object itself. + */ + public ArmRollingUpgradeMonitoringPolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..97f6aa86e934a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServicePackageActivationMode.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ArmServicePackageActivationMode. */ +public final class ArmServicePackageActivationMode extends ExpandableStringEnum { + /** Static value SharedProcess for ArmServicePackageActivationMode. */ + public static final ArmServicePackageActivationMode SHARED_PROCESS = fromString("SharedProcess"); + + /** Static value ExclusiveProcess for ArmServicePackageActivationMode. */ + public static final ArmServicePackageActivationMode EXCLUSIVE_PROCESS = fromString("ExclusiveProcess"); + + /** + * Creates or finds a ArmServicePackageActivationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArmServicePackageActivationMode. + */ + @JsonCreator + public static ArmServicePackageActivationMode fromString(String name) { + return fromString(name, ArmServicePackageActivationMode.class); + } + + /** @return known ArmServicePackageActivationMode values. */ + public static Collection values() { + return values(ArmServicePackageActivationMode.class); + } +} 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 new file mode 100644 index 0000000000000..245889b226a09 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmServiceTypeHealthPolicy.java @@ -0,0 +1,116 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the health policy used to evaluate the health of services belonging to a service type. */ +@Fluent +public final class ArmServiceTypeHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmServiceTypeHealthPolicy.class); + + /* + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + */ + @JsonProperty(value = "maxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /* + * The maximum percentage of partitions per service allowed to be unhealthy + * before your application is considered in error. + * + */ + @JsonProperty(value = "maxPercentUnhealthyPartitionsPerService") + private Integer maxPercentUnhealthyPartitionsPerService; + + /* + * The maximum percentage of replicas per partition allowed to be unhealthy + * before your application is considered in error. + * + */ + @JsonProperty(value = "maxPercentUnhealthyReplicasPerPartition") + private Integer maxPercentUnhealthyReplicasPerPartition; + + /** + * Get the maxPercentUnhealthyServices property: The maximum percentage of services allowed to be unhealthy before + * your application is considered in error. + * + * @return the maxPercentUnhealthyServices value. + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maxPercentUnhealthyServices property: The maximum percentage of services allowed to be unhealthy before + * your application is considered in error. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set. + * @return the ArmServiceTypeHealthPolicy object itself. + */ + public ArmServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + + /** + * Get the maxPercentUnhealthyPartitionsPerService property: The maximum percentage of partitions per service + * allowed to be unhealthy before your application is considered in error. + * + * @return the maxPercentUnhealthyPartitionsPerService value. + */ + public Integer maxPercentUnhealthyPartitionsPerService() { + return this.maxPercentUnhealthyPartitionsPerService; + } + + /** + * Set the maxPercentUnhealthyPartitionsPerService property: The maximum percentage of partitions per service + * allowed to be unhealthy before your application is considered in error. + * + * @param maxPercentUnhealthyPartitionsPerService the maxPercentUnhealthyPartitionsPerService value to set. + * @return the ArmServiceTypeHealthPolicy object itself. + */ + public ArmServiceTypeHealthPolicy withMaxPercentUnhealthyPartitionsPerService( + Integer maxPercentUnhealthyPartitionsPerService) { + this.maxPercentUnhealthyPartitionsPerService = maxPercentUnhealthyPartitionsPerService; + return this; + } + + /** + * Get the maxPercentUnhealthyReplicasPerPartition property: The maximum percentage of replicas per partition + * allowed to be unhealthy before your application is considered in error. + * + * @return the maxPercentUnhealthyReplicasPerPartition value. + */ + public Integer maxPercentUnhealthyReplicasPerPartition() { + return this.maxPercentUnhealthyReplicasPerPartition; + } + + /** + * Set the maxPercentUnhealthyReplicasPerPartition property: The maximum percentage of replicas per partition + * allowed to be unhealthy before your application is considered in error. + * + * @param maxPercentUnhealthyReplicasPerPartition the maxPercentUnhealthyReplicasPerPartition value to set. + * @return the ArmServiceTypeHealthPolicy object itself. + */ + public ArmServiceTypeHealthPolicy withMaxPercentUnhealthyReplicasPerPartition( + Integer maxPercentUnhealthyReplicasPerPartition) { + this.maxPercentUnhealthyReplicasPerPartition = maxPercentUnhealthyReplicasPerPartition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..fd1a80bbd4474 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmUpgradeFailureAction.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ArmUpgradeFailureAction. */ +public final class ArmUpgradeFailureAction extends ExpandableStringEnum { + /** Static value Rollback for ArmUpgradeFailureAction. */ + public static final ArmUpgradeFailureAction ROLLBACK = fromString("Rollback"); + + /** Static value Manual for ArmUpgradeFailureAction. */ + public static final ArmUpgradeFailureAction MANUAL = fromString("Manual"); + + /** + * Creates or finds a ArmUpgradeFailureAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArmUpgradeFailureAction. + */ + @JsonCreator + public static ArmUpgradeFailureAction fromString(String name) { + return fromString(name, ArmUpgradeFailureAction.class); + } + + /** @return known ArmUpgradeFailureAction values. */ + public static Collection values() { + return values(ArmUpgradeFailureAction.class); + } +} 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 new file mode 100644 index 0000000000000..919e9e543444d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AvailableOperationDisplay.java @@ -0,0 +1,128 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation supported by the Service Fabric resource provider. */ +@Fluent +public final class AvailableOperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperationDisplay.class); + + /* + * The name of the provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource on which the operation is performed + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation that can be performed. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Operation description + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: The name of the provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The name of the provider. + * + * @param provider the provider value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation that can be performed. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation that can be performed. + * + * @param operation the operation value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Operation description. + * + * @param description the description value to set. + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AzureActiveDirectory.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AzureActiveDirectory.java new file mode 100644 index 0000000000000..f304ec493c154 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/AzureActiveDirectory.java @@ -0,0 +1,102 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings to enable AAD authentication on the cluster. */ +@Fluent +public final class AzureActiveDirectory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectory.class); + + /* + * Azure active directory tenant id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Azure active directory cluster application id. + */ + @JsonProperty(value = "clusterApplication") + private String clusterApplication; + + /* + * Azure active directory client application id. + */ + @JsonProperty(value = "clientApplication") + private String clientApplication; + + /** + * Get the tenantId property: Azure active directory tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Azure active directory tenant id. + * + * @param tenantId the tenantId value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the clusterApplication property: Azure active directory cluster application id. + * + * @return the clusterApplication value. + */ + public String clusterApplication() { + return this.clusterApplication; + } + + /** + * Set the clusterApplication property: Azure active directory cluster application id. + * + * @param clusterApplication the clusterApplication value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClusterApplication(String clusterApplication) { + this.clusterApplication = clusterApplication; + return this; + } + + /** + * Get the clientApplication property: Azure active directory client application id. + * + * @return the clientApplication value. + */ + public String clientApplication() { + return this.clientApplication; + } + + /** + * Set the clientApplication property: Azure active directory client application id. + * + * @param clientApplication the clientApplication value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClientApplication(String clientApplication) { + this.clientApplication = clientApplication; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/CertificateDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/CertificateDescription.java new file mode 100644 index 0000000000000..2e827d1bc674c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/CertificateDescription.java @@ -0,0 +1,108 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the certificate details. */ +@Fluent +public final class CertificateDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateDescription.class); + + /* + * Thumbprint of the primary certificate. + */ + @JsonProperty(value = "thumbprint", required = true) + private String thumbprint; + + /* + * Thumbprint of the secondary certificate. + */ + @JsonProperty(value = "thumbprintSecondary") + private String thumbprintSecondary; + + /* + * The local certificate store location. + */ + @JsonProperty(value = "x509StoreName") + private StoreName x509StoreName; + + /** + * Get the thumbprint property: Thumbprint of the primary certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Thumbprint of the primary certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the thumbprintSecondary property: Thumbprint of the secondary certificate. + * + * @return the thumbprintSecondary value. + */ + public String thumbprintSecondary() { + return this.thumbprintSecondary; + } + + /** + * Set the thumbprintSecondary property: Thumbprint of the secondary certificate. + * + * @param thumbprintSecondary the thumbprintSecondary value to set. + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprintSecondary(String thumbprintSecondary) { + this.thumbprintSecondary = thumbprintSecondary; + return this; + } + + /** + * Get the x509StoreName property: The local certificate store location. + * + * @return the x509StoreName value. + */ + public StoreName x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the x509StoreName property: The local certificate store location. + * + * @param x509StoreName the x509StoreName value to set. + * @return the CertificateDescription object itself. + */ + public CertificateDescription withX509StoreName(StoreName x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (thumbprint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property thumbprint in model CertificateDescription")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java new file mode 100644 index 0000000000000..d212a654e2645 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java @@ -0,0 +1,129 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Client Certificate definition. */ +@Fluent +public final class ClientCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientCertificate.class); + + /* + * Whether the certificate is admin or not. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /* + * Certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Certificate Common name. + */ + @JsonProperty(value = "commonName") + private String commonName; + + /* + * Issuer thumbprint for the certificate. Only used together with + * CommonName. + */ + @JsonProperty(value = "issuerThumbprint") + private String issuerThumbprint; + + /** + * Get the isAdmin property: Whether the certificate is admin or not. + * + * @return the isAdmin value. + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set the isAdmin property: Whether the certificate is admin or not. + * + * @param isAdmin the isAdmin value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the thumbprint property: Certificate Thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the commonName property: Certificate Common name. + * + * @return the commonName value. + */ + public String commonName() { + return this.commonName; + } + + /** + * Set the commonName property: Certificate Common name. + * + * @param commonName the commonName value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withCommonName(String commonName) { + this.commonName = commonName; + return this; + } + + /** + * Get the issuerThumbprint property: Issuer thumbprint for the certificate. Only used together with CommonName. + * + * @return the issuerThumbprint value. + */ + public String issuerThumbprint() { + return this.issuerThumbprint; + } + + /** + * Set the issuerThumbprint property: Issuer thumbprint for the certificate. Only used together with CommonName. + * + * @param issuerThumbprint the issuerThumbprint value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withIssuerThumbprint(String issuerThumbprint) { + this.issuerThumbprint = issuerThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateCommonName.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateCommonName.java new file mode 100644 index 0000000000000..161777d2f4f70 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateCommonName.java @@ -0,0 +1,117 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the client certificate details using common name. */ +@Fluent +public final class ClientCertificateCommonName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientCertificateCommonName.class); + + /* + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /* + * The common name of the client certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /* + * The issuer thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients + * can perform only read only operations on the cluster. + * + * @return the isAdmin value. + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients + * can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set. + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the certificateCommonName property: The common name of the client certificate. + * + * @return the certificateCommonName value. + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the certificateCommonName property: The common name of the client certificate. + * + * @param certificateCommonName the certificateCommonName value to set. + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the certificateIssuerThumbprint property: The issuer thumbprint of the client certificate. + * + * @return the certificateIssuerThumbprint value. + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the certificateIssuerThumbprint property: The issuer thumbprint of the client certificate. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set. + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateCommonName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateCommonName in model ClientCertificateCommonName")); + } + if (certificateIssuerThumbprint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateIssuerThumbprint in model ClientCertificateCommonName")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateThumbprint.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateThumbprint.java new file mode 100644 index 0000000000000..14b21c1d6b6a8 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificateThumbprint.java @@ -0,0 +1,85 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the client certificate details using thumbprint. */ +@Fluent +public final class ClientCertificateThumbprint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientCertificateThumbprint.class); + + /* + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /* + * The thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateThumbprint", required = true) + private String certificateThumbprint; + + /** + * Get the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients + * can perform only read only operations on the cluster. + * + * @return the isAdmin value. + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients + * can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set. + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the certificateThumbprint property: The thumbprint of the client certificate. + * + * @return the certificateThumbprint value. + */ + public String certificateThumbprint() { + return this.certificateThumbprint; + } + + /** + * Set the certificateThumbprint property: The thumbprint of the client certificate. + * + * @param certificateThumbprint the certificateThumbprint value to set. + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withCertificateThumbprint(String certificateThumbprint) { + this.certificateThumbprint = certificateThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateThumbprint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateThumbprint in model ClientCertificateThumbprint")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java new file mode 100644 index 0000000000000..a3933c90d189f --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java @@ -0,0 +1,866 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the addOnFeatures property: The list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value. + */ + List addOnFeatures(); + + /** + * Gets the availableClusterVersions property: The Service Fabric runtime versions available for this cluster. + * + * @return the availableClusterVersions value. + */ + List availableClusterVersions(); + + /** + * Gets the azureActiveDirectory property: The AAD authentication settings of the cluster. + * + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * Gets the certificate property: The certificate to use for securing the cluster. The certificate provided will be + * used for node to node security within the cluster, SSL certificate for cluster management endpoint and default + * admin client. + * + * @return the certificate value. + */ + CertificateDescription certificate(); + + /** + * Gets the certificateCommonNames property: Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + * + * @return the certificateCommonNames value. + */ + ServerCertificateCommonNames certificateCommonNames(); + + /** + * Gets the clientCertificateCommonNames property: The list of client certificates referenced by common name that + * are allowed to manage the cluster. + * + * @return the clientCertificateCommonNames value. + */ + List clientCertificateCommonNames(); + + /** + * Gets the clientCertificateThumbprints property: The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + * + * @return the clientCertificateThumbprints value. + */ + List clientCertificateThumbprints(); + + /** + * Gets the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only + * by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + String clusterCodeVersion(); + + /** + * Gets the clusterEndpoint property: The Azure Resource Provider endpoint. A system service in the cluster connects + * to this endpoint. + * + * @return the clusterEndpoint value. + */ + String clusterEndpoint(); + + /** + * Gets the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the clusterState property: 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. + * + * @return the clusterState value. + */ + ClusterState clusterState(); + + /** + * Gets the diagnosticsStorageAccountConfig property: The storage account information for storing Service Fabric + * diagnostic logs. + * + * @return the diagnosticsStorageAccountConfig value. + */ + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig(); + + /** + * Gets the eventStoreServiceEnabled property: Indicates if the event store service is enabled. + * + * @return the eventStoreServiceEnabled value. + */ + Boolean eventStoreServiceEnabled(); + + /** + * Gets the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + List fabricSettings(); + + /** + * Gets the managementEndpoint property: The http management endpoint of the cluster. + * + * @return the managementEndpoint value. + */ + String managementEndpoint(); + + /** + * Gets the nodeTypes property: The list of node types in the cluster. + * + * @return the nodeTypes value. + */ + List nodeTypes(); + + /** + * Gets the provisioningState property: The provisioning state of the cluster resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the reliabilityLevel property: 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. + * + * @return the reliabilityLevel value. + */ + ReliabilityLevel reliabilityLevel(); + + /** + * Gets the reverseProxyCertificate property: The server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value. + */ + CertificateDescription reverseProxyCertificate(); + + /** + * Gets the reverseProxyCertificateCommonNames property: Describes a list of server certificates referenced by + * common name that are used to secure the cluster. + * + * @return the reverseProxyCertificateCommonNames value. + */ + ServerCertificateCommonNames reverseProxyCertificateCommonNames(); + + /** + * Gets the upgradeDescription property: The policy to use when upgrading the cluster. + * + * @return the upgradeDescription value. + */ + ClusterUpgradePolicy upgradeDescription(); + + /** + * Gets the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime version is + * available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon + * as it is available. - Manual - 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. + * + * @return the upgradeMode value. + */ + UpgradeMode upgradeMode(); + + /** + * Gets the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy(); + + /** + * Gets the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows or Linux can + * be used. + * + * @return the vmImage value. + */ + String vmImage(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Cluster definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Cluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Cluster definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithAddOnFeatures, + DefinitionStages.WithAzureActiveDirectory, + DefinitionStages.WithCertificate, + DefinitionStages.WithCertificateCommonNames, + DefinitionStages.WithClientCertificateCommonNames, + DefinitionStages.WithClientCertificateThumbprints, + DefinitionStages.WithClusterCodeVersion, + DefinitionStages.WithDiagnosticsStorageAccountConfig, + DefinitionStages.WithEventStoreServiceEnabled, + DefinitionStages.WithFabricSettings, + DefinitionStages.WithManagementEndpoint, + DefinitionStages.WithNodeTypes, + DefinitionStages.WithReliabilityLevel, + DefinitionStages.WithReverseProxyCertificate, + DefinitionStages.WithReverseProxyCertificateCommonNames, + DefinitionStages.WithUpgradeDescription, + DefinitionStages.WithUpgradeMode, + DefinitionStages.WithApplicationTypeVersionsCleanupPolicy, + DefinitionStages.WithVmImage { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + /** The stage of the Cluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Cluster definition allowing to specify addOnFeatures. */ + interface WithAddOnFeatures { + /** + * Specifies the addOnFeatures property: The list of add-on features to enable in the cluster.. + * + * @param addOnFeatures The list of add-on features to enable in the cluster. + * @return the next definition stage. + */ + WithCreate withAddOnFeatures(List addOnFeatures); + } + /** The stage of the Cluster definition allowing to specify azureActiveDirectory. */ + interface WithAzureActiveDirectory { + /** + * Specifies the azureActiveDirectory property: The AAD authentication settings of the cluster.. + * + * @param azureActiveDirectory The AAD authentication settings of the cluster. + * @return the next definition stage. + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + /** The stage of the Cluster definition allowing to specify certificate. */ + interface WithCertificate { + /** + * Specifies the certificate property: The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL certificate for cluster + * management endpoint and default admin client.. + * + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used + * for node to node security within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * @return the next definition stage. + */ + WithCreate withCertificate(CertificateDescription certificate); + } + /** The stage of the Cluster definition allowing to specify certificateCommonNames. */ + interface WithCertificateCommonNames { + /** + * Specifies the certificateCommonNames property: Describes a list of server certificates referenced by + * common name that are used to secure the cluster.. + * + * @param certificateCommonNames Describes a list of server certificates referenced by common name that are + * used to secure the cluster. + * @return the next definition stage. + */ + WithCreate withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames); + } + /** The stage of the Cluster definition allowing to specify clientCertificateCommonNames. */ + interface WithClientCertificateCommonNames { + /** + * Specifies the clientCertificateCommonNames property: The list of client certificates referenced by common + * name that are allowed to manage the cluster.. + * + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are + * allowed to manage the cluster. + * @return the next definition stage. + */ + WithCreate withClientCertificateCommonNames(List clientCertificateCommonNames); + } + /** The stage of the Cluster definition allowing to specify clientCertificateThumbprints. */ + interface WithClientCertificateThumbprints { + /** + * Specifies the clientCertificateThumbprints property: The list of client certificates referenced by + * thumbprint that are allowed to manage the cluster.. + * + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + * @return the next definition stage. + */ + WithCreate withClientCertificateThumbprints(List clientCertificateThumbprints); + } + /** The stage of the Cluster definition allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This + * property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available + * Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list + * of available version for existing clusters use **availableClusterVersions**.. + * + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + * @return the next definition stage. + */ + WithCreate withClusterCodeVersion(String clusterCodeVersion); + } + /** The stage of the Cluster definition allowing to specify diagnosticsStorageAccountConfig. */ + interface WithDiagnosticsStorageAccountConfig { + /** + * Specifies the diagnosticsStorageAccountConfig property: The storage account information for storing + * Service Fabric diagnostic logs.. + * + * @param diagnosticsStorageAccountConfig The storage account information for storing Service Fabric + * diagnostic logs. + * @return the next definition stage. + */ + WithCreate withDiagnosticsStorageAccountConfig( + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig); + } + /** The stage of the Cluster definition allowing to specify eventStoreServiceEnabled. */ + interface WithEventStoreServiceEnabled { + /** + * Specifies the eventStoreServiceEnabled property: Indicates if the event store service is enabled.. + * + * @param eventStoreServiceEnabled Indicates if the event store service is enabled. + * @return the next definition stage. + */ + WithCreate withEventStoreServiceEnabled(Boolean eventStoreServiceEnabled); + } + /** The stage of the Cluster definition allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster.. + * + * @param fabricSettings The list of custom fabric settings to configure the cluster. + * @return the next definition stage. + */ + WithCreate withFabricSettings(List fabricSettings); + } + /** The stage of the Cluster definition allowing to specify managementEndpoint. */ + interface WithManagementEndpoint { + /** + * Specifies the managementEndpoint property: The http management endpoint of the cluster.. + * + * @param managementEndpoint The http management endpoint of the cluster. + * @return the next definition stage. + */ + WithCreate withManagementEndpoint(String managementEndpoint); + } + /** The stage of the Cluster definition allowing to specify nodeTypes. */ + interface WithNodeTypes { + /** + * Specifies the nodeTypes property: The list of node types in the cluster.. + * + * @param nodeTypes The list of node types in the cluster. + * @return the next definition stage. + */ + WithCreate withNodeTypes(List nodeTypes); + } + /** The stage of the Cluster definition allowing to specify reliabilityLevel. */ + interface WithReliabilityLevel { + /** + * Specifies the reliabilityLevel property: 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. . + * + * @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). + *

- 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. + * @return the next definition stage. + */ + WithCreate withReliabilityLevel(ReliabilityLevel reliabilityLevel); + } + /** The stage of the Cluster definition allowing to specify reverseProxyCertificate. */ + interface WithReverseProxyCertificate { + /** + * Specifies the reverseProxyCertificate property: The server certificate used by reverse proxy.. + * + * @param reverseProxyCertificate The server certificate used by reverse proxy. + * @return the next definition stage. + */ + WithCreate withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + /** The stage of the Cluster definition allowing to specify reverseProxyCertificateCommonNames. */ + interface WithReverseProxyCertificateCommonNames { + /** + * Specifies the reverseProxyCertificateCommonNames property: Describes a list of server certificates + * referenced by common name that are used to secure the cluster.. + * + * @param reverseProxyCertificateCommonNames Describes a list of server certificates referenced by common + * name that are used to secure the cluster. + * @return the next definition stage. + */ + WithCreate withReverseProxyCertificateCommonNames( + ServerCertificateCommonNames reverseProxyCertificateCommonNames); + } + /** The stage of the Cluster definition allowing to specify upgradeDescription. */ + interface WithUpgradeDescription { + /** + * Specifies the upgradeDescription property: The policy to use when upgrading the cluster.. + * + * @param upgradeDescription The policy to use when upgrading the cluster. + * @return the next definition stage. + */ + WithCreate withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + /** The stage of the Cluster definition allowing to specify upgradeMode. */ + interface WithUpgradeMode { + /** + * Specifies the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime + * version is available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version + * as soon as it is available. - Manual - 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. . + * + * @param upgradeMode The upgrade mode of the cluster when new Service Fabric runtime version is available. + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime + * version as soon as it is available. - Manual - 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. + * @return the next definition stage. + */ + WithCreate withUpgradeMode(UpgradeMode upgradeMode); + } + /** The stage of the Cluster definition allowing to specify applicationTypeVersionsCleanupPolicy. */ + interface WithApplicationTypeVersionsCleanupPolicy { + /** + * Specifies the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused + * versions.. + * + * @param applicationTypeVersionsCleanupPolicy The policy used to clean up unused versions. + * @return the next definition stage. + */ + WithCreate withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy); + } + /** The stage of the Cluster definition allowing to specify vmImage. */ + interface WithVmImage { + /** + * Specifies the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows + * or Linux can be used.. + * + * @param vmImage The VM image VMSS has been configured with. Generic names such as Windows or Linux can be + * used. + * @return the next definition stage. + */ + WithCreate withVmImage(String vmImage); + } + } + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAddOnFeatures, + UpdateStages.WithCertificate, + UpdateStages.WithCertificateCommonNames, + UpdateStages.WithClientCertificateCommonNames, + UpdateStages.WithClientCertificateThumbprints, + UpdateStages.WithClusterCodeVersion, + UpdateStages.WithEventStoreServiceEnabled, + UpdateStages.WithFabricSettings, + UpdateStages.WithNodeTypes, + UpdateStages.WithReliabilityLevel, + UpdateStages.WithReverseProxyCertificate, + UpdateStages.WithUpgradeDescription, + UpdateStages.WithUpgradeMode, + UpdateStages.WithApplicationTypeVersionsCleanupPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Cluster update parameters. + * + * @param tags Cluster update parameters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Cluster update allowing to specify addOnFeatures. */ + interface WithAddOnFeatures { + /** + * Specifies the addOnFeatures property: The list of add-on features to enable in the cluster.. + * + * @param addOnFeatures The list of add-on features to enable in the cluster. + * @return the next definition stage. + */ + Update withAddOnFeatures(List addOnFeatures); + } + /** The stage of the Cluster update allowing to specify certificate. */ + interface WithCertificate { + /** + * Specifies the certificate property: The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL certificate for cluster + * management endpoint and default admin client.. + * + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used + * for node to node security within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * @return the next definition stage. + */ + Update withCertificate(CertificateDescription certificate); + } + /** The stage of the Cluster update allowing to specify certificateCommonNames. */ + interface WithCertificateCommonNames { + /** + * Specifies the certificateCommonNames property: Describes a list of server certificates referenced by + * common name that are used to secure the cluster.. + * + * @param certificateCommonNames Describes a list of server certificates referenced by common name that are + * used to secure the cluster. + * @return the next definition stage. + */ + Update withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames); + } + /** The stage of the Cluster update allowing to specify clientCertificateCommonNames. */ + interface WithClientCertificateCommonNames { + /** + * Specifies the clientCertificateCommonNames property: The list of client certificates referenced by common + * name that are allowed to manage the cluster. This will overwrite the existing list.. + * + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + * @return the next definition stage. + */ + Update withClientCertificateCommonNames(List clientCertificateCommonNames); + } + /** The stage of the Cluster update allowing to specify clientCertificateThumbprints. */ + interface WithClientCertificateThumbprints { + /** + * Specifies the clientCertificateThumbprints property: The list of client certificates referenced by + * thumbprint that are allowed to manage the cluster. This will overwrite the existing list.. + * + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + * @return the next definition stage. + */ + Update withClientCertificateThumbprints(List clientCertificateThumbprints); + } + /** The stage of the Cluster update allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This + * property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available + * Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list + * of available version for existing clusters use **availableClusterVersions**.. + * + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + * @return the next definition stage. + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + /** The stage of the Cluster update allowing to specify eventStoreServiceEnabled. */ + interface WithEventStoreServiceEnabled { + /** + * Specifies the eventStoreServiceEnabled property: Indicates if the event store service is enabled.. + * + * @param eventStoreServiceEnabled Indicates if the event store service is enabled. + * @return the next definition stage. + */ + Update withEventStoreServiceEnabled(Boolean eventStoreServiceEnabled); + } + /** The stage of the Cluster update allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster. This + * will overwrite the existing list.. + * + * @param fabricSettings The list of custom fabric settings to configure the cluster. This will overwrite + * the existing list. + * @return the next definition stage. + */ + Update withFabricSettings(List fabricSettings); + } + /** The stage of the Cluster update allowing to specify nodeTypes. */ + interface WithNodeTypes { + /** + * Specifies the nodeTypes property: The list of node types in the cluster. This will overwrite the existing + * list.. + * + * @param nodeTypes The list of node types in the cluster. This will overwrite the existing list. + * @return the next definition stage. + */ + Update withNodeTypes(List nodeTypes); + } + /** The stage of the Cluster update allowing to specify reliabilityLevel. */ + interface WithReliabilityLevel { + /** + * Specifies the reliabilityLevel property: 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. . + * + * @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). + *

- 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. + * @return the next definition stage. + */ + Update withReliabilityLevel(ReliabilityLevel reliabilityLevel); + } + /** The stage of the Cluster update allowing to specify reverseProxyCertificate. */ + interface WithReverseProxyCertificate { + /** + * Specifies the reverseProxyCertificate property: The server certificate used by reverse proxy.. + * + * @param reverseProxyCertificate The server certificate used by reverse proxy. + * @return the next definition stage. + */ + Update withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + /** The stage of the Cluster update allowing to specify upgradeDescription. */ + interface WithUpgradeDescription { + /** + * Specifies the upgradeDescription property: The policy to use when upgrading the cluster.. + * + * @param upgradeDescription The policy to use when upgrading the cluster. + * @return the next definition stage. + */ + Update withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + /** The stage of the Cluster update allowing to specify upgradeMode. */ + interface WithUpgradeMode { + /** + * Specifies the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime + * version is available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version + * as soon as it is available. - Manual - 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. . + * + * @param upgradeMode The upgrade mode of the cluster when new Service Fabric runtime version is available. + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime + * version as soon as it is available. - Manual - 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. + * @return the next definition stage. + */ + Update withUpgradeMode(UpgradeMode upgradeMode); + } + /** The stage of the Cluster update allowing to specify applicationTypeVersionsCleanupPolicy. */ + interface WithApplicationTypeVersionsCleanupPolicy { + /** + * Specifies the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused + * versions.. + * + * @param applicationTypeVersionsCleanupPolicy The policy used to clean up unused versions. + * @return the next definition stage. + */ + Update withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); +} 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 new file mode 100644 index 0000000000000..194977f8b66eb --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsListResult.java @@ -0,0 +1,32 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner; +import java.util.List; + +/** An immutable client-side representation of ClusterCodeVersionsListResult. */ +public interface ClusterCodeVersionsListResult { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ClusterCodeVersionsListResultInner object. + * + * @return the inner object. + */ + ClusterCodeVersionsListResultInner innerModel(); +} 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 new file mode 100644 index 0000000000000..decd732024d24 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterCodeVersionsResult.java @@ -0,0 +1,182 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result of the Service Fabric runtime versions. */ +@JsonFlatten +@Fluent +public class ClusterCodeVersionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterCodeVersionsResult.class); + + /* + * The identification of the result + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the result + */ + @JsonProperty(value = "name") + private String name; + + /* + * The result resource type + */ + @JsonProperty(value = "type") + private String type; + + /* + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "properties.codeVersion") + private String codeVersion; + + /* + * The date of expiry of support of the version. + */ + @JsonProperty(value = "properties.supportExpiryUtc") + private String supportExpiryUtc; + + /* + * Indicates if this version is for Windows or Linux operating system. + */ + @JsonProperty(value = "properties.environment") + private ClusterEnvironment environment; + + /** + * Get the id property: The identification of the result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The identification of the result. + * + * @param id the id value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the result. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the result. + * + * @param name the name value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The result resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The result resource type. + * + * @param type the type value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withType(String type) { + this.type = type; + return this; + } + + /** + * Get the codeVersion property: The Service Fabric runtime version of the cluster. + * + * @return the codeVersion value. + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the codeVersion property: The Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the supportExpiryUtc property: The date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get the environment property: Indicates if this version is for Windows or Linux operating system. + * + * @return the environment value. + */ + public ClusterEnvironment environment() { + return this.environment; + } + + /** + * Set the environment property: Indicates if this version is for Windows or Linux operating system. + * + * @param environment the environment value to set. + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withEnvironment(ClusterEnvironment environment) { + this.environment = environment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterEnvironment.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterEnvironment.java new file mode 100644 index 0000000000000..b18482217aa04 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterEnvironment.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterEnvironment. */ +public final class ClusterEnvironment extends ExpandableStringEnum { + /** Static value Windows for ClusterEnvironment. */ + public static final ClusterEnvironment WINDOWS = fromString("Windows"); + + /** Static value Linux for ClusterEnvironment. */ + public static final ClusterEnvironment LINUX = fromString("Linux"); + + /** + * Creates or finds a ClusterEnvironment from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterEnvironment. + */ + @JsonCreator + public static ClusterEnvironment fromString(String name) { + return fromString(name, ClusterEnvironment.class); + } + + /** @return known ClusterEnvironment values. */ + public static Collection values() { + return values(ClusterEnvironment.class); + } +} 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 new file mode 100644 index 0000000000000..4e6bb3431f3c0 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java @@ -0,0 +1,183 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines a health policy used to evaluate the health of the cluster or of a cluster node. */ +@Fluent +public final class ClusterHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterHealthPolicy.class); + + /* + * The maximum allowed percentage of unhealthy nodes before reporting an + * error. For example, to allow 10% of nodes to be unhealthy, this value + * would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + */ + @JsonProperty(value = "maxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /* + * The maximum allowed percentage of unhealthy applications before + * reporting an error. For example, to allow 10% of applications to be + * unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of + * applications that can be unhealthy before the cluster is considered in + * error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + */ + @JsonProperty(value = "maxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /* + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "applicationHealthPolicies") + private Map applicationHealthPolicies; + + /** + * Get the maxPercentUnhealthyNodes property: The maximum allowed percentage of unhealthy nodes before reporting an + * error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + *

The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster + * is considered in error. If the percentage is respected but there is at least one unhealthy node, the health is + * evaluated as Warning. The percentage is calculated by dividing the number of unhealthy nodes over the total + * number of nodes in the cluster. The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + *

In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured + * to tolerate that. + * + * @return the maxPercentUnhealthyNodes value. + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set the maxPercentUnhealthyNodes property: The maximum allowed percentage of unhealthy nodes before reporting an + * error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + *

The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster + * is considered in error. If the percentage is respected but there is at least one unhealthy node, the health is + * evaluated as Warning. The percentage is calculated by dividing the number of unhealthy nodes over the total + * number of nodes in the cluster. The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + *

In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured + * to tolerate that. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set. + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get the maxPercentUnhealthyApplications property: The maximum allowed percentage of unhealthy applications before + * reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + *

The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the + * cluster is considered in error. If the percentage is respected but there is at least one unhealthy application, + * the health is evaluated as Warning. This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications of application types that are + * included in the ApplicationTypeHealthPolicyMap. The computation rounds up to tolerate one failure on small + * numbers of applications. Default percentage is zero. + * + * @return the maxPercentUnhealthyApplications value. + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set the maxPercentUnhealthyApplications property: The maximum allowed percentage of unhealthy applications before + * reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + *

The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the + * cluster is considered in error. If the percentage is respected but there is at least one unhealthy application, + * the health is evaluated as Warning. This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications of application types that are + * included in the ApplicationTypeHealthPolicyMap. The computation rounds up to tolerate one failure on small + * numbers of applications. Default percentage is zero. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set. + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get the applicationHealthPolicies property: Defines the application health policy map used to evaluate the health + * of an application or one of its children entities. + * + * @return the applicationHealthPolicies value. + */ + public Map applicationHealthPolicies() { + return this.applicationHealthPolicies; + } + + /** + * Set the applicationHealthPolicies property: Defines the application health policy map used to evaluate the health + * of an application or one of its children entities. + * + * @param applicationHealthPolicies the applicationHealthPolicies value to set. + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withApplicationHealthPolicies( + Map applicationHealthPolicies) { + this.applicationHealthPolicies = 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(); + } + }); + } + } +} 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/models/ClusterListResult.java new file mode 100644 index 0000000000000..971d9e3432be0 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterListResult.java @@ -0,0 +1,32 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner; +import java.util.List; + +/** An immutable client-side representation of ClusterListResult. */ +public interface ClusterListResult { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ClusterListResultInner object. + * + * @return the inner object. + */ + ClusterListResultInner innerModel(); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java new file mode 100644 index 0000000000000..cabeddc052587 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterOsType. */ +public final class ClusterOsType extends ExpandableStringEnum { + /** Static value Windows for ClusterOsType. */ + public static final ClusterOsType WINDOWS = fromString("Windows"); + + /** Static value Ubuntu for ClusterOsType. */ + public static final ClusterOsType UBUNTU = fromString("Ubuntu"); + + /** Static value RedHat for ClusterOsType. */ + public static final ClusterOsType RED_HAT = fromString("RedHat"); + + /** Static value Ubuntu18_04 for ClusterOsType. */ + public static final ClusterOsType UBUNTU18_04 = fromString("Ubuntu18_04"); + + /** + * Creates or finds a ClusterOsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterOsType. + */ + @JsonCreator + public static ClusterOsType fromString(String name) { + return fromString(name, ClusterOsType.class); + } + + /** @return known ClusterOsType values. */ + public static Collection values() { + return values(ClusterOsType.class); + } +} 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 new file mode 100644 index 0000000000000..22ab39345896c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterState.java @@ -0,0 +1,58 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterState. */ +public final class ClusterState extends ExpandableStringEnum { + /** Static value WaitingForNodes for ClusterState. */ + public static final ClusterState WAITING_FOR_NODES = fromString("WaitingForNodes"); + + /** Static value Deploying for ClusterState. */ + public static final ClusterState DEPLOYING = fromString("Deploying"); + + /** Static value BaselineUpgrade for ClusterState. */ + public static final ClusterState BASELINE_UPGRADE = fromString("BaselineUpgrade"); + + /** Static value UpdatingUserConfiguration for ClusterState. */ + public static final ClusterState UPDATING_USER_CONFIGURATION = fromString("UpdatingUserConfiguration"); + + /** Static value UpdatingUserCertificate for ClusterState. */ + public static final ClusterState UPDATING_USER_CERTIFICATE = fromString("UpdatingUserCertificate"); + + /** Static value UpdatingInfrastructure for ClusterState. */ + public static final ClusterState UPDATING_INFRASTRUCTURE = fromString("UpdatingInfrastructure"); + + /** Static value EnforcingClusterVersion for ClusterState. */ + public static final ClusterState ENFORCING_CLUSTER_VERSION = fromString("EnforcingClusterVersion"); + + /** Static value UpgradeServiceUnreachable for ClusterState. */ + public static final ClusterState UPGRADE_SERVICE_UNREACHABLE = fromString("UpgradeServiceUnreachable"); + + /** Static value AutoScale for ClusterState. */ + public static final ClusterState AUTO_SCALE = fromString("AutoScale"); + + /** Static value Ready for ClusterState. */ + public static final ClusterState READY = fromString("Ready"); + + /** + * Creates or finds a ClusterState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterState. + */ + @JsonCreator + public static ClusterState fromString(String name) { + return fromString(name, ClusterState.class); + } + + /** @return known ClusterState values. */ + public static Collection values() { + return values(ClusterState.class); + } +} 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 new file mode 100644 index 0000000000000..bc1e773911ef4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java @@ -0,0 +1,521 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Cluster update request. */ +@JsonFlatten +@Fluent +public class ClusterUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdateParameters.class); + + /* + * Cluster update parameters + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /* + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /* + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; + + /* + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /* + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /* + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /* + * Indicates if the event store service is enabled. + */ + @JsonProperty(value = "properties.eventStoreServiceEnabled") + private Boolean eventStoreServiceEnabled; + + /* + * The list of custom fabric settings to configure the cluster. This will + * overwrite the existing list. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * The list of node types in the cluster. This will overwrite the existing + * list. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /* + * 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. + * + */ + @JsonProperty(value = "properties.reliabilityLevel") + private ReliabilityLevel reliabilityLevel; + + /* + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /* + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /* + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - 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. + * + */ + @JsonProperty(value = "properties.upgradeMode") + private UpgradeMode upgradeMode; + + /* + * The policy used to clean up unused versions. + */ + @JsonProperty(value = "properties.applicationTypeVersionsCleanupPolicy") + private ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy; + + /** + * Get the tags property: Cluster update parameters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Cluster update parameters. + * + * @param tags the tags value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the addOnFeatures property: The list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value. + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the addOnFeatures property: The list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get the certificate property: The certificate to use for securing the cluster. The certificate provided will be + * used for node to node security within the cluster, SSL certificate for cluster management endpoint and default + * admin client. + * + * @return the certificate value. + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate property: The certificate to use for securing the cluster. The certificate provided will be + * used for node to node security within the cluster, SSL certificate for cluster management endpoint and default + * admin client. + * + * @param certificate the certificate value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the certificateCommonNames property: Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + * + * @return the certificateCommonNames value. + */ + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; + } + + /** + * Set the certificateCommonNames property: Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + * + * @param certificateCommonNames the certificateCommonNames value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; + return this; + } + + /** + * Get the clientCertificateCommonNames property: The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateCommonNames value. + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the clientCertificateCommonNames property: The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateCommonNames( + List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the clientCertificateThumbprints property: The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateThumbprints value. + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the clientCertificateThumbprints property: The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateThumbprints( + List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the eventStoreServiceEnabled property: Indicates if the event store service is enabled. + * + * @return the eventStoreServiceEnabled value. + */ + public Boolean eventStoreServiceEnabled() { + return this.eventStoreServiceEnabled; + } + + /** + * Set the eventStoreServiceEnabled property: Indicates if the event store service is enabled. + * + * @param eventStoreServiceEnabled the eventStoreServiceEnabled value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withEventStoreServiceEnabled(Boolean eventStoreServiceEnabled) { + this.eventStoreServiceEnabled = eventStoreServiceEnabled; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. This will overwrite + * the existing list. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. This will overwrite + * the existing list. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the nodeTypes property: The list of node types in the cluster. This will overwrite the existing list. + * + * @return the nodeTypes value. + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes property: The list of node types in the cluster. This will overwrite the existing list. + * + * @param nodeTypes the nodeTypes value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the reliabilityLevel property: 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. + * + * @return the reliabilityLevel value. + */ + public ReliabilityLevel reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliabilityLevel property: 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. + * + * @param reliabilityLevel the reliabilityLevel value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReliabilityLevel(ReliabilityLevel reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get the reverseProxyCertificate property: The server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value. + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the reverseProxyCertificate property: The server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the upgradeDescription property: The policy to use when upgrading the cluster. + * + * @return the upgradeDescription value. + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the upgradeDescription property: The policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime version is + * available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon + * as it is available. - Manual - 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. + * + * @return the upgradeMode value. + */ + public UpgradeMode upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode property: The upgrade mode of the cluster when new Service Fabric runtime version is + * available. + * + *

- Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon + * as it is available. - Manual - 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. + * + * @param upgradeMode the upgradeMode value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeMode(UpgradeMode upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.applicationTypeVersionsCleanupPolicy; + } + + /** + * Set the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @param applicationTypeVersionsCleanupPolicy the applicationTypeVersionsCleanupPolicy value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + this.applicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + return this; + } + + /** + * 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(); + } + } +} 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 new file mode 100644 index 0000000000000..d4ab491593215 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java @@ -0,0 +1,190 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the delta health policies for the cluster upgrade. */ +@Fluent +public final class ClusterUpgradeDeltaHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpgradeDeltaHealthPolicy.class); + + /* + * The maximum allowed percentage of nodes health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyNodes", required = true) + private int maxPercentDeltaUnhealthyNodes; + + /* + * The maximum allowed percentage of upgrade domain nodes health + * degradation allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at + * the beginning of upgrade and the state of the upgrade domain nodes at + * the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. + * + */ + @JsonProperty(value = "maxPercentUpgradeDomainDeltaUnhealthyNodes", required = true) + private int maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /* + * The maximum allowed percentage of applications health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of + * the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + * + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyApplications", required = true) + private int maxPercentDeltaUnhealthyApplications; + + /* + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. + */ + @JsonProperty(value = "applicationDeltaHealthPolicies") + private Map applicationDeltaHealthPolicies; + + /** + * Get the maxPercentDeltaUnhealthyNodes property: The maximum allowed percentage of nodes health degradation + * allowed during cluster upgrades. The delta is measured between the state of the nodes at the beginning of upgrade + * and the state of the nodes at the time of the health evaluation. The check is performed after every upgrade + * domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @return the maxPercentDeltaUnhealthyNodes value. + */ + public int maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set the maxPercentDeltaUnhealthyNodes property: The maximum allowed percentage of nodes health degradation + * allowed during cluster upgrades. The delta is measured between the state of the nodes at the beginning of upgrade + * and the state of the nodes at the time of the health evaluation. The check is performed after every upgrade + * domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set. + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyNodes(int maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maxPercentUpgradeDomainDeltaUnhealthyNodes property: The maximum allowed percentage of upgrade domain + * nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the upgrade + * domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health + * evaluation. The check is performed after every upgrade domain upgrade completion for all completed upgrade + * domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value. + */ + public int maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set the maxPercentUpgradeDomainDeltaUnhealthyNodes property: The maximum allowed percentage of upgrade domain + * nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the upgrade + * domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health + * evaluation. The check is performed after every upgrade domain upgrade completion for all completed upgrade + * domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @param maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set. + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentUpgradeDomainDeltaUnhealthyNodes( + int maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maxPercentDeltaUnhealthyApplications property: The maximum allowed percentage of applications health + * degradation allowed during cluster upgrades. The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the health evaluation. The check is + * performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within + * tolerated limits. System services are not included in this. + * + * @return the maxPercentDeltaUnhealthyApplications value. + */ + public int maxPercentDeltaUnhealthyApplications() { + return this.maxPercentDeltaUnhealthyApplications; + } + + /** + * Set the maxPercentDeltaUnhealthyApplications property: The maximum allowed percentage of applications health + * degradation allowed during cluster upgrades. The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the health evaluation. The check is + * performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within + * tolerated limits. System services are not included in this. + * + * @param maxPercentDeltaUnhealthyApplications the maxPercentDeltaUnhealthyApplications value to set. + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyApplications( + int maxPercentDeltaUnhealthyApplications) { + this.maxPercentDeltaUnhealthyApplications = maxPercentDeltaUnhealthyApplications; + return this; + } + + /** + * Get the applicationDeltaHealthPolicies property: Defines the application delta health policy map used to evaluate + * the health of an application or one of its child entities when upgrading the cluster. + * + * @return the applicationDeltaHealthPolicies value. + */ + public Map applicationDeltaHealthPolicies() { + return this.applicationDeltaHealthPolicies; + } + + /** + * Set the applicationDeltaHealthPolicies property: Defines the application delta health policy map used to evaluate + * the health of an application or one of its child entities when upgrading the cluster. + * + * @param applicationDeltaHealthPolicies the applicationDeltaHealthPolicies value to set. + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withApplicationDeltaHealthPolicies( + Map applicationDeltaHealthPolicies) { + this.applicationDeltaHealthPolicies = 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(); + } + }); + } + } +} 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 new file mode 100644 index 0000000000000..ac07b13f31589 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradePolicy.java @@ -0,0 +1,344 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the policy used when upgrading the cluster. */ +@Fluent +public final class ClusterUpgradePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpgradePolicy.class); + + /* + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /* + * The maximum amount of time to block processing of an upgrade domain and + * prevent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. The timeout can be in either hh:mm:ss or + * in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout", required = true) + private String upgradeReplicaSetCheckTimeout; + + /* + * The length of time to wait after completing an upgrade domain before + * performing health checks. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckWaitDuration", required = true) + private String healthCheckWaitDuration; + + /* + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. The duration can + * be in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckStableDuration", required = true) + private String healthCheckStableDuration; + + /* + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be + * in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckRetryTimeout", required = true) + private String healthCheckRetryTimeout; + + /* + * The amount of time the overall upgrade has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeTimeout", required = true) + private String upgradeTimeout; + + /* + * The amount of time each upgrade domain has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeDomainTimeout", required = true) + private String upgradeDomainTimeout; + + /* + * The cluster health policy used when upgrading the cluster. + */ + @JsonProperty(value = "healthPolicy", required = true) + private ClusterHealthPolicy healthPolicy; + + /* + * The cluster delta health policy used when upgrading the cluster. + */ + @JsonProperty(value = "deltaHealthPolicy") + private ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy; + + /** + * Get the forceRestart property: If true, then processes are forcefully restarted during upgrade even when the code + * version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value. + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set the forceRestart property: If true, then processes are forcefully restarted during upgrade even when the code + * version has not changed (the upgrade only changes configuration or data). + * + * @param forceRestart the forceRestart value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the upgradeReplicaSetCheckTimeout property: The maximum amount of time to block processing of an upgrade + * domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing + * of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of + * each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeReplicaSetCheckTimeout value. + */ + public String upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the upgradeReplicaSetCheckTimeout property: The maximum amount of time to block processing of an upgrade + * domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing + * of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of + * each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeReplicaSetCheckTimeout(String upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the healthCheckWaitDuration property: The length of time to wait after completing an upgrade domain before + * performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckWaitDuration value. + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the healthCheckWaitDuration property: The length of time to wait after completing an upgrade domain before + * performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * 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. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + * + * @return the healthCheckStableDuration value. + */ + public String healthCheckStableDuration() { + return this.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. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the healthCheckRetryTimeout property: The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms + * format. + * + * @return the healthCheckRetryTimeout value. + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the healthCheckRetryTimeout property: The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms + * format. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the upgradeTimeout property: The amount of time the overall upgrade has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeTimeout value. + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the upgradeTimeout property: The amount of time the overall upgrade has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeTimeout the upgradeTimeout value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the upgradeDomainTimeout property: The amount of time each upgrade domain has to complete before the upgrade + * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeDomainTimeout value. + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the upgradeDomainTimeout property: The amount of time each upgrade domain has to complete before the upgrade + * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + + /** + * Get the healthPolicy property: The cluster health policy used when upgrading the cluster. + * + * @return the healthPolicy value. + */ + public ClusterHealthPolicy healthPolicy() { + return this.healthPolicy; + } + + /** + * Set the healthPolicy property: The cluster health policy used when upgrading the cluster. + * + * @param healthPolicy the healthPolicy value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthPolicy(ClusterHealthPolicy healthPolicy) { + this.healthPolicy = healthPolicy; + return this; + } + + /** + * Get the deltaHealthPolicy property: The cluster delta health policy used when upgrading the cluster. + * + * @return the deltaHealthPolicy value. + */ + public ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy() { + return this.deltaHealthPolicy; + } + + /** + * Set the deltaHealthPolicy property: The cluster delta health policy used when upgrading the cluster. + * + * @param deltaHealthPolicy the deltaHealthPolicy value to set. + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withDeltaHealthPolicy(ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy) { + this.deltaHealthPolicy = deltaHealthPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradeReplicaSetCheckTimeout() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property upgradeReplicaSetCheckTimeout in model ClusterUpgradePolicy")); + } + if (healthCheckWaitDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property healthCheckWaitDuration in model ClusterUpgradePolicy")); + } + if (healthCheckStableDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property healthCheckStableDuration in model ClusterUpgradePolicy")); + } + if (healthCheckRetryTimeout() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property healthCheckRetryTimeout in model ClusterUpgradePolicy")); + } + if (upgradeTimeout() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property upgradeTimeout in model ClusterUpgradePolicy")); + } + if (upgradeDomainTimeout() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property upgradeDomainTimeout in model ClusterUpgradePolicy")); + } + if (healthPolicy() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property healthPolicy in model ClusterUpgradePolicy")); + } else { + healthPolicy().validate(); + } + if (deltaHealthPolicy() != null) { + deltaHealthPolicy().validate(); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionDetails.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionDetails.java new file mode 100644 index 0000000000000..3d2608af69152 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionDetails.java @@ -0,0 +1,102 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The detail of the Service Fabric runtime version result. */ +@Fluent +public final class ClusterVersionDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterVersionDetails.class); + + /* + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "codeVersion") + private String codeVersion; + + /* + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /* + * Indicates if this version is for Windows or Linux operating system. + */ + @JsonProperty(value = "environment") + private ClusterEnvironment environment; + + /** + * Get the codeVersion property: The Service Fabric runtime version of the cluster. + * + * @return the codeVersion value. + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the codeVersion property: The Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set. + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the supportExpiryUtc property: The date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set. + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get the environment property: Indicates if this version is for Windows or Linux operating system. + * + * @return the environment value. + */ + public ClusterEnvironment environment() { + return this.environment; + } + + /** + * Set the environment property: Indicates if this version is for Windows or Linux operating system. + * + * @param environment the environment value to set. + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withEnvironment(ClusterEnvironment environment) { + this.environment = environment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..c3c488dd0a387 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersions.java @@ -0,0 +1,114 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ClusterVersions. */ +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 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. + */ + ClusterCodeVersionsListResult get(String location, String clusterVersion); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getWithResponse(String location, String clusterVersion, Context context); + + /** + * 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 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. + */ + ClusterCodeVersionsListResult getByEnvironment( + String location, ClusterVersionsEnvironment environment, String clusterVersion); + + /** + * 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 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. + */ + Response getByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, String clusterVersion, Context context); + + /** + * 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 com.azure.core.management.exception.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. + */ + ClusterCodeVersionsListResult list(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response listWithResponse(String location, Context context); + + /** + * 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 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. + */ + ClusterCodeVersionsListResult listByEnvironment(String location, ClusterVersionsEnvironment environment); + + /** + * 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 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. + */ + Response listByEnvironmentWithResponse( + String location, ClusterVersionsEnvironment environment, Context context); +} 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 new file mode 100644 index 0000000000000..02ef82b64f78e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterVersionsEnvironment.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterVersionsEnvironment. */ +public final class ClusterVersionsEnvironment extends ExpandableStringEnum { + /** Static value Windows for ClusterVersionsEnvironment. */ + public static final ClusterVersionsEnvironment WINDOWS = fromString("Windows"); + + /** Static value Linux for ClusterVersionsEnvironment. */ + public static final ClusterVersionsEnvironment LINUX = fromString("Linux"); + + /** + * Creates or finds a ClusterVersionsEnvironment from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterVersionsEnvironment. + */ + @JsonCreator + public static ClusterVersionsEnvironment fromString(String name) { + return fromString(name, ClusterVersionsEnvironment.class); + } + + /** @return known ClusterVersionsEnvironment values. */ + public static Collection values() { + return values(ClusterVersionsEnvironment.class); + } +} 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 new file mode 100644 index 0000000000000..602215724d71a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Clusters.java @@ -0,0 +1,160 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Clusters. */ +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 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. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + ClusterListResult 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + ClusterListResult list(); + + /** + * 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 com.azure.core.management.exception.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. + */ + Response listWithResponse(Context context); + + /** + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric cluster resource created or in the process of being created in the specified resource + * group. + */ + Cluster getById(String id); + + /** + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric cluster resource created or in the process of being created in the specified resource + * group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric cluster resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric cluster resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..74761b8526a01 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java @@ -0,0 +1,214 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage account information for storing Service Fabric diagnostic logs. */ +@Fluent +public final class DiagnosticsStorageAccountConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsStorageAccountConfig.class); + + /* + * The Azure storage account name. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /* + * The protected diagnostics storage key name. + */ + @JsonProperty(value = "protectedAccountKeyName", required = true) + private String protectedAccountKeyName; + + /* + * The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the + * other. + */ + @JsonProperty(value = "protectedAccountKeyName2") + private String protectedAccountKeyName2; + + /* + * The blob endpoint of the azure storage account. + */ + @JsonProperty(value = "blobEndpoint", required = true) + private String blobEndpoint; + + /* + * The queue endpoint of the azure storage account. + */ + @JsonProperty(value = "queueEndpoint", required = true) + private String queueEndpoint; + + /* + * The table endpoint of the azure storage account. + */ + @JsonProperty(value = "tableEndpoint", required = true) + private String tableEndpoint; + + /** + * Get the storageAccountName property: The Azure storage account name. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The Azure storage account name. + * + * @param storageAccountName the storageAccountName value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the protectedAccountKeyName property: The protected diagnostics storage key name. + * + * @return the protectedAccountKeyName value. + */ + public String protectedAccountKeyName() { + return this.protectedAccountKeyName; + } + + /** + * Set the protectedAccountKeyName property: The protected diagnostics storage key name. + * + * @param protectedAccountKeyName the protectedAccountKeyName value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName(String protectedAccountKeyName) { + this.protectedAccountKeyName = protectedAccountKeyName; + return this; + } + + /** + * Get the protectedAccountKeyName2 property: The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the other. + * + * @return the protectedAccountKeyName2 value. + */ + public String protectedAccountKeyName2() { + return this.protectedAccountKeyName2; + } + + /** + * Set the protectedAccountKeyName2 property: The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the other. + * + * @param protectedAccountKeyName2 the protectedAccountKeyName2 value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName2(String protectedAccountKeyName2) { + this.protectedAccountKeyName2 = protectedAccountKeyName2; + return this; + } + + /** + * Get the blobEndpoint property: The blob endpoint of the azure storage account. + * + * @return the blobEndpoint value. + */ + public String blobEndpoint() { + return this.blobEndpoint; + } + + /** + * Set the blobEndpoint property: The blob endpoint of the azure storage account. + * + * @param blobEndpoint the blobEndpoint value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withBlobEndpoint(String blobEndpoint) { + this.blobEndpoint = blobEndpoint; + return this; + } + + /** + * Get the queueEndpoint property: The queue endpoint of the azure storage account. + * + * @return the queueEndpoint value. + */ + public String queueEndpoint() { + return this.queueEndpoint; + } + + /** + * Set the queueEndpoint property: The queue endpoint of the azure storage account. + * + * @param queueEndpoint the queueEndpoint value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withQueueEndpoint(String queueEndpoint) { + this.queueEndpoint = queueEndpoint; + return this; + } + + /** + * Get the tableEndpoint property: The table endpoint of the azure storage account. + * + * @return the tableEndpoint value. + */ + public String tableEndpoint() { + return this.tableEndpoint; + } + + /** + * Set the tableEndpoint property: The table endpoint of the azure storage account. + * + * @param tableEndpoint the tableEndpoint value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withTableEndpoint(String tableEndpoint) { + this.tableEndpoint = tableEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccountName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountName in model DiagnosticsStorageAccountConfig")); + } + if (protectedAccountKeyName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protectedAccountKeyName in model DiagnosticsStorageAccountConfig")); + } + if (blobEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobEndpoint in model DiagnosticsStorageAccountConfig")); + } + if (queueEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property queueEndpoint in model DiagnosticsStorageAccountConfig")); + } + if (tableEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property tableEndpoint in model DiagnosticsStorageAccountConfig")); + } + } +} 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 new file mode 100644 index 0000000000000..2d693281eda92 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DurabilityLevel.java @@ -0,0 +1,37 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DurabilityLevel. */ +public final class DurabilityLevel extends ExpandableStringEnum { + /** Static value Bronze for DurabilityLevel. */ + public static final DurabilityLevel BRONZE = fromString("Bronze"); + + /** Static value Silver for DurabilityLevel. */ + public static final DurabilityLevel SILVER = fromString("Silver"); + + /** Static value Gold for DurabilityLevel. */ + public static final DurabilityLevel GOLD = fromString("Gold"); + + /** + * Creates or finds a DurabilityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DurabilityLevel. + */ + @JsonCreator + public static DurabilityLevel fromString(String name) { + return fromString(name, DurabilityLevel.class); + } + + /** @return known DurabilityLevel values. */ + public static Collection values() { + return values(DurabilityLevel.class); + } +} 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 new file mode 100644 index 0000000000000..7a9e7832d941d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/EndpointRangeDescription.java @@ -0,0 +1,76 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Port range details. */ +@Fluent +public final class EndpointRangeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointRangeDescription.class); + + /* + * Starting port of a range of ports + */ + @JsonProperty(value = "startPort", required = true) + private int startPort; + + /* + * End port of a range of ports + */ + @JsonProperty(value = "endPort", required = true) + private int endPort; + + /** + * Get the startPort property: Starting port of a range of ports. + * + * @return the startPort value. + */ + public int startPort() { + return this.startPort; + } + + /** + * Set the startPort property: Starting port of a range of ports. + * + * @param startPort the startPort value to set. + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withStartPort(int startPort) { + this.startPort = startPort; + return this; + } + + /** + * Get the endPort property: End port of a range of ports. + * + * @return the endPort value. + */ + public int endPort() { + return this.endPort; + } + + /** + * Set the endPort property: End port of a range of ports. + * + * @param endPort the endPort value to set. + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withEndPort(int endPort) { + this.endPort = endPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java new file mode 100644 index 0000000000000..1f16caf0828c4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java @@ -0,0 +1,172 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a load balancing rule. */ +@Fluent +public final class LoadBalancingRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRule.class); + + /* + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 1 and + * 65534. + */ + @JsonProperty(value = "frontendPort", required = true) + private int frontendPort; + + /* + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "backendPort", required = true) + private int backendPort; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "protocol", required = true) + private Protocol protocol; + + /* + * the reference to the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "probeProtocol", required = true) + private ProbeProtocol probeProtocol; + + /* + * The probe request path. Only supported for HTTP/HTTPS probes. + */ + @JsonProperty(value = "probeRequestPath") + private String probeRequestPath; + + /** + * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 1 and 65534. + * + * @return the frontendPort value. + */ + public int frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 1 and 65534. + * + * @param frontendPort the frontendPort value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @return the backendPort value. + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @param backendPort the backendPort value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @param protocol the protocol value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the probeProtocol property: the reference to the load balancer probe used by the load balancing rule. + * + * @return the probeProtocol value. + */ + public ProbeProtocol probeProtocol() { + return this.probeProtocol; + } + + /** + * Set the probeProtocol property: the reference to the load balancer probe used by the load balancing rule. + * + * @param probeProtocol the probeProtocol value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProbeProtocol(ProbeProtocol probeProtocol) { + this.probeProtocol = probeProtocol; + return this; + } + + /** + * Get the probeRequestPath property: The probe request path. Only supported for HTTP/HTTPS probes. + * + * @return the probeRequestPath value. + */ + public String probeRequestPath() { + return this.probeRequestPath; + } + + /** + * Set the probeRequestPath property: The probe request path. Only supported for HTTP/HTTPS probes. + * + * @param probeRequestPath the probeRequestPath value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProbeRequestPath(String probeRequestPath) { + this.probeRequestPath = probeRequestPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property protocol in model LoadBalancingRule")); + } + if (probeProtocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property probeProtocol in model LoadBalancingRule")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java new file mode 100644 index 0000000000000..5e1d98bcfc0af --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java @@ -0,0 +1,557 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ManagedCluster. */ +public interface ManagedCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The sku of the managed cluster. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the dnsName property: The cluster dns name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the fqdn property: the cluster Fully qualified domain name. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the clusterState property: The current state of the cluster. + * + * @return the clusterState value. + */ + ClusterState clusterState(); + + /** + * Gets the clusterCertificateThumbprint property: The cluster certificate thumbprint used node to node + * communication. + * + * @return the clusterCertificateThumbprint value. + */ + String clusterCertificateThumbprint(); + + /** + * Gets the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + Integer clientConnectionPort(); + + /** + * Gets the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + Integer httpGatewayConnectionPort(); + + /** + * Gets the adminUsername property: vm admin user name. + * + * @return the adminUsername value. + */ + String adminUsername(); + + /** + * Gets the adminPassword property: vm admin user password. + * + * @return the adminPassword value. + */ + String adminPassword(); + + /** + * Gets the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + List clients(); + + /** + * Gets the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * Gets the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + List fabricSettings(); + + /** + * Gets the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + ManagedResourceProvisioningState provisioningState(); + + /** + * Gets the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only + * by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + String clusterCodeVersion(); + + /** + * Gets the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + List addonFeatures(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner object. + * + * @return the inner object. + */ + ManagedClusterInner innerModel(); + + /** The entirety of the ManagedCluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedCluster definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedCluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedCluster definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ManagedCluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ManagedCluster definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithDnsName, + DefinitionStages.WithClientConnectionPort, + DefinitionStages.WithHttpGatewayConnectionPort, + DefinitionStages.WithAdminUsername, + DefinitionStages.WithAdminPassword, + DefinitionStages.WithLoadBalancingRules, + DefinitionStages.WithClients, + DefinitionStages.WithAzureActiveDirectory, + DefinitionStages.WithFabricSettings, + DefinitionStages.WithClusterCodeVersion, + DefinitionStages.WithAddonFeatures { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedCluster create(Context context); + } + /** The stage of the ManagedCluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ManagedCluster definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of the managed cluster. + * + * @param sku The sku of the managed cluster. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the ManagedCluster definition allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: The cluster dns name.. + * + * @param dnsName The cluster dns name. + * @return the next definition stage. + */ + WithCreate withDnsName(String dnsName); + } + /** The stage of the ManagedCluster definition allowing to specify clientConnectionPort. */ + interface WithClientConnectionPort { + /** + * Specifies the clientConnectionPort property: The port used for client connections to the cluster.. + * + * @param clientConnectionPort The port used for client connections to the cluster. + * @return the next definition stage. + */ + WithCreate withClientConnectionPort(Integer clientConnectionPort); + } + /** The stage of the ManagedCluster definition allowing to specify httpGatewayConnectionPort. */ + interface WithHttpGatewayConnectionPort { + /** + * Specifies the httpGatewayConnectionPort property: The port used for http connections to the cluster.. + * + * @param httpGatewayConnectionPort The port used for http connections to the cluster. + * @return the next definition stage. + */ + WithCreate withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort); + } + /** The stage of the ManagedCluster definition allowing to specify adminUsername. */ + interface WithAdminUsername { + /** + * Specifies the adminUsername property: vm admin user name.. + * + * @param adminUsername vm admin user name. + * @return the next definition stage. + */ + WithCreate withAdminUsername(String adminUsername); + } + /** The stage of the ManagedCluster definition allowing to specify adminPassword. */ + interface WithAdminPassword { + /** + * Specifies the adminPassword property: vm admin user password.. + * + * @param adminPassword vm admin user password. + * @return the next definition stage. + */ + WithCreate withAdminPassword(String adminPassword); + } + /** The stage of the ManagedCluster definition allowing to specify loadBalancingRules. */ + interface WithLoadBalancingRules { + /** + * Specifies the loadBalancingRules property: Describes load balancing rules.. + * + * @param loadBalancingRules Describes load balancing rules. + * @return the next definition stage. + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + /** The stage of the ManagedCluster definition allowing to specify clients. */ + interface WithClients { + /** + * Specifies the clients property: client certificates for the cluster.. + * + * @param clients client certificates for the cluster. + * @return the next definition stage. + */ + WithCreate withClients(List clients); + } + /** The stage of the ManagedCluster definition allowing to specify azureActiveDirectory. */ + interface WithAzureActiveDirectory { + /** + * Specifies the azureActiveDirectory property: Azure active directory.. + * + * @param azureActiveDirectory Azure active directory. + * @return the next definition stage. + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + /** The stage of the ManagedCluster definition allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster.. + * + * @param fabricSettings The list of custom fabric settings to configure the cluster. + * @return the next definition stage. + */ + WithCreate withFabricSettings(List fabricSettings); + } + /** The stage of the ManagedCluster definition allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This + * property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available + * Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list + * of available version for existing clusters use **availableClusterVersions**.. + * + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + * @return the next definition stage. + */ + WithCreate withClusterCodeVersion(String clusterCodeVersion); + } + /** The stage of the ManagedCluster definition allowing to specify addonFeatures. */ + interface WithAddonFeatures { + /** + * Specifies the addonFeatures property: client certificates for the cluster.. + * + * @param addonFeatures client certificates for the cluster. + * @return the next definition stage. + */ + WithCreate withAddonFeatures(List addonFeatures); + } + } + /** + * Begins update for the ManagedCluster resource. + * + * @return the stage of resource update. + */ + ManagedCluster.Update update(); + + /** The template for ManagedCluster update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithClientConnectionPort, + UpdateStages.WithHttpGatewayConnectionPort, + UpdateStages.WithLoadBalancingRules, + UpdateStages.WithClients, + UpdateStages.WithAzureActiveDirectory, + UpdateStages.WithFabricSettings, + UpdateStages.WithClusterCodeVersion, + UpdateStages.WithAddonFeatures { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedCluster apply(Context context); + } + /** The ManagedCluster update stages. */ + interface UpdateStages { + /** The stage of the ManagedCluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Managed cluster update parameters. + * + * @param tags Managed cluster update parameters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ManagedCluster update allowing to specify clientConnectionPort. */ + interface WithClientConnectionPort { + /** + * Specifies the clientConnectionPort property: The port used for client connections to the cluster.. + * + * @param clientConnectionPort The port used for client connections to the cluster. + * @return the next definition stage. + */ + Update withClientConnectionPort(Integer clientConnectionPort); + } + /** The stage of the ManagedCluster update allowing to specify httpGatewayConnectionPort. */ + interface WithHttpGatewayConnectionPort { + /** + * Specifies the httpGatewayConnectionPort property: The port used for http connections to the cluster.. + * + * @param httpGatewayConnectionPort The port used for http connections to the cluster. + * @return the next definition stage. + */ + Update withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort); + } + /** The stage of the ManagedCluster update allowing to specify loadBalancingRules. */ + interface WithLoadBalancingRules { + /** + * Specifies the loadBalancingRules property: Describes load balancing rules.. + * + * @param loadBalancingRules Describes load balancing rules. + * @return the next definition stage. + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + /** The stage of the ManagedCluster update allowing to specify clients. */ + interface WithClients { + /** + * Specifies the clients property: client certificates for the cluster.. + * + * @param clients client certificates for the cluster. + * @return the next definition stage. + */ + Update withClients(List clients); + } + /** The stage of the ManagedCluster update allowing to specify azureActiveDirectory. */ + interface WithAzureActiveDirectory { + /** + * Specifies the azureActiveDirectory property: Azure active directory.. + * + * @param azureActiveDirectory Azure active directory. + * @return the next definition stage. + */ + Update withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + /** The stage of the ManagedCluster update allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster.. + * + * @param fabricSettings The list of custom fabric settings to configure the cluster. + * @return the next definition stage. + */ + Update withFabricSettings(List fabricSettings); + } + /** The stage of the ManagedCluster update allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This + * property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available + * Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list + * of available version for existing clusters use **availableClusterVersions**.. + * + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + * @return the next definition stage. + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + /** The stage of the ManagedCluster update allowing to specify addonFeatures. */ + interface WithAddonFeatures { + /** + * Specifies the addonFeatures property: client certificates for the cluster.. + * + * @param addonFeatures client certificates for the cluster. + * @return the next definition stage. + */ + Update withAddonFeatures(List addonFeatures); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedCluster refresh(Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java new file mode 100644 index 0000000000000..b5cb17edd016d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java @@ -0,0 +1,37 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterAddOnFeature. */ +public final class ManagedClusterAddOnFeature extends ExpandableStringEnum { + /** Static value DnsService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature DNS_SERVICE = fromString("DnsService"); + + /** Static value BackupRestoreService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature BACKUP_RESTORE_SERVICE = fromString("BackupRestoreService"); + + /** Static value ResourceMonitorService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature RESOURCE_MONITOR_SERVICE = fromString("ResourceMonitorService"); + + /** + * Creates or finds a ManagedClusterAddOnFeature from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterAddOnFeature. + */ + @JsonCreator + public static ManagedClusterAddOnFeature fromString(String name) { + return fromString(name, ManagedClusterAddOnFeature.class); + } + + /** @return known ManagedClusterAddOnFeature values. */ + public static Collection values() { + return values(ManagedClusterAddOnFeature.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java new file mode 100644 index 0000000000000..3ca08fc7734a3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java @@ -0,0 +1,81 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed Cluster list results. */ +@Fluent +public final class ManagedClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ManagedClusterListResult object itself. + */ + public ManagedClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ManagedClusterListResult object itself. + */ + public ManagedClusterListResult 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()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java new file mode 100644 index 0000000000000..71e7e8a3e9812 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java @@ -0,0 +1,284 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Managed cluster update request. */ +@JsonFlatten +@Fluent +public class ManagedClusterUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterUpdateParameters.class); + + /* + * Managed cluster update parameters + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The port used for client connections to the cluster. + */ + @JsonProperty(value = "properties.clientConnectionPort") + private Integer clientConnectionPort; + + /* + * The port used for http connections to the cluster. + */ + @JsonProperty(value = "properties.httpGatewayConnectionPort") + private Integer httpGatewayConnectionPort; + + /* + * Describes load balancing rules. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.clients") + private List clients; + + /* + * Azure active directory. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.addonFeatures") + private List addonFeatures; + + /** + * Get the tags property: Managed cluster update parameters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Managed cluster update parameters. + * + * @param tags the tags value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + public Integer clientConnectionPort() { + return this.clientConnectionPort; + } + + /** + * Set the clientConnectionPort property: The port used for client connections to the cluster. + * + * @param clientConnectionPort the clientConnectionPort value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClientConnectionPort(Integer clientConnectionPort) { + this.clientConnectionPort = clientConnectionPort; + return this; + } + + /** + * Get the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + public Integer httpGatewayConnectionPort() { + return this.httpGatewayConnectionPort; + } + + /** + * Set the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @param httpGatewayConnectionPort the httpGatewayConnectionPort value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + this.httpGatewayConnectionPort = httpGatewayConnectionPort; + return this; + } + + /** + * Get the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set the loadBalancingRules property: Describes load balancing rules. + * + * @param loadBalancingRules the loadBalancingRules value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + public List clients() { + return this.clients; + } + + /** + * Set the clients property: client certificates for the cluster. + * + * @param clients the clients value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClients(List clients) { + this.clients = clients; + return this; + } + + /** + * Get the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: Azure active directory. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value. + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the clusterCodeVersion property: The Service Fabric runtime version of the cluster. This property can only by + * set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing + * clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + public List addonFeatures() { + return this.addonFeatures; + } + + /** + * Set the addonFeatures property: client certificates for the cluster. + * + * @param addonFeatures the addonFeatures value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withAddonFeatures(List addonFeatures) { + this.addonFeatures = addonFeatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancingRules() != null) { + loadBalancingRules().forEach(e -> e.validate()); + } + if (clients() != null) { + clients().forEach(e -> e.validate()); + } + if (azureActiveDirectory() != null) { + azureActiveDirectory().validate(); + } + if (fabricSettings() != null) { + fabricSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java new file mode 100644 index 0000000000000..e880ed68be192 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java @@ -0,0 +1,38 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; + +/** An immutable client-side representation of ManagedClusterVersionDetails. */ +public interface ManagedClusterVersionDetails { + /** + * Gets the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @return the msiVersion value. + */ + String msiVersion(); + + /** + * Gets the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + String supportExpiryUtc(); + + /** + * Gets the osType property: Indicates the operating system of the cluster. + * + * @return the osType value. + */ + ClusterOsType osType(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner object. + * + * @return the inner object. + */ + ManagedClusterVersionDetailsInner innerModel(); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java new file mode 100644 index 0000000000000..a3cc5a0dfcd2b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java @@ -0,0 +1,38 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ManagedClusterVersions. */ +public interface ManagedClusterVersions { + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS type. + */ + List listByOS(String location, ManagedClusterVersionsOsType osType); + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS type. + */ + Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java new file mode 100644 index 0000000000000..fbc604f64c754 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterVersionsOsType. */ +public final class ManagedClusterVersionsOsType extends ExpandableStringEnum { + /** Static value Windows for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType WINDOWS = fromString("Windows"); + + /** Static value Ubuntu for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType UBUNTU = fromString("Ubuntu"); + + /** Static value RedHat for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType RED_HAT = fromString("RedHat"); + + /** Static value Ubuntu18_04 for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType UBUNTU18_04 = fromString("Ubuntu18_04"); + + /** + * Creates or finds a ManagedClusterVersionsOsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterVersionsOsType. + */ + @JsonCreator + public static ManagedClusterVersionsOsType fromString(String name) { + return fromString(name, ManagedClusterVersionsOsType.class); + } + + /** @return known ManagedClusterVersionsOsType values. */ + public static Collection values() { + return values(ManagedClusterVersionsOsType.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java new file mode 100644 index 0000000000000..3613ccee9ce2a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java @@ -0,0 +1,164 @@ +// 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.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 ManagedClusters. */ +public interface ManagedClusters { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.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. + */ + PagedIterable list(Context context); + + /** + * Get a Service Fabric managed 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 com.azure.core.management.exception.ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + ManagedCluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Get a Service Fabric managed 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 managed cluster resource created or in the process of being created in the specified + * resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Get a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + ManagedCluster getById(String id); + + /** + * Get a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedCluster resource. + * + * @param name resource name. + * @return the first stage of the new ManagedCluster definition. + */ + ManagedCluster.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..2e3efce7eab61 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java @@ -0,0 +1,128 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the managed identities for an Azure resource. */ +@Fluent +public class ManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); + + /* + * The principal id of the managed identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the managed identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of managed identity for the resource. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of the managed identity. This property will only be provided for a + * system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the managed identity. This property will only be provided for a + * system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity for the resource. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity for the resource. + * + * @param type the type value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} 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 new file mode 100644 index 0000000000000..4e259f7a33df5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java @@ -0,0 +1,53 @@ +// 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.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ManagedIdentityType. */ +public enum ManagedIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ManagedIdentityType instance. */ + private final String value; + + ManagedIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ManagedIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ManagedIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ManagedIdentityType fromString(String value) { + ManagedIdentityType[] items = ManagedIdentityType.values(); + for (ManagedIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java new file mode 100644 index 0000000000000..fc0e664a54539 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java @@ -0,0 +1,52 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The resource model definition for proxy-only resource. */ +@Fluent +public class ManagedProxyResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedProxyResource.class); + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ManagedProxyResource object itself. + */ + public ManagedProxyResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java new file mode 100644 index 0000000000000..bf134aaffab57 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java @@ -0,0 +1,58 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedResourceProvisioningState. */ +public final class ManagedResourceProvisioningState extends ExpandableStringEnum { + /** Static value None for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState NONE = fromString("None"); + + /** Static value Creating for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Created for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CREATED = fromString("Created"); + + /** Static value Updating for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleting for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState DELETED = fromString("Deleted"); + + /** Static value Other for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState OTHER = fromString("Other"); + + /** + * Creates or finds a ManagedResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedResourceProvisioningState. + */ + @JsonCreator + public static ManagedResourceProvisioningState fromString(String name) { + return fromString(name, ManagedResourceProvisioningState.class); + } + + /** @return known ManagedResourceProvisioningState values. */ + public static Collection values() { + return values(ManagedResourceProvisioningState.class); + } +} 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 new file mode 100644 index 0000000000000..2f70638346aa3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/MoveCost.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MoveCost. */ +public final class MoveCost extends ExpandableStringEnum { + /** Static value Zero for MoveCost. */ + public static final MoveCost ZERO = fromString("Zero"); + + /** Static value Low for MoveCost. */ + public static final MoveCost LOW = fromString("Low"); + + /** Static value Medium for MoveCost. */ + public static final MoveCost MEDIUM = fromString("Medium"); + + /** Static value High for MoveCost. */ + public static final MoveCost HIGH = fromString("High"); + + /** + * Creates or finds a MoveCost from its string representation. + * + * @param name a name to look for. + * @return the corresponding MoveCost. + */ + @JsonCreator + public static MoveCost fromString(String name) { + return fromString(name, MoveCost.class); + } + + /** @return known MoveCost values. */ + public static Collection values() { + return values(MoveCost.class); + } +} 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 new file mode 100644 index 0000000000000..e714831b55d7a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java @@ -0,0 +1,90 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Describes the named partition scheme of the service. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "partitionScheme") +@JsonTypeName("Named") +@Fluent +public final class NamedPartitionSchemeDescription extends PartitionSchemeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedPartitionSchemeDescription.class); + + /* + * The number of partitions. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * Array of size specified by the ‘count’ parameter, for the names of the + * partitions. + */ + @JsonProperty(value = "names", required = true) + private List names; + + /** + * Get the count property: The number of partitions. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: The number of partitions. + * + * @param count the count value to set. + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the names property: Array of size specified by the ‘count’ parameter, for the names of the partitions. + * + * @return the names value. + */ + public List names() { + return this.names; + } + + /** + * Set the names property: Array of size specified by the ‘count’ parameter, for the names of the partitions. + * + * @param names the names value to set. + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withNames(List names) { + this.names = names; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (names() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property names in model NamedPartitionSchemeDescription")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java new file mode 100644 index 0000000000000..ec35401a447b9 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java @@ -0,0 +1,530 @@ +// 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.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NodeType. */ +public interface NodeType { + /** + * 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 tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the isPrimary property: The node type on which system services will run. Only one node type should be marked + * as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @return the isPrimary value. + */ + Boolean isPrimary(); + + /** + * Gets the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + Integer vmInstanceCount(); + + /** + * Gets the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @return the dataDiskSizeGB value. + */ + Integer dataDiskSizeGB(); + + /** + * Gets the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @return the placementProperties value. + */ + Map placementProperties(); + + /** + * Gets the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @return the capacities value. + */ + Map capacities(); + + /** + * Gets the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @return the applicationPorts value. + */ + EndpointRangeDescription applicationPorts(); + + /** + * Gets the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @return the ephemeralPorts value. + */ + EndpointRangeDescription ephemeralPorts(); + + /** + * Gets the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @return the vmImagePublisher value. + */ + String vmImagePublisher(); + + /** + * Gets the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @return the vmImageOffer value. + */ + String vmImageOffer(); + + /** + * Gets the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS + * or 2012-R2-Datacenter. + * + * @return the vmImageSku value. + */ + String vmImageSku(); + + /** + * Gets the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of + * 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @return the vmImageVersion value. + */ + String vmImageVersion(); + + /** + * Gets the vmSecrets property: The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + List vmSecrets(); + + /** + * Gets the vmExtensions property: Set of extensions that should be installed onto the virtual machines. + * + * @return the vmExtensions value. + */ + List vmExtensions(); + + /** + * Gets the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + ManagedResourceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner object. + * + * @return the inner object. + */ + NodeTypeInner innerModel(); + + /** The entirety of the NodeType definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NodeType definition stages. */ + interface DefinitionStages { + /** The first stage of the NodeType definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NodeType definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the NodeType definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIsPrimary, + DefinitionStages.WithVmInstanceCount, + DefinitionStages.WithDataDiskSizeGB, + DefinitionStages.WithPlacementProperties, + DefinitionStages.WithCapacities, + DefinitionStages.WithApplicationPorts, + DefinitionStages.WithEphemeralPorts, + DefinitionStages.WithVmSize, + DefinitionStages.WithVmImagePublisher, + DefinitionStages.WithVmImageOffer, + DefinitionStages.WithVmImageSku, + DefinitionStages.WithVmImageVersion, + DefinitionStages.WithVmSecrets, + DefinitionStages.WithVmExtensions { + /** + * Executes the create request. + * + * @return the created resource. + */ + NodeType create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NodeType create(Context context); + } + /** The stage of the NodeType definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NodeType definition allowing to specify isPrimary. */ + interface WithIsPrimary { + /** + * Specifies the isPrimary property: The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or changed for existing clusters.. + * + * @param isPrimary The node type on which system services will run. Only one node type should be marked as + * primary. Primary node type cannot be deleted or changed for existing clusters. + * @return the next definition stage. + */ + WithCreate withIsPrimary(Boolean isPrimary); + } + /** The stage of the NodeType definition allowing to specify vmInstanceCount. */ + interface WithVmInstanceCount { + /** + * Specifies the vmInstanceCount property: The number of nodes in the node type.. + * + * @param vmInstanceCount The number of nodes in the node type. + * @return the next definition stage. + */ + WithCreate withVmInstanceCount(Integer vmInstanceCount); + } + /** The stage of the NodeType definition allowing to specify dataDiskSizeGB. */ + interface WithDataDiskSizeGB { + /** + * Specifies the dataDiskSizeGB property: Disk size for each vm in the node type in GBs.. + * + * @param dataDiskSizeGB Disk size for each vm in the node type in GBs. + * @return the next definition stage. + */ + WithCreate withDataDiskSizeGB(Integer dataDiskSizeGB); + } + /** The stage of the NodeType definition allowing to specify placementProperties. */ + interface WithPlacementProperties { + /** + * Specifies the placementProperties property: The placement tags applied to nodes in the node type, which + * can be used to indicate where certain services (workload) should run.. + * + * @param placementProperties The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * @return the next definition stage. + */ + WithCreate withPlacementProperties(Map placementProperties); + } + /** The stage of the NodeType definition allowing to specify capacities. */ + interface WithCapacities { + /** + * Specifies the capacities property: The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node has.. + * + * @param capacities The capacity tags applied to the nodes in the node type, the cluster resource manager + * uses these tags to understand how much resource a node has. + * @return the next definition stage. + */ + WithCreate withCapacities(Map capacities); + } + /** The stage of the NodeType definition allowing to specify applicationPorts. */ + interface WithApplicationPorts { + /** + * Specifies the applicationPorts property: The range of ports from which cluster assigned port to Service + * Fabric applications.. + * + * @param applicationPorts The range of ports from which cluster assigned port to Service Fabric + * applications. + * @return the next definition stage. + */ + WithCreate withApplicationPorts(EndpointRangeDescription applicationPorts); + } + /** The stage of the NodeType definition allowing to specify ephemeralPorts. */ + interface WithEphemeralPorts { + /** + * Specifies the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should + * be configured with.. + * + * @param ephemeralPorts The range of ephemeral ports that nodes in this node type should be configured + * with. + * @return the next definition stage. + */ + WithCreate withEphemeralPorts(EndpointRangeDescription ephemeralPorts); + } + /** The stage of the NodeType definition allowing to specify vmSize. */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool + * are the same size. For example, Standard_D3.. + * + * @param vmSize The size of virtual machines in the pool. All virtual machines in a pool are the same size. + * For example, Standard_D3. + * @return the next definition stage. + */ + WithCreate withVmSize(String vmSize); + } + /** The stage of the NodeType definition allowing to specify vmImagePublisher. */ + interface WithVmImagePublisher { + /** + * Specifies the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. + * For example, Canonical or MicrosoftWindowsServer.. + * + * @param vmImagePublisher The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * @return the next definition stage. + */ + WithCreate withVmImagePublisher(String vmImagePublisher); + } + /** The stage of the NodeType definition allowing to specify vmImageOffer. */ + interface WithVmImageOffer { + /** + * Specifies the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For + * example, UbuntuServer or WindowsServer.. + * + * @param vmImageOffer The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * @return the next definition stage. + */ + WithCreate withVmImageOffer(String vmImageOffer); + } + /** The stage of the NodeType definition allowing to specify vmImageSku. */ + interface WithVmImageSku { + /** + * Specifies the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, + * 14.04.0-LTS or 2012-R2-Datacenter.. + * + * @param vmImageSku The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * @return the next definition stage. + */ + WithCreate withVmImageSku(String vmImageSku); + } + /** The stage of the NodeType definition allowing to specify vmImageVersion. */ + interface WithVmImageVersion { + /** + * Specifies the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A + * value of 'latest' can be specified to select the latest version of an image. If omitted, the default is + * 'latest'.. + * + * @param vmImageVersion The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * @return the next definition stage. + */ + WithCreate withVmImageVersion(String vmImageVersion); + } + /** The stage of the NodeType definition allowing to specify vmSecrets. */ + interface WithVmSecrets { + /** + * Specifies the vmSecrets property: The secrets to install in the virtual machines.. + * + * @param vmSecrets The secrets to install in the virtual machines. + * @return the next definition stage. + */ + WithCreate withVmSecrets(List vmSecrets); + } + /** The stage of the NodeType definition allowing to specify vmExtensions. */ + interface WithVmExtensions { + /** + * Specifies the vmExtensions property: Set of extensions that should be installed onto the virtual + * machines.. + * + * @param vmExtensions Set of extensions that should be installed onto the virtual machines. + * @return the next definition stage. + */ + WithCreate withVmExtensions(List vmExtensions); + } + } + /** + * Begins update for the NodeType resource. + * + * @return the stage of resource update. + */ + NodeType.Update update(); + + /** The template for NodeType update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithVmInstanceCount, + UpdateStages.WithPlacementProperties, + UpdateStages.WithCapacities, + UpdateStages.WithApplicationPorts, + UpdateStages.WithEphemeralPorts, + UpdateStages.WithVmSecrets, + UpdateStages.WithVmExtensions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NodeType apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NodeType apply(Context context); + } + /** The NodeType update stages. */ + interface UpdateStages { + /** The stage of the NodeType update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Node type update parameters. + * + * @param tags Node type update parameters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NodeType update allowing to specify vmInstanceCount. */ + interface WithVmInstanceCount { + /** + * Specifies the vmInstanceCount property: The number of nodes in the node type.. + * + * @param vmInstanceCount The number of nodes in the node type. + * @return the next definition stage. + */ + Update withVmInstanceCount(Integer vmInstanceCount); + } + /** The stage of the NodeType update allowing to specify placementProperties. */ + interface WithPlacementProperties { + /** + * Specifies the placementProperties property: The placement tags applied to nodes in the node type, which + * can be used to indicate where certain services (workload) should run.. + * + * @param placementProperties The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * @return the next definition stage. + */ + Update withPlacementProperties(Map placementProperties); + } + /** The stage of the NodeType update allowing to specify capacities. */ + interface WithCapacities { + /** + * Specifies the capacities property: The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node has.. + * + * @param capacities The capacity tags applied to the nodes in the node type, the cluster resource manager + * uses these tags to understand how much resource a node has. + * @return the next definition stage. + */ + Update withCapacities(Map capacities); + } + /** The stage of the NodeType update allowing to specify applicationPorts. */ + interface WithApplicationPorts { + /** + * Specifies the applicationPorts property: The range of ports from which cluster assigned port to Service + * Fabric applications.. + * + * @param applicationPorts The range of ports from which cluster assigned port to Service Fabric + * applications. + * @return the next definition stage. + */ + Update withApplicationPorts(EndpointRangeDescription applicationPorts); + } + /** The stage of the NodeType update allowing to specify ephemeralPorts. */ + interface WithEphemeralPorts { + /** + * Specifies the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should + * be configured with.. + * + * @param ephemeralPorts The range of ephemeral ports that nodes in this node type should be configured + * with. + * @return the next definition stage. + */ + Update withEphemeralPorts(EndpointRangeDescription ephemeralPorts); + } + /** The stage of the NodeType update allowing to specify vmSecrets. */ + interface WithVmSecrets { + /** + * Specifies the vmSecrets property: The secrets to install in the virtual machines.. + * + * @param vmSecrets The secrets to install in the virtual machines. + * @return the next definition stage. + */ + Update withVmSecrets(List vmSecrets); + } + /** The stage of the NodeType update allowing to specify vmExtensions. */ + interface WithVmExtensions { + /** + * Specifies the vmExtensions property: Set of extensions that should be installed onto the virtual + * machines.. + * + * @param vmExtensions Set of extensions that should be installed onto the virtual machines. + * @return the next definition stage. + */ + Update withVmExtensions(List vmExtensions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NodeType refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NodeType refresh(Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java new file mode 100644 index 0000000000000..301b56a60afb1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java @@ -0,0 +1,82 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for Node type action. */ +@Fluent +public final class NodeTypeActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeActionParameters.class); + + /* + * List of node names from the node type. + */ + @JsonProperty(value = "nodes", required = true) + private List nodes; + + /* + * Force the action to go through. + */ + @JsonProperty(value = "force") + private Boolean force; + + /** + * Get the nodes property: List of node names from the node type. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: List of node names from the node type. + * + * @param nodes the nodes value to set. + * @return the NodeTypeActionParameters object itself. + */ + public NodeTypeActionParameters withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get the force property: Force the action to go through. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: Force the action to go through. + * + * @param force the force value to set. + * @return the NodeTypeActionParameters object itself. + */ + public NodeTypeActionParameters withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nodes in model NodeTypeActionParameters")); + } + } +} 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 new file mode 100644 index 0000000000000..fe112aaedd4f5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java @@ -0,0 +1,361 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. */ +@Fluent +public final class NodeTypeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeDescription.class); + + /* + * The name of the node type. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "placementProperties") + private Map placementProperties; + + /* + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node + * has. + */ + @JsonProperty(value = "capacities") + private Map capacities; + + /* + * The TCP cluster management endpoint port. + */ + @JsonProperty(value = "clientConnectionEndpointPort", required = true) + private int clientConnectionEndpointPort; + + /* + * The HTTP cluster management endpoint port. + */ + @JsonProperty(value = "httpGatewayEndpointPort", required = true) + private int httpGatewayEndpointPort; + + /* + * 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. + * + */ + @JsonProperty(value = "durabilityLevel") + private DurabilityLevel durabilityLevel; + + /* + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "applicationPorts") + private EndpointRangeDescription applicationPorts; + + /* + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /* + * The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or + * changed for existing clusters. + */ + @JsonProperty(value = "isPrimary", required = true) + private boolean isPrimary; + + /* + * The number of nodes in the node type. This count should match the + * capacity property in the corresponding VirtualMachineScaleSet resource. + */ + @JsonProperty(value = "vmInstanceCount", required = true) + private int vmInstanceCount; + + /* + * The endpoint used by reverse proxy. + */ + @JsonProperty(value = "reverseProxyEndpointPort") + private Integer reverseProxyEndpointPort; + + /** + * Get the name property: The name of the node type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the node type. + * + * @param name the name value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @return the placementProperties value. + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @return the capacities value. + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @param capacities the capacities value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the clientConnectionEndpointPort property: The TCP cluster management endpoint port. + * + * @return the clientConnectionEndpointPort value. + */ + public int clientConnectionEndpointPort() { + return this.clientConnectionEndpointPort; + } + + /** + * Set the clientConnectionEndpointPort property: The TCP cluster management endpoint port. + * + * @param clientConnectionEndpointPort the clientConnectionEndpointPort value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withClientConnectionEndpointPort(int clientConnectionEndpointPort) { + this.clientConnectionEndpointPort = clientConnectionEndpointPort; + return this; + } + + /** + * Get the httpGatewayEndpointPort property: The HTTP cluster management endpoint port. + * + * @return the httpGatewayEndpointPort value. + */ + public int httpGatewayEndpointPort() { + return this.httpGatewayEndpointPort; + } + + /** + * Set the httpGatewayEndpointPort property: The HTTP cluster management endpoint port. + * + * @param httpGatewayEndpointPort the httpGatewayEndpointPort value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withHttpGatewayEndpointPort(int httpGatewayEndpointPort) { + this.httpGatewayEndpointPort = httpGatewayEndpointPort; + return this; + } + + /** + * Get the durabilityLevel property: 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. + * + * @return the durabilityLevel value. + */ + public DurabilityLevel durabilityLevel() { + return this.durabilityLevel; + } + + /** + * Set the durabilityLevel property: 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. + * + * @param durabilityLevel the durabilityLevel value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withDurabilityLevel(DurabilityLevel durabilityLevel) { + this.durabilityLevel = durabilityLevel; + return this; + } + + /** + * Get the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @return the applicationPorts value. + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @param applicationPorts the applicationPorts value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @return the ephemeralPorts value. + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @param ephemeralPorts the ephemeralPorts value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the isPrimary property: The node type on which system services will run. Only one node type should be marked + * as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @return the isPrimary value. + */ + public boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the isPrimary property: The node type on which system services will run. Only one node type should be marked + * as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @param isPrimary the isPrimary value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withIsPrimary(boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the vmInstanceCount property: The number of nodes in the node type. This count should match the capacity + * property in the corresponding VirtualMachineScaleSet resource. + * + * @return the vmInstanceCount value. + */ + public int vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the vmInstanceCount property: The number of nodes in the node type. This count should match the capacity + * property in the corresponding VirtualMachineScaleSet resource. + * + * @param vmInstanceCount the vmInstanceCount value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withVmInstanceCount(int vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the reverseProxyEndpointPort property: The endpoint used by reverse proxy. + * + * @return the reverseProxyEndpointPort value. + */ + public Integer reverseProxyEndpointPort() { + return this.reverseProxyEndpointPort; + } + + /** + * Set the reverseProxyEndpointPort property: The endpoint used by reverse proxy. + * + * @param reverseProxyEndpointPort the reverseProxyEndpointPort value to set. + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withReverseProxyEndpointPort(Integer reverseProxyEndpointPort) { + this.reverseProxyEndpointPort = reverseProxyEndpointPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model NodeTypeDescription")); + } + if (applicationPorts() != null) { + applicationPorts().validate(); + } + if (ephemeralPorts() != null) { + ephemeralPorts().validate(); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java new file mode 100644 index 0000000000000..b451f57569f86 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java @@ -0,0 +1,81 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Node type list results. */ +@Fluent +public final class NodeTypeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeListResult.class); + + /* + * The list of node types. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of node types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of node types. + * + * @param value the value value to set. + * @return the NodeTypeListResult object itself. + */ + public NodeTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NodeTypeListResult object itself. + */ + public NodeTypeListResult 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()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java new file mode 100644 index 0000000000000..3dbda9947f5c5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java @@ -0,0 +1,261 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Node type update request. */ +@JsonFlatten +@Fluent +public class NodeTypeUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeUpdateParameters.class); + + /* + * Node type update parameters + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The number of nodes in the node type. + */ + @JsonProperty(value = "properties.vmInstanceCount") + private Integer vmInstanceCount; + + /* + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "properties.placementProperties") + private Map placementProperties; + + /* + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node + * has. + */ + @JsonProperty(value = "properties.capacities") + private Map capacities; + + /* + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "properties.applicationPorts") + private EndpointRangeDescription applicationPorts; + + /* + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "properties.ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /* + * The secrets to install in the virtual machines. + */ + @JsonProperty(value = "properties.vmSecrets") + private List vmSecrets; + + /* + * Set of extensions that should be installed onto the virtual machines. + */ + @JsonProperty(value = "properties.vmExtensions") + private List vmExtensions; + + /** + * Get the tags property: Node type update parameters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Node type update parameters. + * + * @param tags the tags value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + public Integer vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the vmInstanceCount property: The number of nodes in the node type. + * + * @param vmInstanceCount the vmInstanceCount value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmInstanceCount(Integer vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @return the placementProperties value. + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placementProperties property: The placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @return the capacities value. + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacities property: The capacity tags applied to the nodes in the node type, the cluster resource + * manager uses these tags to understand how much resource a node has. + * + * @param capacities the capacities value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @return the applicationPorts value. + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @param applicationPorts the applicationPorts value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @return the ephemeralPorts value. + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @param ephemeralPorts the ephemeralPorts value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the vmSecrets property: The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + public List vmSecrets() { + return this.vmSecrets; + } + + /** + * Set the vmSecrets property: The secrets to install in the virtual machines. + * + * @param vmSecrets the vmSecrets value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmSecrets(List vmSecrets) { + this.vmSecrets = vmSecrets; + return this; + } + + /** + * Get the vmExtensions property: Set of extensions that should be installed onto the virtual machines. + * + * @return the vmExtensions value. + */ + public List vmExtensions() { + return this.vmExtensions; + } + + /** + * Set the vmExtensions property: Set of extensions that should be installed onto the virtual machines. + * + * @param vmExtensions the vmExtensions value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmExtensions(List vmExtensions) { + this.vmExtensions = vmExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationPorts() != null) { + applicationPorts().validate(); + } + if (ephemeralPorts() != null) { + ephemeralPorts().validate(); + } + if (vmSecrets() != null) { + vmSecrets().forEach(e -> e.validate()); + } + if (vmExtensions() != null) { + vmExtensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java new file mode 100644 index 0000000000000..19d80440dd38a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java @@ -0,0 +1,247 @@ +// 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.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 NodeTypes. */ +public interface NodeTypes { + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.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 Node types of the specified managed cluster. + */ + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName); + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.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 Node types of the specified managed cluster. + */ + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 node type of a given managed cluster. + */ + NodeType get(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 node type of a given managed cluster. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + NodeType getById(String id); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NodeType resource. + * + * @param name resource name. + * @return the first stage of the new NodeType definition. + */ + NodeType.DefinitionStages.Blank define(String name); +} 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/models/OperationListResult.java new file mode 100644 index 0000000000000..0a0ac52e54264 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationListResult.java @@ -0,0 +1,70 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the result of the request to list Service Fabric resource provider operations. */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of operations supported by the Service Fabric resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the Service Fabric resource provider. + * + * @return the value value. + */ + public List 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..86e4dc0b56cca --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/OperationResult.java @@ -0,0 +1,45 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner; + +/** An immutable client-side representation of OperationResult. */ +public interface OperationResult { + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + AvailableOperationDisplay display(); + + /** + * Gets the origin property: Origin result. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.OperationResultInner object. + * + * @return the inner object. + */ + OperationResultInner innerModel(); +} 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 new file mode 100644 index 0000000000000..4843bec806e58 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java @@ -0,0 +1,91 @@ +// 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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Get the list of available Service Fabric resource provider API 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. + */ + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API 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. + */ + PagedIterable list(); + + /** + * 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 com.azure.core.management.exception.ManagementException 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. + */ + 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 new file mode 100644 index 0000000000000..b1f831533af87 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionScheme.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PartitionScheme. */ +public final class PartitionScheme extends ExpandableStringEnum { + /** Static value Invalid for PartitionScheme. */ + public static final PartitionScheme INVALID = fromString("Invalid"); + + /** Static value Singleton for PartitionScheme. */ + public static final PartitionScheme SINGLETON = fromString("Singleton"); + + /** Static value UniformInt64Range for PartitionScheme. */ + public static final PartitionScheme UNIFORM_INT64RANGE = fromString("UniformInt64Range"); + + /** Static value Named for PartitionScheme. */ + public static final PartitionScheme NAMED = fromString("Named"); + + /** + * Creates or finds a PartitionScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartitionScheme. + */ + @JsonCreator + public static PartitionScheme fromString(String name) { + return fromString(name, PartitionScheme.class); + } + + /** @return known PartitionScheme values. */ + public static Collection values() { + return values(PartitionScheme.class); + } +} 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 new file mode 100644 index 0000000000000..d1e3460171ab5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/PartitionSchemeDescription.java @@ -0,0 +1,37 @@ +// 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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes how the service is partitioned. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "partitionScheme", + defaultImpl = PartitionSchemeDescription.class) +@JsonTypeName("PartitionSchemeDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Named", value = NamedPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "Singleton", value = SingletonPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "UniformInt64Range", value = UniformInt64RangePartitionSchemeDescription.class) +}) +@Immutable +public class PartitionSchemeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartitionSchemeDescription.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java new file mode 100644 index 0000000000000..df7d054c7f025 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java @@ -0,0 +1,37 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProbeProtocol. */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("tcp"); + + /** Static value http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("http"); + + /** Static value https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeProtocol. + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** @return known ProbeProtocol values. */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java new file mode 100644 index 0000000000000..58c639b5c3b16 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value tcp for Protocol. */ + public static final Protocol TCP = fromString("tcp"); + + /** Static value udp for Protocol. */ + public static final Protocol UDP = fromString("udp"); + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); + } +} 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 new file mode 100644 index 0000000000000..8864ca6263c75 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProvisioningState.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} 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 new file mode 100644 index 0000000000000..1e5b9831cc9c4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ReliabilityLevel.java @@ -0,0 +1,43 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReliabilityLevel. */ +public final class ReliabilityLevel extends ExpandableStringEnum { + /** Static value None for ReliabilityLevel. */ + public static final ReliabilityLevel NONE = fromString("None"); + + /** Static value Bronze for ReliabilityLevel. */ + public static final ReliabilityLevel BRONZE = fromString("Bronze"); + + /** Static value Silver for ReliabilityLevel. */ + public static final ReliabilityLevel SILVER = fromString("Silver"); + + /** Static value Gold for ReliabilityLevel. */ + public static final ReliabilityLevel GOLD = fromString("Gold"); + + /** Static value Platinum for ReliabilityLevel. */ + public static final ReliabilityLevel PLATINUM = fromString("Platinum"); + + /** + * Creates or finds a ReliabilityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReliabilityLevel. + */ + @JsonCreator + public static ReliabilityLevel fromString(String name) { + return fromString(name, ReliabilityLevel.class); + } + + /** @return known ReliabilityLevel values. */ + public static Collection values() { + return values(ReliabilityLevel.class); + } +} 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 new file mode 100644 index 0000000000000..c45522f90277a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RollingUpgradeMode. */ +public final class RollingUpgradeMode extends ExpandableStringEnum { + /** Static value Invalid for RollingUpgradeMode. */ + public static final RollingUpgradeMode INVALID = fromString("Invalid"); + + /** Static value UnmonitoredAuto for RollingUpgradeMode. */ + public static final RollingUpgradeMode UNMONITORED_AUTO = fromString("UnmonitoredAuto"); + + /** Static value UnmonitoredManual for RollingUpgradeMode. */ + public static final RollingUpgradeMode UNMONITORED_MANUAL = fromString("UnmonitoredManual"); + + /** Static value Monitored for RollingUpgradeMode. */ + public static final RollingUpgradeMode MONITORED = fromString("Monitored"); + + /** + * Creates or finds a RollingUpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RollingUpgradeMode. + */ + @JsonCreator + public static RollingUpgradeMode fromString(String name) { + return fromString(name, RollingUpgradeMode.class); + } + + /** @return known RollingUpgradeMode values. */ + public static Collection values() { + return values(RollingUpgradeMode.class); + } +} 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 new file mode 100644 index 0000000000000..dadba0b58db40 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonName.java @@ -0,0 +1,88 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the server certificate details using common name. */ +@Fluent +public final class ServerCertificateCommonName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerCertificateCommonName.class); + + /* + * The common name of the server certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /* + * The issuer thumbprint of the server certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get the certificateCommonName property: The common name of the server certificate. + * + * @return the certificateCommonName value. + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the certificateCommonName property: The common name of the server certificate. + * + * @param certificateCommonName the certificateCommonName value to set. + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the certificateIssuerThumbprint property: The issuer thumbprint of the server certificate. + * + * @return the certificateIssuerThumbprint value. + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the certificateIssuerThumbprint property: The issuer thumbprint of the server certificate. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set. + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateCommonName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateCommonName in model ServerCertificateCommonName")); + } + if (certificateIssuerThumbprint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateIssuerThumbprint in model ServerCertificateCommonName")); + } + } +} 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 new file mode 100644 index 0000000000000..a7ce8a5fa90e0 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServerCertificateCommonNames.java @@ -0,0 +1,83 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a list of server certificates referenced by common name that are used to secure the cluster. */ +@Fluent +public final class ServerCertificateCommonNames { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerCertificateCommonNames.class); + + /* + * The list of server certificates referenced by common name that are used + * to secure the cluster. + */ + @JsonProperty(value = "commonNames") + private List commonNames; + + /* + * The local certificate store location. + */ + @JsonProperty(value = "x509StoreName") + private StoreName x509StoreName; + + /** + * Get the commonNames property: The list of server certificates referenced by common name that are used to secure + * the cluster. + * + * @return the commonNames value. + */ + public List commonNames() { + return this.commonNames; + } + + /** + * Set the commonNames property: The list of server certificates referenced by common name that are used to secure + * the cluster. + * + * @param commonNames the commonNames value to set. + * @return the ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withCommonNames(List commonNames) { + this.commonNames = commonNames; + return this; + } + + /** + * Get the x509StoreName property: The local certificate store location. + * + * @return the x509StoreName value. + */ + public StoreName x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the x509StoreName property: The local certificate store location. + * + * @param x509StoreName the x509StoreName value to set. + * @return the ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withX509StoreName(StoreName x509StoreName) { + this.x509StoreName = 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()); + } + } +} 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 new file mode 100644 index 0000000000000..8667122057877 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationDescription.java @@ -0,0 +1,92 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Creates a particular correlation between services. */ +@Fluent +public final class ServiceCorrelationDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceCorrelationDescription.class); + + /* + * The ServiceCorrelationScheme which describes the relationship between + * this service and the service specified via ServiceName. + */ + @JsonProperty(value = "scheme", required = true) + private ServiceCorrelationScheme scheme; + + /* + * The name of the service that the correlation relationship is established + * with. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /** + * Get the scheme property: The ServiceCorrelationScheme which describes the relationship between this service and + * the service specified via ServiceName. + * + * @return the scheme value. + */ + public ServiceCorrelationScheme scheme() { + return this.scheme; + } + + /** + * Set the scheme property: The ServiceCorrelationScheme which describes the relationship between this service and + * the service specified via ServiceName. + * + * @param scheme the scheme value to set. + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withScheme(ServiceCorrelationScheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the serviceName property: The name of the service that the correlation relationship is established with. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service that the correlation relationship is established with. + * + * @param serviceName the serviceName value to set. + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scheme() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property scheme in model ServiceCorrelationDescription")); + } + if (serviceName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model ServiceCorrelationDescription")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationScheme.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationScheme.java new file mode 100644 index 0000000000000..5621f306cd611 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceCorrelationScheme.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceCorrelationScheme. */ +public final class ServiceCorrelationScheme extends ExpandableStringEnum { + /** Static value Invalid for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme INVALID = fromString("Invalid"); + + /** Static value Affinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme AFFINITY = fromString("Affinity"); + + /** Static value AlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme ALIGNED_AFFINITY = fromString("AlignedAffinity"); + + /** Static value NonAlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme NON_ALIGNED_AFFINITY = fromString("NonAlignedAffinity"); + + /** + * Creates or finds a ServiceCorrelationScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceCorrelationScheme. + */ + @JsonCreator + public static ServiceCorrelationScheme fromString(String name) { + return fromString(name, ServiceCorrelationScheme.class); + } + + /** @return known ServiceCorrelationScheme values. */ + public static Collection values() { + return values(ServiceCorrelationScheme.class); + } +} 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 new file mode 100644 index 0000000000000..a016a5f178953 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceKind.java @@ -0,0 +1,37 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceKind. */ +public final class ServiceKind extends ExpandableStringEnum { + /** Static value Invalid for ServiceKind. */ + public static final ServiceKind INVALID = fromString("Invalid"); + + /** Static value Stateless for ServiceKind. */ + public static final ServiceKind STATELESS = fromString("Stateless"); + + /** Static value Stateful for ServiceKind. */ + public static final ServiceKind STATEFUL = fromString("Stateful"); + + /** + * Creates or finds a ServiceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceKind. + */ + @JsonCreator + public static ServiceKind fromString(String name) { + return fromString(name, ServiceKind.class); + } + + /** @return known ServiceKind values. */ + public static Collection values() { + return values(ServiceKind.class); + } +} 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 new file mode 100644 index 0000000000000..e8b0943b16efb --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricDescription.java @@ -0,0 +1,178 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies a metric to load balance a service during runtime. */ +@Fluent +public final class ServiceLoadMetricDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceLoadMetricDescription.class); + + /* + * The name of the metric. If the service chooses to report load during + * runtime, the load metric name should match the name that is specified in + * Name exactly. Note that metric names are case sensitive. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The service load metric relative weight, compared to other metrics + * configured for this service, as a number. + */ + @JsonProperty(value = "weight") + private ServiceLoadMetricWeight weight; + + /* + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Primary + * replica. + */ + @JsonProperty(value = "primaryDefaultLoad") + private Integer primaryDefaultLoad; + + /* + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Secondary + * replica. + */ + @JsonProperty(value = "secondaryDefaultLoad") + private Integer secondaryDefaultLoad; + + /* + * Used only for Stateless services. The default amount of load, as a + * number, that this service creates for this metric. + */ + @JsonProperty(value = "defaultLoad") + private Integer defaultLoad; + + /** + * Get the name property: The name of the metric. If the service chooses to report load during runtime, the load + * metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the metric. If the service chooses to report load during runtime, the load + * metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. + * + * @param name the name value to set. + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the weight property: The service load metric relative weight, compared to other metrics configured for this + * service, as a number. + * + * @return the weight value. + */ + public ServiceLoadMetricWeight weight() { + return this.weight; + } + + /** + * Set the weight property: The service load metric relative weight, compared to other metrics configured for this + * service, as a number. + * + * @param weight the weight value to set. + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withWeight(ServiceLoadMetricWeight weight) { + this.weight = weight; + return this; + } + + /** + * Get the primaryDefaultLoad property: Used only for Stateful services. The default amount of load, as a number, + * that this service creates for this metric when it is a Primary replica. + * + * @return the primaryDefaultLoad value. + */ + public Integer primaryDefaultLoad() { + return this.primaryDefaultLoad; + } + + /** + * Set the primaryDefaultLoad property: Used only for Stateful services. The default amount of load, as a number, + * that this service creates for this metric when it is a Primary replica. + * + * @param primaryDefaultLoad the primaryDefaultLoad value to set. + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withPrimaryDefaultLoad(Integer primaryDefaultLoad) { + this.primaryDefaultLoad = primaryDefaultLoad; + return this; + } + + /** + * Get the secondaryDefaultLoad property: Used only for Stateful services. The default amount of load, as a number, + * that this service creates for this metric when it is a Secondary replica. + * + * @return the secondaryDefaultLoad value. + */ + public Integer secondaryDefaultLoad() { + return this.secondaryDefaultLoad; + } + + /** + * Set the secondaryDefaultLoad property: Used only for Stateful services. The default amount of load, as a number, + * that this service creates for this metric when it is a Secondary replica. + * + * @param secondaryDefaultLoad the secondaryDefaultLoad value to set. + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withSecondaryDefaultLoad(Integer secondaryDefaultLoad) { + this.secondaryDefaultLoad = secondaryDefaultLoad; + return this; + } + + /** + * Get the defaultLoad property: Used only for Stateless services. The default amount of load, as a number, that + * this service creates for this metric. + * + * @return the defaultLoad value. + */ + public Integer defaultLoad() { + return this.defaultLoad; + } + + /** + * Set the defaultLoad property: Used only for Stateless services. The default amount of load, as a number, that + * this service creates for this metric. + * + * @param defaultLoad the defaultLoad value to set. + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withDefaultLoad(Integer defaultLoad) { + this.defaultLoad = defaultLoad; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ServiceLoadMetricDescription")); + } + } +} 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 new file mode 100644 index 0000000000000..bfcd1587a2bcb --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceLoadMetricWeight.java @@ -0,0 +1,40 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceLoadMetricWeight. */ +public final class ServiceLoadMetricWeight extends ExpandableStringEnum { + /** Static value Zero for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight ZERO = fromString("Zero"); + + /** Static value Low for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight LOW = fromString("Low"); + + /** Static value Medium for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight MEDIUM = fromString("Medium"); + + /** Static value High for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight HIGH = fromString("High"); + + /** + * Creates or finds a ServiceLoadMetricWeight from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceLoadMetricWeight. + */ + @JsonCreator + public static ServiceLoadMetricWeight fromString(String name) { + return fromString(name, ServiceLoadMetricWeight.class); + } + + /** @return known ServiceLoadMetricWeight values. */ + public static Collection values() { + return values(ServiceLoadMetricWeight.class); + } +} 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 new file mode 100644 index 0000000000000..fa522f32f55e0 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java @@ -0,0 +1,27 @@ +// 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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the policy to be used for placement of a Service Fabric service. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ServicePlacementPolicyDescription") +@Immutable +public final class ServicePlacementPolicyDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePlacementPolicyDescription.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..e996d965fde0b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyType.java @@ -0,0 +1,47 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServicePlacementPolicyType. */ +public final class ServicePlacementPolicyType extends ExpandableStringEnum { + /** Static value Invalid for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID = fromString("Invalid"); + + /** Static value InvalidDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID_DOMAIN = fromString("InvalidDomain"); + + /** Static value RequiredDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN = fromString("RequiredDomain"); + + /** Static value PreferredPrimaryDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType PREFERRED_PRIMARY_DOMAIN = fromString("PreferredPrimaryDomain"); + + /** Static value RequiredDomainDistribution for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN_DISTRIBUTION = + fromString("RequiredDomainDistribution"); + + /** Static value NonPartiallyPlaceService for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType NON_PARTIALLY_PLACE_SERVICE = fromString("NonPartiallyPlaceService"); + + /** + * Creates or finds a ServicePlacementPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServicePlacementPolicyType. + */ + @JsonCreator + public static ServicePlacementPolicyType fromString(String name) { + return fromString(name, ServicePlacementPolicyType.class); + } + + /** @return known ServicePlacementPolicyType values. */ + public static Collection values() { + return values(ServicePlacementPolicyType.class); + } +} 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 new file mode 100644 index 0000000000000..2d2fc731f3eff --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java @@ -0,0 +1,455 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ServiceResource. */ +public interface ServiceResource { + /** + * 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 placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @return the placementConstraints value. + */ + String placementConstraints(); + + /** + * Gets the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @return the correlationScheme value. + */ + List correlationScheme(); + + /** + * Gets the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @return the serviceLoadMetrics value. + */ + List serviceLoadMetrics(); + + /** + * Gets the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @return the servicePlacementPolicies value. + */ + List servicePlacementPolicies(); + + /** + * Gets the defaultMoveCost property: Specifies the move cost for the service. + * + * @return the defaultMoveCost value. + */ + MoveCost defaultMoveCost(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the serviceTypeName property: The name of the service type. + * + * @return the serviceTypeName value. + */ + String serviceTypeName(); + + /** + * Gets the partitionDescription property: Describes how the service is partitioned. + * + * @return the partitionDescription value. + */ + PartitionSchemeDescription partitionDescription(); + + /** + * Gets the servicePackageActivationMode property: The activation Mode of the service package. + * + * @return the servicePackageActivationMode value. + */ + ArmServicePackageActivationMode servicePackageActivationMode(); + + /** + * Gets 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. + * + * @return the serviceDnsName value. + */ + String serviceDnsName(); + + /** + * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceInner object. + * + * @return the inner object. + */ + ServiceResourceInner innerModel(); + + /** The entirety of the ServiceResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ServiceResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ServiceResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ServiceResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, applicationName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param applicationName The name of the application resource. + * @return the next definition stage. + */ + WithCreate withExistingApplication(String resourceGroupName, String clusterName, String applicationName); + } + /** + * 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.WithPlacementConstraints, + DefinitionStages.WithCorrelationScheme, + DefinitionStages.WithServiceLoadMetrics, + DefinitionStages.WithServicePlacementPolicies, + DefinitionStages.WithDefaultMoveCost, + DefinitionStages.WithServiceTypeName, + DefinitionStages.WithPartitionDescription, + DefinitionStages.WithServicePackageActivationMode, + DefinitionStages.WithServiceDnsName { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServiceResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServiceResource create(Context context); + } + /** The stage of the ServiceResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location It will be deprecated in New API, resource location depends on the parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ServiceResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ServiceResource definition allowing to specify placementConstraints. */ + interface WithPlacementConstraints { + /** + * Specifies the placementConstraints property: The placement constraints as a string. Placement constraints + * are boolean expressions on node properties and allow for restricting a service to particular nodes based + * on the service requirements. For example, to place a service on nodes where NodeType is blue specify the + * following: "NodeColor == blue)".. + * + * @param placementConstraints The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the + * service requirements. For example, to place a service on nodes where NodeType is blue specify the + * following: "NodeColor == blue)". + * @return the next definition stage. + */ + WithCreate withPlacementConstraints(String placementConstraints); + } + /** The stage of the ServiceResource definition allowing to specify correlationScheme. */ + interface WithCorrelationScheme { + /** + * Specifies the correlationScheme property: A list that describes the correlation of the service with other + * services.. + * + * @param correlationScheme A list that describes the correlation of the service with other services. + * @return the next definition stage. + */ + WithCreate withCorrelationScheme(List correlationScheme); + } + /** The stage of the ServiceResource definition allowing to specify serviceLoadMetrics. */ + interface WithServiceLoadMetrics { + /** + * Specifies the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects.. + * + * @param serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetricDescription + * objects. + * @return the next definition stage. + */ + WithCreate withServiceLoadMetrics(List serviceLoadMetrics); + } + /** The stage of the ServiceResource definition allowing to specify servicePlacementPolicies. */ + interface WithServicePlacementPolicies { + /** + * Specifies the servicePlacementPolicies property: A list that describes the correlation of the service + * with other services.. + * + * @param servicePlacementPolicies A list that describes the correlation of the service with other services. + * @return the next definition stage. + */ + WithCreate withServicePlacementPolicies(List servicePlacementPolicies); + } + /** The stage of the ServiceResource definition allowing to specify defaultMoveCost. */ + interface WithDefaultMoveCost { + /** + * Specifies the defaultMoveCost property: Specifies the move cost for the service.. + * + * @param defaultMoveCost Specifies the move cost for the service. + * @return the next definition stage. + */ + WithCreate withDefaultMoveCost(MoveCost defaultMoveCost); + } + /** The stage of the ServiceResource definition allowing to specify serviceTypeName. */ + interface WithServiceTypeName { + /** + * Specifies the serviceTypeName property: The name of the service type. + * + * @param serviceTypeName The name of the service type. + * @return the next definition stage. + */ + WithCreate withServiceTypeName(String serviceTypeName); + } + /** The stage of the ServiceResource definition allowing to specify partitionDescription. */ + interface WithPartitionDescription { + /** + * Specifies the partitionDescription property: Describes how the service is partitioned.. + * + * @param partitionDescription Describes how the service is partitioned. + * @return the next definition stage. + */ + WithCreate withPartitionDescription(PartitionSchemeDescription partitionDescription); + } + /** The stage of the ServiceResource definition allowing to specify servicePackageActivationMode. */ + interface WithServicePackageActivationMode { + /** + * Specifies the servicePackageActivationMode property: The activation Mode of the service package. + * + * @param servicePackageActivationMode The activation Mode of the service package. + * @return the next definition stage. + */ + WithCreate withServicePackageActivationMode(ArmServicePackageActivationMode servicePackageActivationMode); + } + /** The stage of the ServiceResource definition allowing to specify serviceDnsName. */ + interface WithServiceDnsName { + /** + * Specifies 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.. + * + * @param serviceDnsName Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * @return the next definition stage. + */ + WithCreate withServiceDnsName(String serviceDnsName); + } + } + /** + * Begins update for the ServiceResource resource. + * + * @return the stage of resource update. + */ + ServiceResource.Update update(); + + /** The template for ServiceResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPlacementConstraints, + UpdateStages.WithCorrelationScheme, + UpdateStages.WithServiceLoadMetrics, + UpdateStages.WithServicePlacementPolicies, + UpdateStages.WithDefaultMoveCost { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServiceResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServiceResource apply(Context context); + } + /** The ServiceResource update stages. */ + interface UpdateStages { + /** The stage of the ServiceResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ServiceResource update allowing to specify placementConstraints. */ + interface WithPlacementConstraints { + /** + * Specifies the placementConstraints property: The placement constraints as a string. Placement constraints + * are boolean expressions on node properties and allow for restricting a service to particular nodes based + * on the service requirements. For example, to place a service on nodes where NodeType is blue specify the + * following: "NodeColor == blue)".. + * + * @param placementConstraints The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the + * service requirements. For example, to place a service on nodes where NodeType is blue specify the + * following: "NodeColor == blue)". + * @return the next definition stage. + */ + Update withPlacementConstraints(String placementConstraints); + } + /** The stage of the ServiceResource update allowing to specify correlationScheme. */ + interface WithCorrelationScheme { + /** + * Specifies the correlationScheme property: A list that describes the correlation of the service with other + * services.. + * + * @param correlationScheme A list that describes the correlation of the service with other services. + * @return the next definition stage. + */ + Update withCorrelationScheme(List correlationScheme); + } + /** The stage of the ServiceResource update allowing to specify serviceLoadMetrics. */ + interface WithServiceLoadMetrics { + /** + * Specifies the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects.. + * + * @param serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetricDescription + * objects. + * @return the next definition stage. + */ + Update withServiceLoadMetrics(List serviceLoadMetrics); + } + /** The stage of the ServiceResource update allowing to specify servicePlacementPolicies. */ + interface WithServicePlacementPolicies { + /** + * Specifies the servicePlacementPolicies property: A list that describes the correlation of the service + * with other services.. + * + * @param servicePlacementPolicies A list that describes the correlation of the service with other services. + * @return the next definition stage. + */ + Update withServicePlacementPolicies(List servicePlacementPolicies); + } + /** The stage of the ServiceResource update allowing to specify defaultMoveCost. */ + interface WithDefaultMoveCost { + /** + * Specifies the defaultMoveCost property: Specifies the move cost for the service.. + * + * @param defaultMoveCost Specifies the move cost for the service. + * @return the next definition stage. + */ + Update withDefaultMoveCost(MoveCost defaultMoveCost); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServiceResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServiceResource refresh(Context context); +} 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/models/ServiceResourceList.java new file mode 100644 index 0000000000000..c284b38f582f1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceList.java @@ -0,0 +1,32 @@ +// 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.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceListInner; +import java.util.List; + +/** An immutable client-side representation of ServiceResourceList. */ +public interface ServiceResourceList { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of service list results if there are any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ServiceResourceListInner object. + * + * @return the inner object. + */ + ServiceResourceListInner innerModel(); +} 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 new file mode 100644 index 0000000000000..d08555971434b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java @@ -0,0 +1,204 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The service resource properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "serviceKind", + defaultImpl = ServiceResourceProperties.class) +@JsonTypeName("ServiceResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceProperties.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceProperties.class) +}) +@Fluent +public class ServiceResourceProperties extends ServiceResourcePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceProperties.class); + + /* + * The current deployment or provisioning state, which only appears in the + * response + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The name of the service type + */ + @JsonProperty(value = "serviceTypeName") + private String serviceTypeName; + + /* + * Describes how the service is partitioned. + */ + @JsonProperty(value = "partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /* + * The activation Mode of the service package + */ + @JsonProperty(value = "servicePackageActivationMode") + 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. + */ + @JsonProperty(value = "serviceDnsName") + private String serviceDnsName; + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the serviceTypeName property: The name of the service type. + * + * @return the serviceTypeName value. + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the serviceTypeName property: The name of the service type. + * + * @param serviceTypeName the serviceTypeName value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription property: Describes how the service is partitioned. + * + * @return the partitionDescription value. + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription property: Describes how the service is partitioned. + * + * @param partitionDescription the partitionDescription value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get the servicePackageActivationMode property: The activation Mode of the service package. + * + * @return the servicePackageActivationMode value. + */ + public ArmServicePackageActivationMode servicePackageActivationMode() { + return this.servicePackageActivationMode; + } + + /** + * Set the servicePackageActivationMode property: The activation Mode of the service package. + * + * @param servicePackageActivationMode the servicePackageActivationMode value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withServicePackageActivationMode( + ArmServicePackageActivationMode servicePackageActivationMode) { + this.servicePackageActivationMode = servicePackageActivationMode; + return this; + } + + /** + * 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. + * + * @return the serviceDnsName value. + */ + public String serviceDnsName() { + return this.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. + * + * @param serviceDnsName the serviceDnsName value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceProperties withCorrelationScheme(List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceProperties withServiceLoadMetrics(List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (partitionDescription() != null) { + partitionDescription().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..af8a802a8b8d6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourcePropertiesBase.java @@ -0,0 +1,182 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The common service resource properties. */ +@Fluent +public class ServiceResourcePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourcePropertiesBase.class); + + /* + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "placementConstraints") + private String placementConstraints; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "correlationScheme") + private List correlationScheme; + + /* + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "serviceLoadMetrics") + private List serviceLoadMetrics; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "servicePlacementPolicies") + private List servicePlacementPolicies; + + /* + * Specifies the move cost for the service. + */ + @JsonProperty(value = "defaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * Get the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @return the placementConstraints value. + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @param placementConstraints the placementConstraints value to set. + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @return the correlationScheme value. + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @param correlationScheme the correlationScheme value to set. + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @return the serviceLoadMetrics value. + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set. + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @return the servicePlacementPolicies value. + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set. + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withServicePlacementPolicies( + List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost property: Specifies the move cost for the service. + * + * @return the defaultMoveCost value. + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost property: Specifies the move cost for the service. + * + * @param defaultMoveCost the defaultMoveCost value to set. + * @return the ServiceResourcePropertiesBase object itself. + */ + public ServiceResourcePropertiesBase withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + 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()); + } + } +} 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 new file mode 100644 index 0000000000000..c42f44325d625 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java @@ -0,0 +1,254 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The service resource for patch operations. */ +@JsonFlatten +@Fluent +public class ServiceResourceUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceUpdate.class); + + /* + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /* + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /* + * A list that describes the correlation of the service with other + * services. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /* + * Specifies the move cost for the service. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private MoveCost defaultMoveCost; + + /* + * It will be deprecated in New API, resource location depends on the + * parent resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @return the placementConstraints value. + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints property: The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor + * == blue)". + * + * @param placementConstraints the placementConstraints value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @return the correlationScheme value. + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme property: A list that describes the correlation of the service with other services. + * + * @param correlationScheme the correlationScheme value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @return the serviceLoadMetrics value. + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics property: The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @return the servicePlacementPolicies value. + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies property: A list that describes the correlation of the service with other + * services. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withServicePlacementPolicies( + List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the defaultMoveCost property: Specifies the move cost for the service. + * + * @return the defaultMoveCost value. + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the defaultMoveCost property: Specifies the move cost for the service. + * + * @param defaultMoveCost the defaultMoveCost value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: It will be deprecated in New API, resource location depends on the parent resource. + * + * @param location the location value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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()); + } + } +} 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 new file mode 100644 index 0000000000000..b26fee8e0d8a1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java @@ -0,0 +1,77 @@ +// 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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The service resource properties for patch operations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "serviceKind", + defaultImpl = ServiceResourceUpdateProperties.class) +@JsonTypeName("ServiceResourceUpdateProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceUpdateProperties.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceUpdateProperties.class) +}) +@Immutable +public class ServiceResourceUpdateProperties extends ServiceResourcePropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceUpdateProperties.class); + + /** {@inheritDoc} */ + @Override + public ServiceResourceUpdateProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceUpdateProperties withCorrelationScheme( + List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceUpdateProperties withServiceLoadMetrics( + List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceUpdateProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceUpdateProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..51252259378fa --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeDeltaHealthPolicy.java @@ -0,0 +1,66 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the delta health policy used to evaluate the health of services belonging to a service type when upgrading + * the cluster. + */ +@Fluent +public final class ServiceTypeDeltaHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTypeDeltaHealthPolicy.class); + + /* + * The maximum allowed percentage of services health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the services at the beginning + * of upgrade and the state of the services at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyServices") + private Integer maxPercentDeltaUnhealthyServices; + + /** + * Get the maxPercentDeltaUnhealthyServices property: The maximum allowed percentage of services health degradation + * allowed during cluster upgrades. The delta is measured between the state of the services at the beginning of + * upgrade and the state of the services at the time of the health evaluation. The check is performed after every + * upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @return the maxPercentDeltaUnhealthyServices value. + */ + public Integer maxPercentDeltaUnhealthyServices() { + return this.maxPercentDeltaUnhealthyServices; + } + + /** + * Set the maxPercentDeltaUnhealthyServices property: The maximum allowed percentage of services health degradation + * allowed during cluster upgrades. The delta is measured between the state of the services at the beginning of + * upgrade and the state of the services at the time of the health evaluation. The check is performed after every + * upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @param maxPercentDeltaUnhealthyServices the maxPercentDeltaUnhealthyServices value to set. + * @return the ServiceTypeDeltaHealthPolicy object itself. + */ + public ServiceTypeDeltaHealthPolicy withMaxPercentDeltaUnhealthyServices(Integer maxPercentDeltaUnhealthyServices) { + this.maxPercentDeltaUnhealthyServices = maxPercentDeltaUnhealthyServices; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..b8a5966a10273 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceTypeHealthPolicy.java @@ -0,0 +1,54 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the health policy used to evaluate the health of services belonging to a service type. */ +@Fluent +public final class ServiceTypeHealthPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTypeHealthPolicy.class); + + /* + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + */ + @JsonProperty(value = "maxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Get the maxPercentUnhealthyServices property: The maximum percentage of services allowed to be unhealthy before + * your application is considered in error. + * + * @return the maxPercentUnhealthyServices value. + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maxPercentUnhealthyServices property: The maximum percentage of services allowed to be unhealthy before + * your application is considered in error. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set. + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 0000000000000..e583b89bd2c72 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Services.java @@ -0,0 +1,159 @@ +// 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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Services. */ +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 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 + * application resource. + */ + ServiceResource get(String resourceGroupName, String clusterName, String applicationName, String serviceName); + + /** + * 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}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context); + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationName, String serviceName); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String clusterName, String applicationName, String serviceName, Context context); + + /** + * 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 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. + */ + ServiceResourceList list(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 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. + */ + Response listWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric + * application resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * application resource. + */ + ServiceResource getById(String id); + + /** + * Get a Service Fabric service resource created or in the process of being created in the Service Fabric + * application resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric service resource created or in the process of being created in the Service Fabric + * application resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric service resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric service resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServiceResource resource. + * + * @param name resource name. + * @return the first stage of the new ServiceResource definition. + */ + ServiceResource.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..ab8b9f267d46c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsParameterDescription.java @@ -0,0 +1,88 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a parameter in fabric settings of the cluster. */ +@Fluent +public final class SettingsParameterDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SettingsParameterDescription.class); + + /* + * The parameter name of fabric setting. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The parameter value of fabric setting. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: The parameter name of fabric setting. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The parameter name of fabric setting. + * + * @param name the name value to set. + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The parameter value of fabric setting. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The parameter value of fabric setting. + * + * @param value the value value to set. + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model SettingsParameterDescription")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model SettingsParameterDescription")); + } + } +} 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 new file mode 100644 index 0000000000000..2b940bf99fc07 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SettingsSectionDescription.java @@ -0,0 +1,90 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a section in the fabric settings of the cluster. */ +@Fluent +public final class SettingsSectionDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SettingsSectionDescription.class); + + /* + * The section name of the fabric settings. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The collection of parameters in the section. + */ + @JsonProperty(value = "parameters", required = true) + private List parameters; + + /** + * Get the name property: The section name of the fabric settings. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The section name of the fabric settings. + * + * @param name the name value to set. + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: The collection of parameters in the section. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The collection of parameters in the section. + * + * @param parameters the parameters value to set. + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SettingsSectionDescription")); + } + if (parameters() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model SettingsSectionDescription")); + } else { + parameters().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..303c8fab3ca44 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SingletonPartitionSchemeDescription.java @@ -0,0 +1,29 @@ +// 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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** SingletonPartitionSchemeDescription. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "partitionScheme") +@JsonTypeName("Singleton") +@Immutable +public final class SingletonPartitionSchemeDescription extends PartitionSchemeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SingletonPartitionSchemeDescription.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java new file mode 100644 index 0000000000000..379d965549aed --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java @@ -0,0 +1,54 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku definition. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Sku Name. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Get the name property: Sku Name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Sku Name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java new file mode 100644 index 0000000000000..25c7be15cee6e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} 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 new file mode 100644 index 0000000000000..49485be3f6ce8 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java @@ -0,0 +1,266 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a stateful service resource. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +@Fluent +public final class StatefulServiceProperties extends ServiceResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatefulServiceProperties.class); + + /* + * A flag indicating whether this is a persistent service which stores + * states on the local disk. If it is then the value of this property is + * true, if not it is false. + */ + @JsonProperty(value = "hasPersistedState") + private Boolean hasPersistedState; + + /* + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /* + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /* + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private OffsetDateTime replicaRestartWaitDuration; + + /* + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private OffsetDateTime quorumLossWaitDuration; + + /* + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private OffsetDateTime standByReplicaKeepDuration; + + /** + * Get the hasPersistedState property: A flag indicating whether this is a persistent service which stores states on + * the local disk. If it is then the value of this property is true, if not it is false. + * + * @return the hasPersistedState value. + */ + public Boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set the hasPersistedState property: A flag indicating whether this is a persistent service which stores states on + * the local disk. If it is then the value of this property is true, if not it is false. + * + * @param hasPersistedState the hasPersistedState value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withHasPersistedState(Boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + + /** + * Get the targetReplicaSetSize property: The target replica set size as a number. + * + * @return the targetReplicaSetSize value. + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the targetReplicaSetSize property: The target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minReplicaSetSize property: The minimum replica set size as a number. + * + * @return the minReplicaSetSize value. + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minReplicaSetSize property: The minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the replicaRestartWaitDuration property: The duration between when a replica goes down and when a new replica + * is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the replicaRestartWaitDuration value. + */ + public OffsetDateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the replicaRestartWaitDuration property: The duration between when a replica goes down and when a new replica + * is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withReplicaRestartWaitDuration(OffsetDateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the quorumLossWaitDuration property: The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the quorumLossWaitDuration value. + */ + public OffsetDateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the quorumLossWaitDuration property: The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withQuorumLossWaitDuration(OffsetDateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the standByReplicaKeepDuration property: The definition on how long StandBy replicas should be maintained + * before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the standByReplicaKeepDuration value. + */ + public OffsetDateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the standByReplicaKeepDuration property: The definition on how long StandBy replicas should be maintained + * before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set. + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withStandByReplicaKeepDuration(OffsetDateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServiceTypeName(String serviceTypeName) { + super.withServiceTypeName(serviceTypeName); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withPartitionDescription(PartitionSchemeDescription partitionDescription) { + super.withPartitionDescription(partitionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServicePackageActivationMode( + ArmServicePackageActivationMode servicePackageActivationMode) { + super.withServicePackageActivationMode(servicePackageActivationMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServiceDnsName(String serviceDnsName) { + super.withServiceDnsName(serviceDnsName); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withCorrelationScheme(List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServiceLoadMetrics(List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..71664f2669a60 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceUpdateProperties.java @@ -0,0 +1,209 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a stateful service resource for patch operations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +@Fluent +public final class StatefulServiceUpdateProperties extends ServiceResourceUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatefulServiceUpdateProperties.class); + + /* + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /* + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /* + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private OffsetDateTime replicaRestartWaitDuration; + + /* + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private OffsetDateTime quorumLossWaitDuration; + + /* + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private OffsetDateTime standByReplicaKeepDuration; + + /** + * Get the targetReplicaSetSize property: The target replica set size as a number. + * + * @return the targetReplicaSetSize value. + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the targetReplicaSetSize property: The target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set. + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minReplicaSetSize property: The minimum replica set size as a number. + * + * @return the minReplicaSetSize value. + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minReplicaSetSize property: The minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set. + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the replicaRestartWaitDuration property: The duration between when a replica goes down and when a new replica + * is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the replicaRestartWaitDuration value. + */ + public OffsetDateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the replicaRestartWaitDuration property: The duration between when a replica goes down and when a new replica + * is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set. + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withReplicaRestartWaitDuration(OffsetDateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the quorumLossWaitDuration property: The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the quorumLossWaitDuration value. + */ + public OffsetDateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the quorumLossWaitDuration property: The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set. + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withQuorumLossWaitDuration(OffsetDateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the standByReplicaKeepDuration property: The definition on how long StandBy replicas should be maintained + * before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the standByReplicaKeepDuration value. + */ + public OffsetDateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the standByReplicaKeepDuration property: The definition on how long StandBy replicas should be maintained + * before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set. + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withStandByReplicaKeepDuration(OffsetDateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceUpdateProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceUpdateProperties withCorrelationScheme( + List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceUpdateProperties withServiceLoadMetrics( + List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceUpdateProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatefulServiceUpdateProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..d77b9c1e9a2cf --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java @@ -0,0 +1,165 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of a stateless service resource. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +@Fluent +public final class StatelessServiceProperties extends ServiceResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatelessServiceProperties.class); + + /* + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /* + * Delay duration for RequestDrain feature to ensures that the endpoint + * 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. + * If that fails, then it is interpreted as a number representing the total + * number of milliseconds. + */ + @JsonProperty(value = "instanceCloseDelayDuration") + private String instanceCloseDelayDuration; + + /** + * Get the instanceCount property: The instance count. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The instance count. + * + * @param instanceCount the instanceCount value to set. + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * 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. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @return the instanceCloseDelayDuration value. + */ + public String instanceCloseDelayDuration() { + return this.instanceCloseDelayDuration; + } + + /** + * Set the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * 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. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @param instanceCloseDelayDuration the instanceCloseDelayDuration value to set. + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withInstanceCloseDelayDuration(String instanceCloseDelayDuration) { + this.instanceCloseDelayDuration = instanceCloseDelayDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServiceTypeName(String serviceTypeName) { + super.withServiceTypeName(serviceTypeName); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withPartitionDescription(PartitionSchemeDescription partitionDescription) { + super.withPartitionDescription(partitionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServicePackageActivationMode( + ArmServicePackageActivationMode servicePackageActivationMode) { + super.withServicePackageActivationMode(servicePackageActivationMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServiceDnsName(String serviceDnsName) { + super.withServiceDnsName(serviceDnsName); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withCorrelationScheme(List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServiceLoadMetrics(List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..9fb2274308d00 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java @@ -0,0 +1,138 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of a stateless service resource for patch operations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +@Fluent +public final class StatelessServiceUpdateProperties extends ServiceResourceUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatelessServiceUpdateProperties.class); + + /* + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /* + * Delay duration for RequestDrain feature to ensures that the endpoint + * 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. + * If that fails, then it is interpreted as a number representing the total + * number of milliseconds. + */ + @JsonProperty(value = "instanceCloseDelayDuration") + private String instanceCloseDelayDuration; + + /** + * Get the instanceCount property: The instance count. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The instance count. + * + * @param instanceCount the instanceCount value to set. + * @return the StatelessServiceUpdateProperties object itself. + */ + public StatelessServiceUpdateProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * 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. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @return the instanceCloseDelayDuration value. + */ + public String instanceCloseDelayDuration() { + return this.instanceCloseDelayDuration; + } + + /** + * Set the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * 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. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @param instanceCloseDelayDuration the instanceCloseDelayDuration value to set. + * @return the StatelessServiceUpdateProperties object itself. + */ + public StatelessServiceUpdateProperties withInstanceCloseDelayDuration(String instanceCloseDelayDuration) { + this.instanceCloseDelayDuration = instanceCloseDelayDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceUpdateProperties withPlacementConstraints(String placementConstraints) { + super.withPlacementConstraints(placementConstraints); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceUpdateProperties withCorrelationScheme( + List correlationScheme) { + super.withCorrelationScheme(correlationScheme); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceUpdateProperties withServiceLoadMetrics( + List serviceLoadMetrics) { + super.withServiceLoadMetrics(serviceLoadMetrics); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceUpdateProperties withServicePlacementPolicies( + List servicePlacementPolicies) { + super.withServicePlacementPolicies(servicePlacementPolicies); + return this; + } + + /** {@inheritDoc} */ + @Override + public StatelessServiceUpdateProperties withDefaultMoveCost(MoveCost defaultMoveCost) { + super.withDefaultMoveCost(defaultMoveCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 0000000000000..3fd497cc80cc1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StoreName.java @@ -0,0 +1,52 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StoreName. */ +public final class StoreName extends ExpandableStringEnum { + /** Static value AddressBook for StoreName. */ + public static final StoreName ADDRESS_BOOK = fromString("AddressBook"); + + /** Static value AuthRoot for StoreName. */ + public static final StoreName AUTH_ROOT = fromString("AuthRoot"); + + /** Static value CertificateAuthority for StoreName. */ + public static final StoreName CERTIFICATE_AUTHORITY = fromString("CertificateAuthority"); + + /** Static value Disallowed for StoreName. */ + public static final StoreName DISALLOWED = fromString("Disallowed"); + + /** Static value My for StoreName. */ + public static final StoreName MY = fromString("My"); + + /** Static value Root for StoreName. */ + public static final StoreName ROOT = fromString("Root"); + + /** Static value TrustedPeople for StoreName. */ + public static final StoreName TRUSTED_PEOPLE = fromString("TrustedPeople"); + + /** Static value TrustedPublisher for StoreName. */ + public static final StoreName TRUSTED_PUBLISHER = fromString("TrustedPublisher"); + + /** + * Creates or finds a StoreName from its string representation. + * + * @param name a name to look for. + * @return the corresponding StoreName. + */ + @JsonCreator + public static StoreName fromString(String name) { + return fromString(name, StoreName.class); + } + + /** @return known StoreName values. */ + public static Collection values() { + return values(StoreName.class); + } +} 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 new file mode 100644 index 0000000000000..2ac85fc5ae8f3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java @@ -0,0 +1,128 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes a partitioning scheme where an integer range is allocated evenly across a number of partitions. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "partitionScheme") +@JsonTypeName("UniformInt64Range") +@Fluent +public final class UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UniformInt64RangePartitionSchemeDescription.class); + + /* + * The number of partitions. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * String indicating the lower bound of the partition key range that + * should be split between the partition ‘count’ + * + */ + @JsonProperty(value = "lowKey", required = true) + private String lowKey; + + /* + * String indicating the upper bound of the partition key range that + * should be split between the partition ‘count’ + * + */ + @JsonProperty(value = "highKey", required = true) + private String highKey; + + /** + * Get the count property: The number of partitions. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: The number of partitions. + * + * @param count the count value to set. + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the lowKey property: String indicating the lower bound of the partition key range that should be split + * between the partition ‘count’. + * + * @return the lowKey value. + */ + public String lowKey() { + return this.lowKey; + } + + /** + * Set the lowKey property: String indicating the lower bound of the partition key range that should be split + * between the partition ‘count’. + * + * @param lowKey the lowKey value to set. + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withLowKey(String lowKey) { + this.lowKey = lowKey; + return this; + } + + /** + * Get the highKey property: String indicating the upper bound of the partition key range that should be split + * between the partition ‘count’. + * + * @return the highKey value. + */ + public String highKey() { + return this.highKey; + } + + /** + * Set the highKey property: String indicating the upper bound of the partition key range that should be split + * between the partition ‘count’. + * + * @param highKey the highKey value to set. + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withHighKey(String highKey) { + this.highKey = highKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (lowKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lowKey in model UniformInt64RangePartitionSchemeDescription")); + } + if (highKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property highKey in model UniformInt64RangePartitionSchemeDescription")); + } + } +} 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 new file mode 100644 index 0000000000000..bdd153e936532 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UpgradeMode.java @@ -0,0 +1,34 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpgradeMode. */ +public final class UpgradeMode extends ExpandableStringEnum { + /** Static value Automatic for UpgradeMode. */ + public static final UpgradeMode AUTOMATIC = fromString("Automatic"); + + /** Static value Manual for UpgradeMode. */ + public static final UpgradeMode MANUAL = fromString("Manual"); + + /** + * Creates or finds a UpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpgradeMode. + */ + @JsonCreator + public static UpgradeMode fromString(String name) { + return fromString(name, UpgradeMode.class); + } + + /** @return known UpgradeMode values. */ + public static Collection values() { + return values(UpgradeMode.class); + } +} 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 new file mode 100644 index 0000000000000..9495684bf4108 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// 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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentity model. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java new file mode 100644 index 0000000000000..7e38633fd47d4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java @@ -0,0 +1,118 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. */ +@Fluent +public final class VaultCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificate.class); + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as + * a secret. For adding a secret to the Key Vault, see [Add a key or secret + * to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

{
+ * "data":"",
"dataType":"pfx",
+ * "password":""
} + */ + @JsonProperty(value = "certificateUrl", required = true) + private String certificateUrl; + + /* + * For Windows VMs, specifies the certificate store on the Virtual Machine + * to which the certificate should be added. The specified certificate + * store is implicitly in the LocalMachine account.

For Linux VMs, + * the certificate file is placed under the /var/lib/waagent directory, + * with the file name .crt for the X509 certificate + * file and .prv for private key. Both of these files + * are .pem formatted. + */ + @JsonProperty(value = "certificateStore", required = true) + private String certificateStore; + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @param certificateUrl the certificateUrl value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Get the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for + * private key. Both of these files are .pem formatted. + * + * @return the certificateStore value. + */ + public String certificateStore() { + return this.certificateStore; + } + + /** + * Set the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for + * private key. Both of these files are .pem formatted. + * + * @param certificateStore the certificateStore value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateStore(String certificateStore) { + this.certificateStore = certificateStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property certificateUrl in model VaultCertificate")); + } + if (certificateStore() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateStore in model VaultCertificate")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java new file mode 100644 index 0000000000000..268ddc303b2b4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies set of certificates that should be installed onto the virtual machines. */ +@Fluent +public final class VaultSecretGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSecretGroup.class); + + /* + * The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + */ + @JsonProperty(value = "sourceVault", required = true) + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain + * certificates. + */ + @JsonProperty(value = "vaultCertificates", required = true) + private List vaultCertificates; + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceVault in model VaultSecretGroup")); + } + if (vaultCertificates() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultCertificates in model VaultSecretGroup")); + } else { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java new file mode 100644 index 0000000000000..c7fd05c9ae41b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java @@ -0,0 +1,315 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies set of extensions that should be installed onto the virtual machines. */ +@JsonFlatten +@Fluent +public class VmssExtension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmssExtension.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher", required = true) + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type", required = true) + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion", required = true) + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * If a value is provided and is different from the previous value, the + * extension handler will be forced to update even if the extension + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * Collection of extension names after which this extension needs to be + * provisioned. + */ + @JsonProperty(value = "properties.provisionAfterExtensions") + private List provisionAfterExtensions; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model VmssExtension")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property publisher in model VmssExtension")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model VmssExtension")); + } + if (typeHandlerVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property typeHandlerVersion in model VmssExtension")); + } + } +} 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 new file mode 100644 index 0000000000000..6811815a9711e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ServiceFabricManagementClient. Service Fabric Management 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 new file mode 100644 index 0000000000000..08fe393004929 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ServiceFabricManagementClient. Service Fabric Management 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 new file mode 100644 index 0000000000000..55991d3777427 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.servicefabric { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.servicefabric; + exports com.azure.resourcemanager.servicefabric.fluent; + exports com.azure.resourcemanager.servicefabric.fluent.models; + exports com.azure.resourcemanager.servicefabric.models; + + opens com.azure.resourcemanager.servicefabric.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.servicefabric.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/servicefabric/ci.yml b/sdk/servicefabric/ci.yml new file mode 100644 index 0000000000000..1ac3736b4ab45 --- /dev/null +++ b/sdk/servicefabric/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: servicefabric + Artifacts: + - name: azure-resourcemanager-servicefabric + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerservicefabric diff --git a/sdk/servicefabric/pom.xml b/sdk/servicefabric/pom.xml new file mode 100644 index 0000000000000..468f341a7b08e --- /dev/null +++ b/sdk/servicefabric/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-servicefabric-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-servicefabric + + + +