internal ModelEnvironmentDefinitionResponse(string name, string version, ModelEnvironmentDefinitionResponsePython python, IDictionary <string, string> environmentVariables, ModelEnvironmentDefinitionResponseDocker docker, ModelEnvironmentDefinitionResponseSpark spark, ModelEnvironmentDefinitionResponseR r, string inferencingStackVersion)
 {
     Name    = name;
     Version = version;
     Python  = python;
     EnvironmentVariables = environmentVariables;
     Docker = docker;
     Spark  = spark;
     R      = r;
     InferencingStackVersion = inferencingStackVersion;
 }
Пример #2
0
        internal static ModelEnvironmentDefinitionResponse DeserializeModelEnvironmentDefinitionResponse(JsonElement element)
        {
            Optional <string> name    = default;
            Optional <string> version = default;
            Optional <ModelEnvironmentDefinitionResponsePython> python = default;
            Optional <IDictionary <string, string> >            environmentVariables = default;
            Optional <ModelEnvironmentDefinitionResponseDocker> docker = default;
            Optional <ModelEnvironmentDefinitionResponseSpark>  spark  = default;
            Optional <ModelEnvironmentDefinitionResponseR>      r      = default;
            Optional <string> inferencingStackVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("version"))
                {
                    version = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("python"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    python = ModelEnvironmentDefinitionResponsePython.DeserializeModelEnvironmentDefinitionResponsePython(property.Value);
                    continue;
                }
                if (property.NameEquals("environmentVariables"))
                {
                    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());
                    }
                    environmentVariables = dictionary;
                    continue;
                }
                if (property.NameEquals("docker"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    docker = ModelEnvironmentDefinitionResponseDocker.DeserializeModelEnvironmentDefinitionResponseDocker(property.Value);
                    continue;
                }
                if (property.NameEquals("spark"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    spark = ModelEnvironmentDefinitionResponseSpark.DeserializeModelEnvironmentDefinitionResponseSpark(property.Value);
                    continue;
                }
                if (property.NameEquals("r"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    r = ModelEnvironmentDefinitionResponseR.DeserializeModelEnvironmentDefinitionResponseR(property.Value);
                    continue;
                }
                if (property.NameEquals("inferencingStackVersion"))
                {
                    inferencingStackVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new ModelEnvironmentDefinitionResponse(name.Value, version.Value, python.Value, Optional.ToDictionary(environmentVariables), docker.Value, spark.Value, r.Value, inferencingStackVersion.Value));
        }
 internal EnvironmentImageResponseEnvironment(string name, string version, ModelEnvironmentDefinitionResponsePython python, IDictionary <string, string> environmentVariables, ModelEnvironmentDefinitionResponseDocker docker, ModelEnvironmentDefinitionResponseSpark spark, ModelEnvironmentDefinitionResponseR r, string inferencingStackVersion) : base(name, version, python, environmentVariables, docker, spark, r, inferencingStackVersion)
 {
 }