Example #1
0
 internal AfdCustomDomainData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, AfdCustomDomainHttpsParameters tlsSettings, WritableSubResource azureDnsZone, AfdProvisioningState?provisioningState, DeploymentStatus?deploymentStatus, DomainValidationState?domainValidationState, string hostName, DomainValidationProperties validationProperties) : base(id, name, type, systemData)
 {
     TlsSettings           = tlsSettings;
     AzureDnsZone          = azureDnsZone;
     ProvisioningState     = provisioningState;
     DeploymentStatus      = deploymentStatus;
     DomainValidationState = domainValidationState;
     HostName             = hostName;
     ValidationProperties = validationProperties;
 }
Example #2
0
        internal static AfdCustomDomainData DeserializeAfdCustomDomainData(JsonElement element)
        {
            ResourceIdentifier id   = default;
            string             name = default;

            Core.ResourceType type        = default;
            SystemData        systemData  = default;
            Optional <string> profileName = default;
            Optional <AfdCustomDomainHttpsParameters> tlsSettings  = default;
            Optional <WritableSubResource>            azureDnsZone = default;
            Optional <AfdDomainUpdatePropertiesParametersPreValidatedCustomDomainResourceId> preValidatedCustomDomainResourceId = default;
            Optional <AfdProvisioningState>  provisioningState     = default;
            Optional <DeploymentStatus>      deploymentStatus      = default;
            Optional <DomainValidationState> domainValidationState = default;
            Optional <string> hostName = default;
            Optional <DomainValidationProperties> validationProperties = 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("profileName"))
                        {
                            profileName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("tlsSettings"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            tlsSettings = AfdCustomDomainHttpsParameters.DeserializeAfdCustomDomainHttpsParameters(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("azureDnsZone"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            azureDnsZone = JsonSerializer.Deserialize <WritableSubResource>(property0.Value.ToString());
                            continue;
                        }
                        if (property0.NameEquals("preValidatedCustomDomainResourceId"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                preValidatedCustomDomainResourceId = null;
                                continue;
                            }
                            preValidatedCustomDomainResourceId = AfdDomainUpdatePropertiesParametersPreValidatedCustomDomainResourceId.DeserializeAfdDomainUpdatePropertiesParametersPreValidatedCustomDomainResourceId(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new AfdProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("deploymentStatus"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            deploymentStatus = new DeploymentStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("domainValidationState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            domainValidationState = new DomainValidationState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("hostName"))
                        {
                            hostName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("validationProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            validationProperties = DomainValidationProperties.DeserializeDomainValidationProperties(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new AfdCustomDomainData(id, name, type, systemData, profileName.Value, tlsSettings.Value, azureDnsZone, preValidatedCustomDomainResourceId.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(deploymentStatus), Optional.ToNullable(domainValidationState), hostName.Value, validationProperties.Value));
        }