internal StaticSiteARMResourceData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string kind, SkuDescription sku, ManagedServiceIdentity identity, string defaultHostname, string repositoryUrl, string branch, IReadOnlyList <string> customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList <ResponseMessageEnvelopeRemotePrivateEndpointConnection> privateEndpointConnections, StagingEnvironmentPolicy?stagingEnvironmentPolicy, bool?allowConfigFileUpdates, StaticSiteTemplateOptions templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList <Models.StaticSiteUserProvidedFunctionApp> userProvidedFunctionApps, string provider) : base(id, name, type, systemData, tags, location, kind)
 {
     Sku                         = sku;
     Identity                    = identity;
     DefaultHostname             = defaultHostname;
     RepositoryUrl               = repositoryUrl;
     Branch                      = branch;
     CustomDomains               = customDomains;
     RepositoryToken             = repositoryToken;
     BuildProperties             = buildProperties;
     PrivateEndpointConnections  = privateEndpointConnections;
     StagingEnvironmentPolicy    = stagingEnvironmentPolicy;
     AllowConfigFileUpdates      = allowConfigFileUpdates;
     TemplateProperties          = templateProperties;
     ContentDistributionEndpoint = contentDistributionEndpoint;
     KeyVaultReferenceIdentity   = keyVaultReferenceIdentity;
     UserProvidedFunctionApps    = userProvidedFunctionApps;
     Provider                    = provider;
 }
        internal static StaticSiteARMResourceData DeserializeStaticSiteARMResourceData(JsonElement element)
        {
            Optional <SkuDescription>         sku      = default;
            Optional <ManagedServiceIdentity> identity = default;
            Optional <string>            kind          = default;
            IDictionary <string, string> tags          = default;
            Location           location        = default;
            ResourceIdentifier id              = default;
            string             name            = default;
            ResourceType       type            = default;
            Optional <string>  defaultHostname = default;
            Optional <string>  repositoryUrl   = default;
            Optional <string>  branch          = default;
            Optional <IReadOnlyList <string> > customDomains = default;
            Optional <string> repositoryToken = default;
            Optional <StaticSiteBuildProperties> buildProperties = default;
            Optional <IReadOnlyList <ResponseMessageEnvelopeRemotePrivateEndpointConnection> > privateEndpointConnections = default;
            Optional <StagingEnvironmentPolicy> stagingEnvironmentPolicy = default;
            Optional <bool> allowConfigFileUpdates = default;
            Optional <StaticSiteTemplateOptions> templateProperties = default;
            Optional <string> contentDistributionEndpoint           = default;
            Optional <string> keyVaultReferenceIdentity             = default;
            Optional <IReadOnlyList <Models.StaticSiteUserProvidedFunctionApp> > userProvidedFunctionApps = default;
            Optional <string> provider = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = SkuDescription.DeserializeSkuDescription(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = 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("defaultHostname"))
                        {
                            defaultHostname = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("repositoryUrl"))
                        {
                            repositoryUrl = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("branch"))
                        {
                            branch = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("customDomains"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(item.GetString());
                            }
                            customDomains = array;
                            continue;
                        }
                        if (property0.NameEquals("repositoryToken"))
                        {
                            repositoryToken = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("buildProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("privateEndpointConnections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ResponseMessageEnvelopeRemotePrivateEndpointConnection> array = new List <ResponseMessageEnvelopeRemotePrivateEndpointConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ResponseMessageEnvelopeRemotePrivateEndpointConnection.DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(item));
                            }
                            privateEndpointConnections = array;
                            continue;
                        }
                        if (property0.NameEquals("stagingEnvironmentPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            stagingEnvironmentPolicy = property0.Value.GetString().ToStagingEnvironmentPolicy();
                            continue;
                        }
                        if (property0.NameEquals("allowConfigFileUpdates"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            allowConfigFileUpdates = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("templateProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            templateProperties = StaticSiteTemplateOptions.DeserializeStaticSiteTemplateOptions(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("contentDistributionEndpoint"))
                        {
                            contentDistributionEndpoint = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("keyVaultReferenceIdentity"))
                        {
                            keyVaultReferenceIdentity = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("userProvidedFunctionApps"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <Models.StaticSiteUserProvidedFunctionApp> array = new List <Models.StaticSiteUserProvidedFunctionApp>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(Models.StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item));
                            }
                            userProvidedFunctionApps = array;
                            continue;
                        }
                        if (property0.NameEquals("provider"))
                        {
                            provider = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new StaticSiteARMResourceData(id, name, type, tags, location, kind.Value, sku.Value, identity.Value, defaultHostname.Value, repositoryUrl.Value, branch.Value, Optional.ToList(customDomains), repositoryToken.Value, buildProperties.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(stagingEnvironmentPolicy), Optional.ToNullable(allowConfigFileUpdates), templateProperties.Value, contentDistributionEndpoint.Value, keyVaultReferenceIdentity.Value, Optional.ToList(userProvidedFunctionApps), provider.Value));
        }