Esempio n. 1
0
        internal static PrivateLinkServiceConnectionState DeserializePrivateLinkServiceConnectionState(JsonElement element)
        {
            Optional <PrivateEndpointServiceConnectionStatus> status = default;
            Optional <string> description    = default;
            Optional <string> actionRequired = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = new PrivateEndpointServiceConnectionStatus(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("actionRequired"))
                {
                    actionRequired = property.Value.GetString();
                    continue;
                }
            }
            return(new PrivateLinkServiceConnectionState(Optional.ToNullable(status), description.Value, actionRequired.Value));
        }
        internal static PrivateLinkServiceConnectionState DeserializePrivateLinkServiceConnectionState(JsonElement element)
        {
            PrivateEndpointServiceConnectionStatus?status = default;
            string description    = default;
            string actionRequired = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    status = new PrivateEndpointServiceConnectionStatus(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("actionRequired"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    actionRequired = property.Value.GetString();
                    continue;
                }
            }
            return(new PrivateLinkServiceConnectionState(status, description, actionRequired));
        }