예제 #1
0
        /// <summary>
        /// Returns a JSON representation of this instance.
        /// </summary>
        /// <returns>JObject</returns>
        public SetType(dynamic data)
            : base((object)data)
        {
            if (data == null)
            {
                return;
            }

            this.ElementType = FieldTypeFactory.Create(data);
        }
예제 #2
0
        /// <summary>
        /// Initializes this instance with JSON data from an API response.
        /// </summary>
        /// <param name="data">JSON object</param>
        public FieldDefinition(dynamic data)
        {
            if (data == null)
            {
                return;
            }

            TextInputHint?inputHint;

            this.Type      = FieldTypeFactory.Create(data.type);
            this.Name      = data.name;
            this.Label     = new LocalizedString(data.label);
            this.Required  = data.required;
            this.InputHint = Helper.TryGetEnumByEnumMemberAttribute <TextInputHint?>((string)data.inputHint, out inputHint) ? inputHint : null;
        }