Exemplo n.º 1
0
 internal AKSVariantResponse(string description, IDictionary <string, string> kvTags, IDictionary <string, string> properties, WebServiceState?state, ServiceResponseBaseError error, ComputeEnvironmentType computeType, DeploymentType?deploymentType, bool?isDefault, float?trafficPercentile, VariantType?type) : base(description, kvTags, properties, state, error, computeType, deploymentType)
 {
     IsDefault         = isDefault;
     TrafficPercentile = trafficPercentile;
     Type        = type;
     ComputeType = computeType;
 }
 internal ServiceResponseBase(string description, IDictionary <string, string> kvTags, IDictionary <string, string> properties, WebServiceState?state, ServiceResponseBaseError error, ComputeEnvironmentType computeType, DeploymentType?deploymentType)
 {
     Description    = description;
     KvTags         = kvTags;
     Properties     = properties;
     State          = state;
     Error          = error;
     ComputeType    = computeType;
     DeploymentType = deploymentType;
 }
 internal ACIServiceResponse(string description, IDictionary <string, string> kvTags, IDictionary <string, string> properties, WebServiceState?state, ServiceResponseBaseError error, ComputeEnvironmentType computeType, DeploymentType?deploymentType, ContainerResourceRequirements containerResourceRequirements, string scoringUri, string location, bool?authEnabled, bool?sslEnabled, bool?appInsightsEnabled, ACIServiceResponseDataCollection dataCollection, string sslCertificate, string sslKey, string cname, string publicIp, string publicFqdn, string swaggerUri, IReadOnlyDictionary <string, object> modelConfigMap, IList <Model> models, ACIServiceResponseEnvironmentImageRequest environmentImageRequest, ACIServiceResponseVnetConfiguration vnetConfiguration, ACIServiceResponseEncryptionProperties encryptionProperties) : base(description, kvTags, properties, state, error, computeType, deploymentType)
 {
     ContainerResourceRequirements = containerResourceRequirements;
     ScoringUri         = scoringUri;
     Location           = location;
     AuthEnabled        = authEnabled;
     SslEnabled         = sslEnabled;
     AppInsightsEnabled = appInsightsEnabled;
     DataCollection     = dataCollection;
     SslCertificate     = sslCertificate;
     SslKey             = sslKey;
     Cname                   = cname;
     PublicIp                = publicIp;
     PublicFqdn              = publicFqdn;
     SwaggerUri              = swaggerUri;
     ModelConfigMap          = modelConfigMap;
     Models                  = models;
     EnvironmentImageRequest = environmentImageRequest;
     VnetConfiguration       = vnetConfiguration;
     EncryptionProperties    = encryptionProperties;
     ComputeType             = computeType;
 }
 internal AKSServiceResponse(string description, IDictionary <string, string> kvTags, IDictionary <string, string> properties, WebServiceState?state, ServiceResponseBaseError error, ComputeEnvironmentType computeType, DeploymentType?deploymentType, bool?isDefault, float?trafficPercentile, VariantType?type, IList <Model> models, ContainerResourceRequirements containerResourceRequirements, int?maxConcurrentRequestsPerContainer, int?maxQueueWaitMs, string computeName, string @namespace, int?numReplicas, AKSServiceResponseDataCollection dataCollection, bool?appInsightsEnabled, AKSServiceResponseAutoScaler autoScaler, string scoringUri, AKSServiceResponseDeploymentStatus deploymentStatus, int?scoringTimeoutMs, AKSServiceResponseLivenessProbeRequirements livenessProbeRequirements, bool?authEnabled, bool?aadAuthEnabled, string swaggerUri, IReadOnlyDictionary <string, object> modelConfigMap, AKSServiceResponseEnvironmentImageRequest environmentImageRequest) : base(description, kvTags, properties, state, error, computeType, deploymentType, isDefault, trafficPercentile, type)
 {
     Models = models;
     ContainerResourceRequirements     = containerResourceRequirements;
     MaxConcurrentRequestsPerContainer = maxConcurrentRequestsPerContainer;
     MaxQueueWaitMs            = maxQueueWaitMs;
     ComputeName               = computeName;
     Namespace                 = @namespace;
     NumReplicas               = numReplicas;
     DataCollection            = dataCollection;
     AppInsightsEnabled        = appInsightsEnabled;
     AutoScaler                = autoScaler;
     ScoringUri                = scoringUri;
     DeploymentStatus          = deploymentStatus;
     ScoringTimeoutMs          = scoringTimeoutMs;
     LivenessProbeRequirements = livenessProbeRequirements;
     AuthEnabled               = authEnabled;
     AadAuthEnabled            = aadAuthEnabled;
     SwaggerUri                = swaggerUri;
     ModelConfigMap            = modelConfigMap;
     EnvironmentImageRequest   = environmentImageRequest;
     ComputeType               = computeType;
 }
Exemplo n.º 5
0
        internal static AKSVariantResponse DeserializeAKSVariantResponse(JsonElement element)
        {
            if (element.TryGetProperty("computeType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "AKS": return(AKSServiceResponse.DeserializeAKSServiceResponse(element));
                }
            }
            Optional <bool>        isDefault         = default;
            Optional <float>       trafficPercentile = default;
            Optional <VariantType> type        = default;
            Optional <string>      description = default;
            Optional <IDictionary <string, string> > kvTags     = default;
            Optional <IDictionary <string, string> > properties = default;
            Optional <WebServiceState>          state           = default;
            Optional <ServiceResponseBaseError> error           = default;
            ComputeEnvironmentType    computeType    = default;
            Optional <DeploymentType> deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("isDefault"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isDefault = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("trafficPercentile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    trafficPercentile = property.Value.GetSingle();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    type = new VariantType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kvTags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    kvTags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    properties = dictionary;
                    continue;
                }
                if (property.NameEquals("state"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    state = new WebServiceState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    error = ServiceResponseBaseError.DeserializeServiceResponseBaseError(property.Value);
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeEnvironmentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deploymentType = new DeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new AKSVariantResponse(description.Value, Optional.ToDictionary(kvTags), Optional.ToDictionary(properties), Optional.ToNullable(state), error.Value, computeType, Optional.ToNullable(deploymentType), Optional.ToNullable(isDefault), Optional.ToNullable(trafficPercentile), Optional.ToNullable(type)));
        }
        internal static ACIServiceResponse DeserializeACIServiceResponse(JsonElement element)
        {
            Optional <ContainerResourceRequirements> containerResourceRequirements = default;
            Optional <string> scoringUri         = default;
            Optional <string> location           = default;
            Optional <bool>   authEnabled        = default;
            Optional <bool>   sslEnabled         = default;
            Optional <bool>   appInsightsEnabled = default;
            Optional <ACIServiceResponseDataCollection> dataCollection = default;
            Optional <string> sslCertificate = default;
            Optional <string> sslKey         = default;
            Optional <string> cname          = default;
            Optional <string> publicIp       = default;
            Optional <string> publicFqdn     = default;
            Optional <string> swaggerUri     = default;
            Optional <IReadOnlyDictionary <string, object> > modelConfigMap = default;
            Optional <IList <Model> > models = default;
            Optional <ACIServiceResponseEnvironmentImageRequest> environmentImageRequest = default;
            Optional <ACIServiceResponseVnetConfiguration>       vnetConfiguration       = default;
            Optional <ACIServiceResponseEncryptionProperties>    encryptionProperties    = default;
            Optional <string> description = default;
            Optional <IDictionary <string, string> > kvTags     = default;
            Optional <IDictionary <string, string> > properties = default;
            Optional <WebServiceState>          state           = default;
            Optional <ServiceResponseBaseError> error           = default;
            ComputeEnvironmentType    computeType    = default;
            Optional <DeploymentType> deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("containerResourceRequirements"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    containerResourceRequirements = ContainerResourceRequirements.DeserializeContainerResourceRequirements(property.Value);
                    continue;
                }
                if (property.NameEquals("scoringUri"))
                {
                    scoringUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("authEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    authEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("sslEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sslEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("appInsightsEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    appInsightsEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("dataCollection"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    dataCollection = ACIServiceResponseDataCollection.DeserializeACIServiceResponseDataCollection(property.Value);
                    continue;
                }
                if (property.NameEquals("sslCertificate"))
                {
                    sslCertificate = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sslKey"))
                {
                    sslKey = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("cname"))
                {
                    cname = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("publicIp"))
                {
                    publicIp = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("publicFqdn"))
                {
                    publicFqdn = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("swaggerUri"))
                {
                    swaggerUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("modelConfigMap"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetObject());
                    }
                    modelConfigMap = dictionary;
                    continue;
                }
                if (property.NameEquals("models"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <Model> array = new List <Model>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(Model.DeserializeModel(item));
                    }
                    models = array;
                    continue;
                }
                if (property.NameEquals("environmentImageRequest"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    environmentImageRequest = ACIServiceResponseEnvironmentImageRequest.DeserializeACIServiceResponseEnvironmentImageRequest(property.Value);
                    continue;
                }
                if (property.NameEquals("vnetConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vnetConfiguration = ACIServiceResponseVnetConfiguration.DeserializeACIServiceResponseVnetConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("encryptionProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    encryptionProperties = ACIServiceResponseEncryptionProperties.DeserializeACIServiceResponseEncryptionProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kvTags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    kvTags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    properties = dictionary;
                    continue;
                }
                if (property.NameEquals("state"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    state = new WebServiceState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    error = ServiceResponseBaseError.DeserializeServiceResponseBaseError(property.Value);
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeEnvironmentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deploymentType = new DeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new ACIServiceResponse(description.Value, Optional.ToDictionary(kvTags), Optional.ToDictionary(properties), Optional.ToNullable(state), error.Value, computeType, Optional.ToNullable(deploymentType), containerResourceRequirements.Value, scoringUri.Value, location.Value, Optional.ToNullable(authEnabled), Optional.ToNullable(sslEnabled), Optional.ToNullable(appInsightsEnabled), dataCollection.Value, sslCertificate.Value, sslKey.Value, cname.Value, publicIp.Value, publicFqdn.Value, swaggerUri.Value, Optional.ToDictionary(modelConfigMap), Optional.ToList(models), environmentImageRequest.Value, vnetConfiguration.Value, encryptionProperties.Value));
        }
        internal static AKSServiceResponse DeserializeAKSServiceResponse(JsonElement element)
        {
            Optional <IList <Model> > models = default;
            Optional <ContainerResourceRequirements> containerResourceRequirements = default;
            Optional <int>    maxConcurrentRequestsPerContainer = default;
            Optional <int>    maxQueueWaitMs = default;
            Optional <string> computeName    = default;
            Optional <string> @namespace     = default;
            Optional <int>    numReplicas    = default;
            Optional <AKSServiceResponseDataCollection> dataCollection = default;
            Optional <bool> appInsightsEnabled = default;
            Optional <AKSServiceResponseAutoScaler> autoScaler = default;
            Optional <string> scoringUri = default;
            Optional <AKSServiceResponseDeploymentStatus> deploymentStatus = default;
            Optional <int> scoringTimeoutMs = default;
            Optional <AKSServiceResponseLivenessProbeRequirements> livenessProbeRequirements = default;
            Optional <bool>   authEnabled    = default;
            Optional <bool>   aadAuthEnabled = default;
            Optional <string> swaggerUri     = default;
            Optional <IReadOnlyDictionary <string, object> >     modelConfigMap          = default;
            Optional <AKSServiceResponseEnvironmentImageRequest> environmentImageRequest = default;
            Optional <bool>        isDefault         = default;
            Optional <float>       trafficPercentile = default;
            Optional <VariantType> type        = default;
            Optional <string>      description = default;
            Optional <IDictionary <string, string> > kvTags     = default;
            Optional <IDictionary <string, string> > properties = default;
            Optional <WebServiceState>          state           = default;
            Optional <ServiceResponseBaseError> error           = default;
            ComputeEnvironmentType    computeType    = default;
            Optional <DeploymentType> deploymentType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("models"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <Model> array = new List <Model>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(Model.DeserializeModel(item));
                    }
                    models = array;
                    continue;
                }
                if (property.NameEquals("containerResourceRequirements"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    containerResourceRequirements = ContainerResourceRequirements.DeserializeContainerResourceRequirements(property.Value);
                    continue;
                }
                if (property.NameEquals("maxConcurrentRequestsPerContainer"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maxConcurrentRequestsPerContainer = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("maxQueueWaitMs"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maxQueueWaitMs = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("computeName"))
                {
                    computeName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("namespace"))
                {
                    @namespace = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("numReplicas"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    numReplicas = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("dataCollection"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    dataCollection = AKSServiceResponseDataCollection.DeserializeAKSServiceResponseDataCollection(property.Value);
                    continue;
                }
                if (property.NameEquals("appInsightsEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    appInsightsEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("autoScaler"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    autoScaler = AKSServiceResponseAutoScaler.DeserializeAKSServiceResponseAutoScaler(property.Value);
                    continue;
                }
                if (property.NameEquals("scoringUri"))
                {
                    scoringUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("deploymentStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deploymentStatus = AKSServiceResponseDeploymentStatus.DeserializeAKSServiceResponseDeploymentStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("scoringTimeoutMs"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    scoringTimeoutMs = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("livenessProbeRequirements"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    livenessProbeRequirements = AKSServiceResponseLivenessProbeRequirements.DeserializeAKSServiceResponseLivenessProbeRequirements(property.Value);
                    continue;
                }
                if (property.NameEquals("authEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    authEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("aadAuthEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    aadAuthEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("swaggerUri"))
                {
                    swaggerUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("modelConfigMap"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetObject());
                    }
                    modelConfigMap = dictionary;
                    continue;
                }
                if (property.NameEquals("environmentImageRequest"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    environmentImageRequest = AKSServiceResponseEnvironmentImageRequest.DeserializeAKSServiceResponseEnvironmentImageRequest(property.Value);
                    continue;
                }
                if (property.NameEquals("isDefault"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isDefault = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("trafficPercentile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    trafficPercentile = property.Value.GetSingle();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    type = new VariantType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kvTags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    kvTags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    properties = dictionary;
                    continue;
                }
                if (property.NameEquals("state"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    state = new WebServiceState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    error = ServiceResponseBaseError.DeserializeServiceResponseBaseError(property.Value);
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeEnvironmentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deploymentType = new DeploymentType(property.Value.GetString());
                    continue;
                }
            }
            return(new AKSServiceResponse(description.Value, Optional.ToDictionary(kvTags), Optional.ToDictionary(properties), Optional.ToNullable(state), error.Value, computeType, Optional.ToNullable(deploymentType), Optional.ToNullable(isDefault), Optional.ToNullable(trafficPercentile), Optional.ToNullable(type), Optional.ToList(models), containerResourceRequirements.Value, Optional.ToNullable(maxConcurrentRequestsPerContainer), Optional.ToNullable(maxQueueWaitMs), computeName.Value, @namespace.Value, Optional.ToNullable(numReplicas), dataCollection.Value, Optional.ToNullable(appInsightsEnabled), autoScaler.Value, scoringUri.Value, deploymentStatus.Value, Optional.ToNullable(scoringTimeoutMs), livenessProbeRequirements.Value, Optional.ToNullable(authEnabled), Optional.ToNullable(aadAuthEnabled), swaggerUri.Value, Optional.ToDictionary(modelConfigMap), environmentImageRequest.Value));
        }
Exemplo n.º 8
0
 public AKSVariantResponse()
 {
     ComputeType = new ComputeEnvironmentType("Custom");
 }