Beispiel #1
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatelessServiceUpdateDescription GetFromJsonProperties(JsonReader reader)
        {
            var flags = default(string);
            var placementConstraints     = default(string);
            var correlationScheme        = default(IEnumerable <ServiceCorrelationDescription>);
            var loadMetrics              = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost          = default(MoveCost?);
            var scalingPolicies          = default(IEnumerable <ScalingPolicyDescription>);
            var instanceCount            = default(int?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Flags", propName, StringComparison.Ordinal) == 0)
                {
                    flags = reader.ReadValueAsString();
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.Ordinal) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.Ordinal) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("LoadMetrics", propName, StringComparison.Ordinal) == 0)
                {
                    loadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.Ordinal) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("InstanceCount", propName, StringComparison.Ordinal) == 0)
                {
                    instanceCount = reader.ReadValueAsInt();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatelessServiceUpdateDescription(
                       flags: flags,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       loadMetrics: loadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       scalingPolicies: scalingPolicies,
                       instanceCount: instanceCount));
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatelessServiceDescription GetFromJsonProperties(JsonReader reader)
        {
            var applicationName              = default(ApplicationName);
            var serviceName                  = default(ServiceName);
            var serviceTypeName              = default(string);
            var initializationData           = default(byte[]);
            var partitionDescription         = default(PartitionSchemeDescription);
            var placementConstraints         = default(string);
            var correlationScheme            = default(IEnumerable <ServiceCorrelationDescription>);
            var serviceLoadMetrics           = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies     = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost              = default(MoveCost?);
            var isDefaultMoveCostSpecified   = default(bool?);
            var servicePackageActivationMode = default(ServicePackageActivationMode?);
            var serviceDnsName               = default(string);
            var scalingPolicies              = default(IEnumerable <ScalingPolicyDescription>);
            var instanceCount                = default(int?);
            var minInstanceCount             = default(int?);
            var minInstancePercentage        = default(int?);
            var flags = default(int?);
            var instanceCloseDelayDurationSeconds = default(long?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("ApplicationName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    applicationName = ApplicationNameConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceName = ServiceNameConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceTypeName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceTypeName = reader.ReadValueAsString();
                }
                else if (string.Compare("InitializationData", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    initializationData = ByteArrayConverter.Deserialize(reader);
                }
                else if (string.Compare("PartitionDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    partitionDescription = PartitionSchemeDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServiceLoadMetrics", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceLoadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("IsDefaultMoveCostSpecified", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    isDefaultMoveCostSpecified = reader.ReadValueAsBool();
                }
                else if (string.Compare("ServicePackageActivationMode", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePackageActivationMode = ServicePackageActivationModeConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceDnsName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceDnsName = reader.ReadValueAsString();
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("InstanceCount", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinInstanceCount", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minInstanceCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinInstancePercentage", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minInstancePercentage = reader.ReadValueAsInt();
                }
                else if (string.Compare("Flags", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    flags = reader.ReadValueAsInt();
                }
                else if (string.Compare("InstanceCloseDelayDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceCloseDelayDurationSeconds = reader.ReadValueAsLong();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatelessServiceDescription(
                       applicationName: applicationName,
                       serviceName: serviceName,
                       serviceTypeName: serviceTypeName,
                       initializationData: initializationData,
                       partitionDescription: partitionDescription,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       serviceLoadMetrics: serviceLoadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       isDefaultMoveCostSpecified: isDefaultMoveCostSpecified,
                       servicePackageActivationMode: servicePackageActivationMode,
                       serviceDnsName: serviceDnsName,
                       scalingPolicies: scalingPolicies,
                       instanceCount: instanceCount,
                       minInstanceCount: minInstanceCount,
                       minInstancePercentage: minInstancePercentage,
                       flags: flags,
                       instanceCloseDelayDurationSeconds: instanceCloseDelayDurationSeconds));
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatefulServiceUpdateDescription GetFromJsonProperties(JsonReader reader)
        {
            var flags = default(string);
            var placementConstraints              = default(string);
            var correlationScheme                 = default(IEnumerable <ServiceCorrelationDescription>);
            var loadMetrics                       = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies          = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost                   = default(MoveCost?);
            var scalingPolicies                   = default(IEnumerable <ScalingPolicyDescription>);
            var targetReplicaSetSize              = default(int?);
            var minReplicaSetSize                 = default(int?);
            var replicaRestartWaitDurationSeconds = default(string);
            var quorumLossWaitDurationSeconds     = default(string);
            var standByReplicaKeepDurationSeconds = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Flags", propName, StringComparison.Ordinal) == 0)
                {
                    flags = reader.ReadValueAsString();
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.Ordinal) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.Ordinal) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("LoadMetrics", propName, StringComparison.Ordinal) == 0)
                {
                    loadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.Ordinal) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("TargetReplicaSetSize", propName, StringComparison.Ordinal) == 0)
                {
                    targetReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinReplicaSetSize", propName, StringComparison.Ordinal) == 0)
                {
                    minReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("ReplicaRestartWaitDurationSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    replicaRestartWaitDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("QuorumLossWaitDurationSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    quorumLossWaitDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("StandByReplicaKeepDurationSeconds", propName, StringComparison.Ordinal) == 0)
                {
                    standByReplicaKeepDurationSeconds = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatefulServiceUpdateDescription(
                       flags: flags,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       loadMetrics: loadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       scalingPolicies: scalingPolicies,
                       targetReplicaSetSize: targetReplicaSetSize,
                       minReplicaSetSize: minReplicaSetSize,
                       replicaRestartWaitDurationSeconds: replicaRestartWaitDurationSeconds,
                       quorumLossWaitDurationSeconds: quorumLossWaitDurationSeconds,
                       standByReplicaKeepDurationSeconds: standByReplicaKeepDurationSeconds));
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatefulServiceDescription GetFromJsonProperties(JsonReader reader)
        {
            var applicationName              = default(ApplicationName);
            var serviceName                  = default(ServiceName);
            var serviceTypeName              = default(string);
            var initializationData           = default(byte[]);
            var partitionDescription         = default(PartitionSchemeDescription);
            var placementConstraints         = default(string);
            var correlationScheme            = default(IEnumerable <ServiceCorrelationDescription>);
            var serviceLoadMetrics           = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies     = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost              = default(MoveCost?);
            var isDefaultMoveCostSpecified   = default(bool?);
            var servicePackageActivationMode = default(ServicePackageActivationMode?);
            var serviceDnsName               = default(string);
            var scalingPolicies              = default(IEnumerable <ScalingPolicyDescription>);
            var targetReplicaSetSize         = default(int?);
            var minReplicaSetSize            = default(int?);
            var hasPersistedState            = default(bool?);
            var flags = default(int?);
            var replicaRestartWaitDurationSeconds = default(long?);
            var quorumLossWaitDurationSeconds     = default(long?);
            var standByReplicaKeepDurationSeconds = default(long?);
            var servicePlacementTimeLimitSeconds  = default(long?);
            var dropSourceReplicaOnMove           = default(bool?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("ApplicationName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    applicationName = ApplicationNameConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceName = ServiceNameConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceTypeName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceTypeName = reader.ReadValueAsString();
                }
                else if (string.Compare("InitializationData", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    initializationData = ByteArrayConverter.Deserialize(reader);
                }
                else if (string.Compare("PartitionDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    partitionDescription = PartitionSchemeDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServiceLoadMetrics", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceLoadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("IsDefaultMoveCostSpecified", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    isDefaultMoveCostSpecified = reader.ReadValueAsBool();
                }
                else if (string.Compare("ServicePackageActivationMode", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePackageActivationMode = ServicePackageActivationModeConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceDnsName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceDnsName = reader.ReadValueAsString();
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("TargetReplicaSetSize", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    targetReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinReplicaSetSize", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("HasPersistedState", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    hasPersistedState = reader.ReadValueAsBool();
                }
                else if (string.Compare("Flags", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    flags = reader.ReadValueAsInt();
                }
                else if (string.Compare("ReplicaRestartWaitDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    replicaRestartWaitDurationSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("QuorumLossWaitDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    quorumLossWaitDurationSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("StandByReplicaKeepDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    standByReplicaKeepDurationSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("ServicePlacementTimeLimitSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementTimeLimitSeconds = reader.ReadValueAsLong();
                }
                else if (string.Compare("DropSourceReplicaOnMove", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    dropSourceReplicaOnMove = reader.ReadValueAsBool();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatefulServiceDescription(
                       applicationName: applicationName,
                       serviceName: serviceName,
                       serviceTypeName: serviceTypeName,
                       initializationData: initializationData,
                       partitionDescription: partitionDescription,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       serviceLoadMetrics: serviceLoadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       isDefaultMoveCostSpecified: isDefaultMoveCostSpecified,
                       servicePackageActivationMode: servicePackageActivationMode,
                       serviceDnsName: serviceDnsName,
                       scalingPolicies: scalingPolicies,
                       targetReplicaSetSize: targetReplicaSetSize,
                       minReplicaSetSize: minReplicaSetSize,
                       hasPersistedState: hasPersistedState,
                       flags: flags,
                       replicaRestartWaitDurationSeconds: replicaRestartWaitDurationSeconds,
                       quorumLossWaitDurationSeconds: quorumLossWaitDurationSeconds,
                       standByReplicaKeepDurationSeconds: standByReplicaKeepDurationSeconds,
                       servicePlacementTimeLimitSeconds: servicePlacementTimeLimitSeconds,
                       dropSourceReplicaOnMove: dropSourceReplicaOnMove));
        }
Beispiel #5
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatefulServiceUpdateDescription GetFromJsonProperties(JsonReader reader)
        {
            var flags = default(string);
            var placementConstraints              = default(string);
            var correlationScheme                 = default(IEnumerable <ServiceCorrelationDescription>);
            var loadMetrics                       = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies          = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost                   = default(MoveCost?);
            var scalingPolicies                   = default(IEnumerable <ScalingPolicyDescription>);
            var serviceDnsName                    = default(string);
            var tagsForPlacement                  = default(NodeTagsDescription);
            var tagsForRunning                    = default(NodeTagsDescription);
            var targetReplicaSetSize              = default(int?);
            var minReplicaSetSize                 = default(int?);
            var replicaRestartWaitDurationSeconds = default(string);
            var quorumLossWaitDurationSeconds     = default(string);
            var standByReplicaKeepDurationSeconds = default(string);
            var servicePlacementTimeLimitSeconds  = default(string);
            var dropSourceReplicaOnMove           = default(bool?);
            var replicaLifecycleDescription       = default(ReplicaLifecycleDescription);
            var auxiliaryReplicaCount             = default(int?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Flags", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    flags = reader.ReadValueAsString();
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("LoadMetrics", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    loadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServiceDnsName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceDnsName = reader.ReadValueAsString();
                }
                else if (string.Compare("TagsForPlacement", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    tagsForPlacement = NodeTagsDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("TagsForRunning", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    tagsForRunning = NodeTagsDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("TargetReplicaSetSize", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    targetReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinReplicaSetSize", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minReplicaSetSize = reader.ReadValueAsInt();
                }
                else if (string.Compare("ReplicaRestartWaitDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    replicaRestartWaitDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("QuorumLossWaitDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    quorumLossWaitDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("StandByReplicaKeepDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    standByReplicaKeepDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("ServicePlacementTimeLimitSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementTimeLimitSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("DropSourceReplicaOnMove", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    dropSourceReplicaOnMove = reader.ReadValueAsBool();
                }
                else if (string.Compare("ReplicaLifecycleDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    replicaLifecycleDescription = ReplicaLifecycleDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("AuxiliaryReplicaCount", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    auxiliaryReplicaCount = reader.ReadValueAsInt();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatefulServiceUpdateDescription(
                       flags: flags,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       loadMetrics: loadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       scalingPolicies: scalingPolicies,
                       serviceDnsName: serviceDnsName,
                       tagsForPlacement: tagsForPlacement,
                       tagsForRunning: tagsForRunning,
                       targetReplicaSetSize: targetReplicaSetSize,
                       minReplicaSetSize: minReplicaSetSize,
                       replicaRestartWaitDurationSeconds: replicaRestartWaitDurationSeconds,
                       quorumLossWaitDurationSeconds: quorumLossWaitDurationSeconds,
                       standByReplicaKeepDurationSeconds: standByReplicaKeepDurationSeconds,
                       servicePlacementTimeLimitSeconds: servicePlacementTimeLimitSeconds,
                       dropSourceReplicaOnMove: dropSourceReplicaOnMove,
                       replicaLifecycleDescription: replicaLifecycleDescription,
                       auxiliaryReplicaCount: auxiliaryReplicaCount));
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static StatelessServiceUpdateDescription GetFromJsonProperties(JsonReader reader)
        {
            var flags = default(string);
            var placementConstraints               = default(string);
            var correlationScheme                  = default(IEnumerable <ServiceCorrelationDescription>);
            var loadMetrics                        = default(IEnumerable <ServiceLoadMetricDescription>);
            var servicePlacementPolicies           = default(IEnumerable <ServicePlacementPolicyDescription>);
            var defaultMoveCost                    = default(MoveCost?);
            var scalingPolicies                    = default(IEnumerable <ScalingPolicyDescription>);
            var serviceDnsName                     = default(string);
            var tagsForPlacement                   = default(NodeTagsDescription);
            var tagsForRunning                     = default(NodeTagsDescription);
            var instanceCount                      = default(int?);
            var minInstanceCount                   = default(int?);
            var minInstancePercentage              = default(int?);
            var instanceCloseDelayDurationSeconds  = default(string);
            var instanceLifecycleDescription       = default(InstanceLifecycleDescription);
            var instanceRestartWaitDurationSeconds = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("Flags", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    flags = reader.ReadValueAsString();
                }
                else if (string.Compare("PlacementConstraints", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    placementConstraints = reader.ReadValueAsString();
                }
                else if (string.Compare("CorrelationScheme", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    correlationScheme = reader.ReadList(ServiceCorrelationDescriptionConverter.Deserialize);
                }
                else if (string.Compare("LoadMetrics", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    loadMetrics = reader.ReadList(ServiceLoadMetricDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServicePlacementPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    servicePlacementPolicies = reader.ReadList(ServicePlacementPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("DefaultMoveCost", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    defaultMoveCost = MoveCostConverter.Deserialize(reader);
                }
                else if (string.Compare("ScalingPolicies", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    scalingPolicies = reader.ReadList(ScalingPolicyDescriptionConverter.Deserialize);
                }
                else if (string.Compare("ServiceDnsName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceDnsName = reader.ReadValueAsString();
                }
                else if (string.Compare("TagsForPlacement", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    tagsForPlacement = NodeTagsDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("TagsForRunning", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    tagsForRunning = NodeTagsDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("InstanceCount", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinInstanceCount", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minInstanceCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("MinInstancePercentage", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    minInstancePercentage = reader.ReadValueAsInt();
                }
                else if (string.Compare("InstanceCloseDelayDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceCloseDelayDurationSeconds = reader.ReadValueAsString();
                }
                else if (string.Compare("InstanceLifecycleDescription", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceLifecycleDescription = InstanceLifecycleDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("InstanceRestartWaitDurationSeconds", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    instanceRestartWaitDurationSeconds = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new StatelessServiceUpdateDescription(
                       flags: flags,
                       placementConstraints: placementConstraints,
                       correlationScheme: correlationScheme,
                       loadMetrics: loadMetrics,
                       servicePlacementPolicies: servicePlacementPolicies,
                       defaultMoveCost: defaultMoveCost,
                       scalingPolicies: scalingPolicies,
                       serviceDnsName: serviceDnsName,
                       tagsForPlacement: tagsForPlacement,
                       tagsForRunning: tagsForRunning,
                       instanceCount: instanceCount,
                       minInstanceCount: minInstanceCount,
                       minInstancePercentage: minInstancePercentage,
                       instanceCloseDelayDurationSeconds: instanceCloseDelayDurationSeconds,
                       instanceLifecycleDescription: instanceLifecycleDescription,
                       instanceRestartWaitDurationSeconds: instanceRestartWaitDurationSeconds));
        }