internal static DeploymentListResult DeserializeDeploymentListResult(JsonElement element)
        {
            Optional <IReadOnlyList <DeploymentExtendedData> > 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 <DeploymentExtendedData> array = new List <DeploymentExtendedData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DeploymentExtendedData.DeserializeDeploymentExtendedData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new DeploymentListResult(Optional.ToList(value), nextLink.Value));
        }
示例#2
0
 DeploymentExtended IOperationSource <DeploymentExtended> .CreateResult(Response response, CancellationToken cancellationToken)
 {
     using var document = JsonDocument.Parse(response.ContentStream);
     return(new DeploymentExtended(_operationBase, DeploymentExtendedData.DeserializeDeploymentExtendedData(document.RootElement)));
 }