コード例 #1
0
        internal static AfdCustomDomainListResult DeserializeAfdCustomDomainListResult(JsonElement element)
        {
            Optional <IReadOnlyList <AfdCustomDomainData> > 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 <AfdCustomDomainData> array = new List <AfdCustomDomainData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AfdCustomDomainData.DeserializeAfdCustomDomainData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new AfdCustomDomainListResult(Optional.ToList(value), nextLink.Value));
        }
コード例 #2
0
        protected async Task <AfdCustomDomain> CreateAfdCustomDomain(Profile profile, string customDomainName, string hostName)
        {
            AfdCustomDomainData input = ResourceDataHelper.CreateAfdCustomDomainData(hostName);
            var lro = await profile.GetAfdCustomDomains().CreateOrUpdateAsync(true, customDomainName, input);

            return(lro.Value);
        }
コード例 #3
0
        AfdCustomDomain IOperationSource <AfdCustomDomain> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = AfdCustomDomainData.DeserializeAfdCustomDomainData(document.RootElement);

            return(new AfdCustomDomain(_operationBase, data));
        }