CloudService IOperationSource <CloudService> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = CloudServiceData.DeserializeCloudServiceData(document.RootElement);

            return(new CloudService(_operationBase, data));
        }
        internal static CloudServiceListResult DeserializeCloudServiceListResult(JsonElement element)
        {
            IReadOnlyList <CloudServiceData> value = default;
            Optional <string> nextLink             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <CloudServiceData> array = new List <CloudServiceData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(CloudServiceData.DeserializeCloudServiceData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new CloudServiceListResult(value, nextLink.Value));
        }