Esempio n. 1
0
        public OriginGroupOverrideActionProperties(OriginGroupOverrideActionType actionType, WritableSubResource originGroup)
        {
            if (originGroup == null)
            {
                throw new ArgumentNullException(nameof(originGroup));
            }

            ActionType  = actionType;
            OriginGroup = originGroup;
        }
        public OriginGroupOverrideActionDefinition(OriginGroupOverrideActionType typeDefinition, WritableSubResource originGroup)
        {
            if (originGroup == null)
            {
                throw new ArgumentNullException(nameof(originGroup));
            }

            TypeDefinition = typeDefinition;
            OriginGroup    = originGroup;
        }
Esempio n. 3
0
        internal static OriginGroupOverrideActionProperties DeserializeOriginGroupOverrideActionProperties(JsonElement element)
        {
            OriginGroupOverrideActionType typeName    = default;
            WritableSubResource           originGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new OriginGroupOverrideActionType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("originGroup"))
                {
                    originGroup = JsonSerializer.Deserialize <WritableSubResource>(property.Value.ToString());
                    continue;
                }
            }
            return(new OriginGroupOverrideActionProperties(typeName, originGroup));
        }