internal SiteAuthSettingsV2(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, string kind, AuthPlatform platform, GlobalValidation globalValidation, IdentityProviders identityProviders, LoginInformation login, HttpSettings httpSettings) : base(id, name, type, systemData, kind)
 {
     Platform          = platform;
     GlobalValidation  = globalValidation;
     IdentityProviders = identityProviders;
     Login             = login;
     HttpSettings      = httpSettings;
 }
Exemple #2
0
        internal static SiteAuthSettingsV2 DeserializeSiteAuthSettingsV2(JsonElement element)
        {
            Optional <string>            kind              = default;
            ResourceIdentifier           id                = default;
            string                       name              = default;
            ResourceType                 type              = default;
            Optional <AuthPlatform>      platform          = default;
            Optional <GlobalValidation>  globalValidation  = default;
            Optional <IdentityProviders> identityProviders = default;
            Optional <LoginInformation>  login             = default;
            Optional <HttpSettings>      httpSettings      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("platform"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            platform = AuthPlatform.DeserializeAuthPlatform(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("globalValidation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            globalValidation = GlobalValidation.DeserializeGlobalValidation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("identityProviders"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            identityProviders = IdentityProviders.DeserializeIdentityProviders(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("login"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            login = LoginInformation.DeserializeLoginInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("httpSettings"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            httpSettings = HttpSettings.DeserializeHttpSettings(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new SiteAuthSettingsV2(id, name, type, kind.Value, platform.Value, globalValidation.Value, identityProviders.Value, login.Value, httpSettings.Value));
        }