Esempio n. 1
0
        InstanceFailoverGroup IOperationSource <InstanceFailoverGroup> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = InstanceFailoverGroupData.DeserializeInstanceFailoverGroupData(document.RootElement);

            return(new InstanceFailoverGroup(_armClient, data));
        }
Esempio n. 2
0
        internal static InstanceFailoverGroupListResult DeserializeInstanceFailoverGroupListResult(JsonElement element)
        {
            Optional <IReadOnlyList <InstanceFailoverGroupData> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <InstanceFailoverGroupData> array = new List <InstanceFailoverGroupData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(InstanceFailoverGroupData.DeserializeInstanceFailoverGroupData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new InstanceFailoverGroupListResult(Optional.ToList(value), nextLink.Value));
        }