/// <summary> /// To convert a JSON string into an object /// </summary> /// <param name="reader">JSON reader</param> /// <param name="objectType">Object type</param> /// <param name="existingValue">Existing value</param> /// <param name="serializer">JSON Serializer</param> /// <returns>The object converted from the JSON string</returns> public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.Null) { return(KratosUiNodeInputAttributesValue.FromJson(JObject.Load(reader).ToString(Formatting.None))); } return(null); }
/// <summary> /// Initializes a new instance of the <see cref="KratosUiNodeInputAttributes" /> class. /// </summary> /// <param name="disabled">Sets the input's disabled field to true or false. (required).</param> /// <param name="label">label.</param> /// <param name="name">The input's element name. (required).</param> /// <param name="pattern">The input's pattern..</param> /// <param name="required">Mark this input field as required..</param> /// <param name="type">type (required).</param> /// <param name="value">value.</param> public KratosUiNodeInputAttributes(bool disabled = default(bool), KratosUiText label = default(KratosUiText), string name = default(string), string pattern = default(string), bool required = default(bool), string type = default(string), KratosUiNodeInputAttributesValue value = default(KratosUiNodeInputAttributesValue)) { this.Disabled = disabled; // to ensure "name" is required (not null) this.Name = name ?? throw new ArgumentNullException("name is a required property for KratosUiNodeInputAttributes and cannot be null"); // to ensure "type" is required (not null) this.Type = type ?? throw new ArgumentNullException("type is a required property for KratosUiNodeInputAttributes and cannot be null"); this.Label = label; this.Pattern = pattern; this.Required = required; this.Value = value; this.AdditionalProperties = new Dictionary <string, object>(); }