Exemplo n.º 1
0
        ServerDnsAlias IOperationSource <ServerDnsAlias> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = ServerDnsAliasData.DeserializeServerDnsAliasData(document.RootElement);

            return(new ServerDnsAlias(_armClient, data));
        }
Exemplo n.º 2
0
        internal static ServerDnsAliasListResult DeserializeServerDnsAliasListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ServerDnsAliasData> > 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 <ServerDnsAliasData> array = new List <ServerDnsAliasData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ServerDnsAliasData.DeserializeServerDnsAliasData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ServerDnsAliasListResult(Optional.ToList(value), nextLink.Value));
        }