/// <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 NodeDeactivationTask GetFromJsonProperties(JsonReader reader)
        {
            var nodeDeactivationTaskId = default(NodeDeactivationTaskId);
            var nodeDeactivationIntent = default(NodeDeactivationIntent?);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("NodeDeactivationTaskId", propName, StringComparison.Ordinal) == 0)
                {
                    nodeDeactivationTaskId = NodeDeactivationTaskIdConverter.Deserialize(reader);
                }
                else if (string.Compare("NodeDeactivationIntent", propName, StringComparison.Ordinal) == 0)
                {
                    nodeDeactivationIntent = NodeDeactivationIntentConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new NodeDeactivationTask(
                       nodeDeactivationTaskId: nodeDeactivationTaskId,
                       nodeDeactivationIntent: nodeDeactivationIntent));
        }
Пример #2
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 NodeDeactivationInfo GetFromJsonProperties(JsonReader reader)
        {
            var nodeDeactivationIntent = default(NodeDeactivationIntent?);
            var nodeDeactivationStatus = default(NodeDeactivationStatus?);
            var nodeDeactivationTask   = default(IEnumerable <NodeDeactivationTask>);
            var pendingSafetyChecks    = default(IEnumerable <SafetyCheckWrapper>);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("NodeDeactivationIntent", propName, StringComparison.Ordinal) == 0)
                {
                    nodeDeactivationIntent = NodeDeactivationIntentConverter.Deserialize(reader);
                }
                else if (string.Compare("NodeDeactivationStatus", propName, StringComparison.Ordinal) == 0)
                {
                    nodeDeactivationStatus = NodeDeactivationStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("NodeDeactivationTask", propName, StringComparison.Ordinal) == 0)
                {
                    nodeDeactivationTask = reader.ReadList(NodeDeactivationTaskConverter.Deserialize);
                }
                else if (string.Compare("PendingSafetyChecks", propName, StringComparison.Ordinal) == 0)
                {
                    pendingSafetyChecks = reader.ReadList(SafetyCheckWrapperConverter.Deserialize);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new NodeDeactivationInfo(
                       nodeDeactivationIntent: nodeDeactivationIntent,
                       nodeDeactivationStatus: nodeDeactivationStatus,
                       nodeDeactivationTask: nodeDeactivationTask,
                       pendingSafetyChecks: pendingSafetyChecks));
        }