コード例 #1
0
 internal ManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, EnvironmentProvisioningState?provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, VnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, string staticIP, AppLogsConfiguration appLogsConfiguration, bool?zoneRedundant) : base(id, name, resourceType, systemData, tags, location)
 {
     ProvisioningState        = provisioningState;
     DaprAIInstrumentationKey = daprAIInstrumentationKey;
     DaprAIConnectionString   = daprAIConnectionString;
     VnetConfiguration        = vnetConfiguration;
     DeploymentErrors         = deploymentErrors;
     DefaultDomain            = defaultDomain;
     StaticIP             = staticIP;
     AppLogsConfiguration = appLogsConfiguration;
     ZoneRedundant        = zoneRedundant;
 }
コード例 #2
0
        internal static ManagedEnvironmentData DeserializeManagedEnvironmentData(JsonElement element)
        {
            IDictionary <string, string> tags = default;
            AzureLocation      location       = default;
            ResourceIdentifier id             = default;
            string             name           = default;
            ResourceType       type           = default;
            SystemData         systemData     = default;
            Optional <EnvironmentProvisioningState> provisioningState = default;
            Optional <string>               daprAIInstrumentationKey  = default;
            Optional <string>               daprAIConnectionString    = default;
            Optional <VnetConfiguration>    vnetConfiguration         = default;
            Optional <string>               deploymentErrors          = default;
            Optional <string>               defaultDomain             = default;
            Optional <string>               staticIp             = default;
            Optional <AppLogsConfiguration> appLogsConfiguration = default;
            Optional <bool> zoneRedundant = default;

            foreach (var property in element.EnumerateObject())
            {
                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 = new AzureLocation(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 = new ResourceType(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("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new EnvironmentProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("daprAIInstrumentationKey"))
                        {
                            daprAIInstrumentationKey = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("daprAIConnectionString"))
                        {
                            daprAIConnectionString = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("vnetConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            vnetConfiguration = VnetConfiguration.DeserializeVnetConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("deploymentErrors"))
                        {
                            deploymentErrors = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("defaultDomain"))
                        {
                            defaultDomain = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("staticIp"))
                        {
                            staticIp = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("appLogsConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            appLogsConfiguration = AppLogsConfiguration.DeserializeAppLogsConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("zoneRedundant"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            zoneRedundant = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ManagedEnvironmentData(id, name, type, systemData, tags, location, Optional.ToNullable(provisioningState), daprAIInstrumentationKey.Value, daprAIConnectionString.Value, vnetConfiguration.Value, deploymentErrors.Value, defaultDomain.Value, staticIp.Value, appLogsConfiguration.Value, Optional.ToNullable(zoneRedundant)));
        }