예제 #1
0
        ManagedInstancePrivateEndpointConnection IOperationSource <ManagedInstancePrivateEndpointConnection> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = ManagedInstancePrivateEndpointConnectionData.DeserializeManagedInstancePrivateEndpointConnectionData(document.RootElement);

            return(new ManagedInstancePrivateEndpointConnection(_armClient, data));
        }
        internal static ManagedInstancePrivateEndpointConnectionListResult DeserializeManagedInstancePrivateEndpointConnectionListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ManagedInstancePrivateEndpointConnectionData> > 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 <ManagedInstancePrivateEndpointConnectionData> array = new List <ManagedInstancePrivateEndpointConnectionData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedInstancePrivateEndpointConnectionData.DeserializeManagedInstancePrivateEndpointConnectionData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ManagedInstancePrivateEndpointConnectionListResult(Optional.ToList(value), nextLink.Value));
        }