public ScheduleTrigger(ScheduleTriggerRecurrence recurrence)
        {
            if (recurrence == null)
            {
                throw new ArgumentNullException(nameof(recurrence));
            }

            Recurrence = recurrence;
            Type       = "ScheduleTrigger";
        }
 internal ScheduleTrigger(string type, string description, TriggerRuntimeState?runtimeState, IList <object> annotations, IDictionary <string, object> additionalProperties, IList <TriggerPipelineReference> pipelines, ScheduleTriggerRecurrence recurrence) : base(type, description, runtimeState, annotations, additionalProperties, pipelines)
 {
     Recurrence = recurrence;
     Type       = type ?? "ScheduleTrigger";
 }
Example #3
0
        internal static ScheduleTrigger DeserializeScheduleTrigger(JsonElement element)
        {
            Optional <IList <TriggerPipelineReference> > pipelines = default;
            string            type        = default;
            Optional <string> description = default;
            Optional <TriggerRuntimeState> runtimeState                   = default;
            Optional <IList <object> >     annotations                    = default;
            ScheduleTriggerRecurrence      recurrence                     = default;
            IDictionary <string, object>   additionalProperties           = default;
            Dictionary <string, object>    additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("pipelines"))
                {
                    List <TriggerPipelineReference> array = new List <TriggerPipelineReference>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TriggerPipelineReference.DeserializeTriggerPipelineReference(item));
                    }
                    pipelines = array;
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("runtimeState"))
                {
                    runtimeState = new TriggerRuntimeState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("annotations"))
                {
                    List <object> array = new List <object>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetObject());
                    }
                    annotations = array;
                    continue;
                }
                if (property.NameEquals("typeProperties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("recurrence"))
                        {
                            recurrence = ScheduleTriggerRecurrence.DeserializeScheduleTriggerRecurrence(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new ScheduleTrigger(type, description.Value, Optional.ToNullable(runtimeState), Optional.ToList(annotations), additionalProperties, Optional.ToList(pipelines), recurrence));
        }