Esempio n. 1
0
        internal static ManagedInstanceAzureADOnlyAuthListResult DeserializeManagedInstanceAzureADOnlyAuthListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ManagedInstanceAzureADOnlyAuthenticationData> > 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 <ManagedInstanceAzureADOnlyAuthenticationData> array = new List <ManagedInstanceAzureADOnlyAuthenticationData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedInstanceAzureADOnlyAuthenticationData.DeserializeManagedInstanceAzureADOnlyAuthenticationData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ManagedInstanceAzureADOnlyAuthListResult(Optional.ToList(value), nextLink.Value));
        }
Esempio n. 2
0
        ManagedInstanceAzureADOnlyAuthentication IOperationSource <ManagedInstanceAzureADOnlyAuthentication> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = ManagedInstanceAzureADOnlyAuthenticationData.DeserializeManagedInstanceAzureADOnlyAuthenticationData(document.RootElement);

            return(new ManagedInstanceAzureADOnlyAuthentication(_armClient, data));
        }