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 000000000000..26d90cb9688e
--- /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 000000000000..8dd5287c3bec
--- /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 000000000000..6d8c1241e973
--- /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 000000000000..bfa6fbb0ecb2
--- /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 000000000000..0fded240ded8
--- /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 000000000000..c415e8333200
--- /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 000000000000..beaaa753f70b
--- /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 000000000000..c88aa4b76eee
--- /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 000000000000..6360be298531
--- /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 000000000000..f9a0bf1b65c4
--- /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 000000000000..191c478e358b
--- /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 000000000000..a377863880c6
--- /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 000000000000..d659f61d60ca
--- /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 000000000000..d62290614006
--- /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 000000000000..5be8d874b559
--- /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 000000000000..61656b2ff5ca
--- /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 000000000000..ead35698a090
--- /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 000000000000..46751dcaa320
--- /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