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

            foreach (var property in element.EnumerateObject())
            {
                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("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    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 = ContainerAppLogin.DeserializeContainerAppLogin(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 AuthConfigData(id, name, type, systemData, platform.Value, globalValidation.Value, identityProviders.Value, login.Value, httpSettings.Value));
        }