Exemple #1
0
        internal static TriggerSubscriptionOperationStatus DeserializeTriggerSubscriptionOperationStatus(JsonElement element)
        {
            Optional <string> triggerName             = default;
            Optional <EventSubscriptionStatus> status = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("triggerName"))
                {
                    triggerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = new EventSubscriptionStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new TriggerSubscriptionOperationStatus(triggerName.Value, Optional.ToNullable(status)));
        }
        internal static TriggerSubscriptionOperationStatus DeserializeTriggerSubscriptionOperationStatus(JsonElement element)
        {
            string triggerName             = default;
            EventSubscriptionStatus?status = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("triggerName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    triggerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    status = new EventSubscriptionStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new TriggerSubscriptionOperationStatus(triggerName, status));
        }