HubIpConfiguration IOperationSource <HubIpConfiguration> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = HubIpConfigurationData.DeserializeHubIpConfigurationData(document.RootElement);

            return(new HubIpConfiguration(_armClient, data));
        }
예제 #2
0
        internal static ListVirtualHubIpConfigurationResults DeserializeListVirtualHubIpConfigurationResults(JsonElement element)
        {
            Optional <IReadOnlyList <HubIpConfigurationData> > 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 <HubIpConfigurationData> array = new List <HubIpConfigurationData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(HubIpConfigurationData.DeserializeHubIpConfigurationData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ListVirtualHubIpConfigurationResults(Optional.ToList(value), nextLink.Value));
        }