Exemplo n.º 1
0
 internal KubeEnvironmentPatchResource(ResourceIdentifier id, string name, ResourceType type, string kind, KubeEnvironmentProvisioningState?provisioningState, string deploymentErrors, bool?internalLoadBalancerEnabled, string defaultDomain, string staticIp, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, string aksResourceID) : base(id, name, type, kind)
 {
     ProvisioningState           = provisioningState;
     DeploymentErrors            = deploymentErrors;
     InternalLoadBalancerEnabled = internalLoadBalancerEnabled;
     DefaultDomain        = defaultDomain;
     StaticIp             = staticIp;
     ArcConfiguration     = arcConfiguration;
     AppLogsConfiguration = appLogsConfiguration;
     AksResourceID        = aksResourceID;
 }
Exemplo n.º 2
0
 internal PatchableKubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kind, KubeEnvironmentProvisioningState?provisioningState, string deploymentErrors, bool?internalLoadBalancerEnabled, string defaultDomain, string staticIP, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, string aksResourceId) : base(id, name, resourceType, systemData, kind)
 {
     ProvisioningState           = provisioningState;
     DeploymentErrors            = deploymentErrors;
     InternalLoadBalancerEnabled = internalLoadBalancerEnabled;
     DefaultDomain        = defaultDomain;
     StaticIP             = staticIP;
     ArcConfiguration     = arcConfiguration;
     AppLogsConfiguration = appLogsConfiguration;
     AksResourceId        = aksResourceId;
 }
        internal static KubeEnvironmentPatchResource DeserializeKubeEnvironmentPatchResource(JsonElement element)
        {
            Optional <string>  kind = default;
            ResourceIdentifier id   = default;
            string             name = default;
            ResourceType       type = default;
            Optional <KubeEnvironmentProvisioningState> provisioningState = default;
            Optional <string>               deploymentErrors            = default;
            Optional <bool>                 internalLoadBalancerEnabled = default;
            Optional <string>               defaultDomain        = default;
            Optional <string>               staticIp             = default;
            Optional <ArcConfiguration>     arcConfiguration     = default;
            Optional <AppLogsConfiguration> appLogsConfiguration = default;
            Optional <string>               aksResourceID        = 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("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = property0.Value.GetString().ToKubeEnvironmentProvisioningState();
                            continue;
                        }
                        if (property0.NameEquals("deploymentErrors"))
                        {
                            deploymentErrors = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("internalLoadBalancerEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            internalLoadBalancerEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("defaultDomain"))
                        {
                            defaultDomain = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("staticIp"))
                        {
                            staticIp = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("arcConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            arcConfiguration = ArcConfiguration.DeserializeArcConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("appLogsConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            appLogsConfiguration = AppLogsConfiguration.DeserializeAppLogsConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("aksResourceID"))
                        {
                            aksResourceID = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new KubeEnvironmentPatchResource(id, name, type, kind.Value, Optional.ToNullable(provisioningState), deploymentErrors.Value, Optional.ToNullable(internalLoadBalancerEnabled), defaultDomain.Value, staticIp.Value, arcConfiguration.Value, appLogsConfiguration.Value, aksResourceID.Value));
        }