internal GoogleProvider(bool?enabled, ClientRegistration registration, LoginScopes login, AllowedAudiencesValidation validation) { Enabled = enabled; Registration = registration; Login = login; Validation = validation; }
internal static GoogleProvider DeserializeGoogleProvider(JsonElement element) { Optional <bool> enabled = default; Optional <ClientRegistration> registration = default; Optional <LoginScopes> login = default; Optional <AllowedAudiencesValidation> validation = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("enabled")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } enabled = property.Value.GetBoolean(); continue; } if (property.NameEquals("registration")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } registration = ClientRegistration.DeserializeClientRegistration(property.Value); continue; } if (property.NameEquals("login")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } login = Models.LoginScopes.DeserializeLoginScopes(property.Value); continue; } if (property.NameEquals("validation")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } validation = AllowedAudiencesValidation.DeserializeAllowedAudiencesValidation(property.Value); continue; } } return(new GoogleProvider(Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value)); }