internal static HeaderActionDefinition DeserializeHeaderActionDefinition(JsonElement element)
        {
            HeaderActionType  typeName     = default;
            HeaderAction      headerAction = default;
            string            headerName   = default;
            Optional <string> value        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new HeaderActionType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("headerAction"))
                {
                    headerAction = new HeaderAction(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("headerName"))
                {
                    headerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    value = property.Value.GetString();
                    continue;
                }
            }
            return(new HeaderActionDefinition(typeName, headerAction, headerName, value.Value));
        }
 internal HeaderActionDefinition(HeaderActionType typeDefinition, HeaderAction headerAction, string headerName, string value)
 {
     TypeDefinition = typeDefinition;
     HeaderAction   = headerAction;
     HeaderName     = headerName;
     Value          = value;
 }
Esempio n. 3
0
 internal HeaderActionProperties(HeaderActionType actionType, HeaderAction headerAction, string headerName, string value)
 {
     ActionType   = actionType;
     HeaderAction = headerAction;
     HeaderName   = headerName;
     Value        = value;
 }
        public HeaderActionDefinition(HeaderActionType typeDefinition, HeaderAction headerAction, string headerName)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException(nameof(headerName));
            }

            TypeDefinition = typeDefinition;
            HeaderAction   = headerAction;
            HeaderName     = headerName;
        }
Esempio n. 5
0
        public HeaderActionProperties(HeaderActionType actionType, HeaderAction headerAction, string headerName)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException(nameof(headerName));
            }

            ActionType   = actionType;
            HeaderAction = headerAction;
            HeaderName   = headerName;
        }