/// <summary>
 /// Initializes a new instance of the ApplicationUpgradeDescription class.
 /// </summary>
 /// <param name="name">The name of the target application, including the 'fabric:' URI scheme.</param>
 /// <param name="targetApplicationTypeVersion">The target application type version (found in the application manifest)
 /// for the application upgrade.</param>
 /// <param name="upgradeKind">The kind of upgrade out of the following possible values. Possible values include:
 /// 'Invalid', 'Rolling'</param>
 /// <param name="parameters">List of application parameters with overridden values from their default values specified
 /// in the application manifest.</param>
 /// <param name="rollingUpgradeMode">The mode used to monitor health during a rolling upgrade. The values are
 /// UnmonitoredAuto, UnmonitoredManual, Monitored, and UnmonitoredDeferred. Possible values include: 'Invalid',
 /// 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored', 'UnmonitoredDeferred'</param>
 /// <param name="upgradeReplicaSetCheckTimeoutInSeconds">The maximum amount of time to block processing of an upgrade
 /// domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of
 /// the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each
 /// upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer).</param>
 /// <param name="forceRestart">If true, then processes are forcefully restarted during upgrade even when the code
 /// version has not changed (the upgrade only changes configuration or data).</param>
 /// <param name="sortOrder">Defines the order in which an upgrade proceeds through the cluster. Possible values
 /// include: 'Invalid', 'Default', 'Numeric', 'Lexicographical', 'ReverseNumeric', 'ReverseLexicographical'</param>
 /// <param name="monitoringPolicy">Describes the parameters for monitoring an upgrade in Monitored mode.</param>
 /// <param name="applicationHealthPolicy">Defines a health policy used to evaluate the health of an application or one
 /// of its children entities.
 /// </param>
 /// <param name="instanceCloseDelayDurationInSeconds">Duration in seconds, to wait before a stateless instance is
 /// closed, to allow the active requests to drain gracefully. This would be effective when the instance is closing
 /// during the application/cluster
 /// upgrade, only for those instances which have a non-zero delay duration configured in the service description. See
 /// InstanceCloseDelayDurationSeconds property in $ref: "#/definitions/StatelessServiceDescription.yaml" for details.
 /// Note, the default value of InstanceCloseDelayDurationInSeconds is 4294967295, which indicates that the behavior
 /// will entirely depend on the delay configured in the stateless service description.
 /// </param>
 /// <param name="managedApplicationIdentity">Managed application identity description.</param>
 public ApplicationUpgradeDescription(
     string name,
     string targetApplicationTypeVersion,
     UpgradeKind?upgradeKind = Common.UpgradeKind.Rolling,
     IReadOnlyDictionary <string, string> parameters = default(IReadOnlyDictionary <string, string>),
     UpgradeMode?rollingUpgradeMode = Common.UpgradeMode.UnmonitoredAuto,
     long?upgradeReplicaSetCheckTimeoutInSeconds = default(long?),
     bool?forceRestart          = default(bool?),
     UpgradeSortOrder?sortOrder = Common.UpgradeSortOrder.Default,
     MonitoringPolicyDescription monitoringPolicy    = default(MonitoringPolicyDescription),
     ApplicationHealthPolicy applicationHealthPolicy = default(ApplicationHealthPolicy),
     long?instanceCloseDelayDurationInSeconds        = default(long?),
     ManagedApplicationIdentityDescription managedApplicationIdentity = default(ManagedApplicationIdentityDescription))
 {
     name.ThrowIfNull(nameof(name));
     targetApplicationTypeVersion.ThrowIfNull(nameof(targetApplicationTypeVersion));
     upgradeKind.ThrowIfNull(nameof(upgradeKind));
     this.Name = name;
     this.TargetApplicationTypeVersion = targetApplicationTypeVersion;
     this.UpgradeKind        = upgradeKind;
     this.Parameters         = parameters;
     this.RollingUpgradeMode = rollingUpgradeMode;
     this.UpgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds;
     this.ForceRestart                        = forceRestart;
     this.SortOrder                           = sortOrder;
     this.MonitoringPolicy                    = monitoringPolicy;
     this.ApplicationHealthPolicy             = applicationHealthPolicy;
     this.InstanceCloseDelayDurationInSeconds = instanceCloseDelayDurationInSeconds;
     this.ManagedApplicationIdentity          = managedApplicationIdentity;
 }
 /// <summary>
 /// Initializes a new instance of the ApplicationDescription class.
 /// </summary>
 /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param>
 /// <param name="typeName">The application type name as defined in the application manifest.</param>
 /// <param name="typeVersion">The version of the application type as defined in the application manifest.</param>
 /// <param name="parameters">List of application parameters with overridden values from their default values specified
 /// in the application manifest.</param>
 /// <param name="applicationCapacity">Describes capacity information for services of this application. This description
 /// can be used for describing the following.
 /// - Reserving the capacity for the services on the nodes
 /// - Limiting the total number of nodes that services of this application can run on
 /// - Limiting the custom capacity metrics to limit the total consumption of this metric by the services of this
 /// application
 /// </param>
 /// <param name="managedApplicationIdentity">Managed application identity description.</param>
 public ApplicationDescription(
     ApplicationName name,
     string typeName,
     string typeVersion,
     IReadOnlyDictionary <string, string> parameters    = default(IReadOnlyDictionary <string, string>),
     ApplicationCapacityDescription applicationCapacity = default(ApplicationCapacityDescription),
     ManagedApplicationIdentityDescription managedApplicationIdentity = default(ManagedApplicationIdentityDescription))
 {
     name.ThrowIfNull(nameof(name));
     typeName.ThrowIfNull(nameof(typeName));
     typeVersion.ThrowIfNull(nameof(typeVersion));
     this.Name                       = name;
     this.TypeName                   = typeName;
     this.TypeVersion                = typeVersion;
     this.Parameters                 = parameters;
     this.ApplicationCapacity        = applicationCapacity;
     this.ManagedApplicationIdentity = managedApplicationIdentity;
 }
 /// <summary>
 /// Initializes a new instance of the ApplicationInfo class.
 /// </summary>
 /// <param name="id">The identity of the application. This is an encoded representation of the application name. This
 /// is used in the REST APIs to identify the application resource.
 /// Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the application
 /// name is "fabric:/myapp/app1",
 /// the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in previous versions.
 /// </param>
 /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param>
 /// <param name="typeName">The application type name as defined in the application manifest.</param>
 /// <param name="typeVersion">The version of the application type as defined in the application manifest.</param>
 /// <param name="status">The status of the application.
 /// . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'</param>
 /// <param name="parameters">List of application parameters with overridden values from their default values specified
 /// in the application manifest.</param>
 /// <param name="healthState">The health state of a Service Fabric entity such as Cluster, Node, Application, Service,
 /// Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param>
 /// <param name="applicationDefinitionKind">The mechanism used to define a Service Fabric application.
 /// . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'</param>
 /// <param name="managedApplicationIdentity">Managed application identity description.</param>
 /// <param name="applicationMetadata">Metadata associated with a specific application.</param>
 public ApplicationInfo(
     string id                = default(string),
     ApplicationName name     = default(ApplicationName),
     string typeName          = default(string),
     string typeVersion       = default(string),
     ApplicationStatus?status = default(ApplicationStatus?),
     IReadOnlyDictionary <string, string> parameters = default(IReadOnlyDictionary <string, string>),
     HealthState?healthState = default(HealthState?),
     ApplicationDefinitionKind?applicationDefinitionKind = default(ApplicationDefinitionKind?),
     ManagedApplicationIdentityDescription managedApplicationIdentity = default(ManagedApplicationIdentityDescription),
     ApplicationMetadata applicationMetadata = default(ApplicationMetadata))
 {
     this.Id          = id;
     this.Name        = name;
     this.TypeName    = typeName;
     this.TypeVersion = typeVersion;
     this.Status      = status;
     this.Parameters  = parameters;
     this.HealthState = healthState;
     this.ApplicationDefinitionKind  = applicationDefinitionKind;
     this.ManagedApplicationIdentity = managedApplicationIdentity;
     this.ApplicationMetadata        = applicationMetadata;
 }