internal static VirtualMachineSecrets DeserializeVirtualMachineSecrets(JsonElement element)
        {
            Optional <VirtualMachineSshCredentials> administratorAccount = default;
            ComputeType computeType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("administratorAccount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    administratorAccount = VirtualMachineSshCredentials.DeserializeVirtualMachineSshCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
            }
            return(new VirtualMachineSecrets(computeType, administratorAccount.Value));
        }
        internal static ComputeSecrets DeserializeComputeSecrets(JsonElement element)
        {
            if (element.TryGetProperty("computeType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "AKS": return(AksComputeSecrets.DeserializeAksComputeSecrets(element));

                case "Databricks": return(DatabricksComputeSecrets.DeserializeDatabricksComputeSecrets(element));

                case "VirtualMachine": return(VirtualMachineSecrets.DeserializeVirtualMachineSecrets(element));
                }
            }
            ComputeType computeType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
            }
            return(new ComputeSecrets(computeType));
        }
Exemple #3
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteObjectValue(Properties);
     }
     writer.WritePropertyName("computeType");
     writer.WriteStringValue(ComputeType.ToString());
     if (Optional.IsDefined(ComputeLocation))
     {
         writer.WritePropertyName("computeLocation");
         writer.WriteStringValue(ComputeLocation);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsDefined(ResourceId))
     {
         writer.WritePropertyName("resourceId");
         writer.WriteStringValue(ResourceId);
     }
     writer.WriteEndObject();
 }
Exemple #4
0
        internal static AksComputeSecrets DeserializeAksComputeSecrets(JsonElement element)
        {
            Optional <string> userKubeConfig      = default;
            Optional <string> adminKubeConfig     = default;
            Optional <string> imagePullSecretName = default;
            ComputeType       computeType         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("userKubeConfig"))
                {
                    userKubeConfig = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("adminKubeConfig"))
                {
                    adminKubeConfig = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("imagePullSecretName"))
                {
                    imagePullSecretName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
            }
            return(new AksComputeSecrets(computeType, userKubeConfig.Value, adminKubeConfig.Value, imagePullSecretName.Value));
        }
        internal static ComputeNodesInformation DeserializeComputeNodesInformation(JsonElement element)
        {
            if (element.TryGetProperty("computeType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "AmlCompute": return(AmlComputeNodesInformation.DeserializeAmlComputeNodesInformation(element));
                }
            }
            ComputeType       computeType = default;
            Optional <string> nextLink    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ComputeNodesInformation(computeType, nextLink.Value));
        }
Exemple #6
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(IsDefault))
     {
         writer.WritePropertyName("isDefault");
         writer.WriteBooleanValue(IsDefault.Value);
     }
     if (Optional.IsDefined(TrafficPercentile))
     {
         writer.WritePropertyName("trafficPercentile");
         writer.WriteNumberValue(TrafficPercentile.Value);
     }
     if (Optional.IsDefined(Type))
     {
         writer.WritePropertyName("type");
         writer.WriteStringValue(Type.Value.ToString());
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(KvTags))
     {
         writer.WritePropertyName("kvTags");
         writer.WriteStartObject();
         foreach (var item in KvTags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WritePropertyName("computeType");
     writer.WriteStringValue(ComputeType.ToString());
     if (Optional.IsDefined(DeploymentType))
     {
         writer.WritePropertyName("deploymentType");
         writer.WriteStringValue(DeploymentType.Value.ToString());
     }
     writer.WriteEndObject();
 }
 internal Compute(ComputeType computeType, string computeLocation, ProvisioningState?provisioningState, string description, DateTimeOffset?createdOn, DateTimeOffset?modifiedOn, string resourceId, IReadOnlyList <MachineLearningServiceError> provisioningErrors, bool?isAttachedCompute)
 {
     ComputeType        = computeType;
     ComputeLocation    = computeLocation;
     ProvisioningState  = provisioningState;
     Description        = description;
     CreatedOn          = createdOn;
     ModifiedOn         = modifiedOn;
     ResourceId         = resourceId;
     ProvisioningErrors = provisioningErrors;
     IsAttachedCompute  = isAttachedCompute;
 }
Exemple #8
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(KvTags))
     {
         writer.WritePropertyName("kvTags");
         writer.WriteStartObject();
         foreach (var item in KvTags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsDefined(Keys))
     {
         writer.WritePropertyName("keys");
         writer.WriteObjectValue(Keys);
     }
     writer.WritePropertyName("computeType");
     writer.WriteStringValue(ComputeType.ToString());
     if (Optional.IsDefined(EnvironmentImageRequest))
     {
         writer.WritePropertyName("environmentImageRequest");
         writer.WriteObjectValue(EnvironmentImageRequest);
     }
     if (Optional.IsDefined(Location))
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location);
     }
     writer.WriteEndObject();
 }
        internal static DatabricksComputeSecrets DeserializeDatabricksComputeSecrets(JsonElement element)
        {
            Optional <string> databricksAccessToken = default;
            ComputeType       computeType           = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("databricksAccessToken"))
                {
                    databricksAccessToken = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
            }
            return(new DatabricksComputeSecrets(computeType, databricksAccessToken.Value));
        }
        internal static AmlComputeNodesInformation DeserializeAmlComputeNodesInformation(JsonElement element)
        {
            Optional <IReadOnlyList <AmlComputeNodeInformation> > nodes = default;
            ComputeType       computeType = default;
            Optional <string> nextLink    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("nodes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <AmlComputeNodeInformation> array = new List <AmlComputeNodeInformation>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AmlComputeNodeInformation.DeserializeAmlComputeNodeInformation(item));
                    }
                    nodes = array;
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new AmlComputeNodesInformation(computeType, nextLink.Value, Optional.ToList(nodes)));
        }
Exemple #11
0
 internal AKS(ComputeType computeType, string computeLocation, ProvisioningState?provisioningState, string description, DateTimeOffset?createdOn, DateTimeOffset?modifiedOn, string resourceId, IReadOnlyList <MachineLearningServiceError> provisioningErrors, bool?isAttachedCompute, AKSProperties properties) : base(computeType, computeLocation, provisioningState, description, createdOn, modifiedOn, resourceId, provisioningErrors, isAttachedCompute)
 {
     Properties  = properties;
     ComputeType = computeType;
 }
Exemple #12
0
        internal static DataLakeAnalytics DeserializeDataLakeAnalytics(JsonElement element)
        {
            Optional <DataLakeAnalyticsProperties> properties = default;
            ComputeType                  computeType          = default;
            Optional <string>            computeLocation      = default;
            Optional <ProvisioningState> provisioningState    = default;
            Optional <string>            description          = default;
            Optional <DateTimeOffset>    createdOn            = default;
            Optional <DateTimeOffset>    modifiedOn           = default;
            Optional <string>            resourceId           = default;
            Optional <IReadOnlyList <MachineLearningServiceError> > provisioningErrors = default;
            Optional <bool> isAttachedCompute = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    properties = DataLakeAnalyticsProperties.DeserializeDataLakeAnalyticsProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("computeLocation"))
                {
                    computeLocation = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    provisioningState = new ProvisioningState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("createdOn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    createdOn = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("modifiedOn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    modifiedOn = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("provisioningErrors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MachineLearningServiceError> array = new List <MachineLearningServiceError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MachineLearningServiceError.DeserializeMachineLearningServiceError(item));
                    }
                    provisioningErrors = array;
                    continue;
                }
                if (property.NameEquals("isAttachedCompute"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isAttachedCompute = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new DataLakeAnalytics(computeType, computeLocation.Value, Optional.ToNullable(provisioningState), description.Value, Optional.ToNullable(createdOn), Optional.ToNullable(modifiedOn), resourceId.Value, Optional.ToList(provisioningErrors), Optional.ToNullable(isAttachedCompute), properties.Value));
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(NumReplicas))
     {
         writer.WritePropertyName("numReplicas");
         writer.WriteNumberValue(NumReplicas.Value);
     }
     if (Optional.IsDefined(DataCollection))
     {
         writer.WritePropertyName("dataCollection");
         writer.WriteObjectValue(DataCollection);
     }
     if (Optional.IsDefined(ComputeName))
     {
         writer.WritePropertyName("computeName");
         writer.WriteStringValue(ComputeName);
     }
     if (Optional.IsDefined(AppInsightsEnabled))
     {
         writer.WritePropertyName("appInsightsEnabled");
         writer.WriteBooleanValue(AppInsightsEnabled.Value);
     }
     if (Optional.IsDefined(AutoScaler))
     {
         writer.WritePropertyName("autoScaler");
         writer.WriteObjectValue(AutoScaler);
     }
     if (Optional.IsDefined(ContainerResourceRequirements))
     {
         writer.WritePropertyName("containerResourceRequirements");
         writer.WriteObjectValue(ContainerResourceRequirements);
     }
     if (Optional.IsDefined(MaxConcurrentRequestsPerContainer))
     {
         writer.WritePropertyName("maxConcurrentRequestsPerContainer");
         writer.WriteNumberValue(MaxConcurrentRequestsPerContainer.Value);
     }
     if (Optional.IsDefined(MaxQueueWaitMs))
     {
         writer.WritePropertyName("maxQueueWaitMs");
         writer.WriteNumberValue(MaxQueueWaitMs.Value);
     }
     if (Optional.IsDefined(Namespace))
     {
         writer.WritePropertyName("namespace");
         writer.WriteStringValue(Namespace);
     }
     if (Optional.IsDefined(ScoringTimeoutMs))
     {
         writer.WritePropertyName("scoringTimeoutMs");
         writer.WriteNumberValue(ScoringTimeoutMs.Value);
     }
     if (Optional.IsDefined(AuthEnabled))
     {
         writer.WritePropertyName("authEnabled");
         writer.WriteBooleanValue(AuthEnabled.Value);
     }
     if (Optional.IsDefined(LivenessProbeRequirements))
     {
         writer.WritePropertyName("livenessProbeRequirements");
         writer.WriteObjectValue(LivenessProbeRequirements);
     }
     if (Optional.IsDefined(AadAuthEnabled))
     {
         writer.WritePropertyName("aadAuthEnabled");
         writer.WriteBooleanValue(AadAuthEnabled.Value);
     }
     if (Optional.IsDefined(IsDefault))
     {
         writer.WritePropertyName("isDefault");
         writer.WriteBooleanValue(IsDefault.Value);
     }
     if (Optional.IsDefined(TrafficPercentile))
     {
         writer.WritePropertyName("trafficPercentile");
         writer.WriteNumberValue(TrafficPercentile.Value);
     }
     if (Optional.IsDefined(Type))
     {
         writer.WritePropertyName("type");
         writer.WriteStringValue(Type.Value.ToString());
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(KvTags))
     {
         writer.WritePropertyName("kvTags");
         writer.WriteStartObject();
         foreach (var item in KvTags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsDefined(Keys))
     {
         writer.WritePropertyName("keys");
         writer.WriteObjectValue(Keys);
     }
     writer.WritePropertyName("computeType");
     writer.WriteStringValue(ComputeType.ToString());
     if (Optional.IsDefined(EnvironmentImageRequest))
     {
         writer.WritePropertyName("environmentImageRequest");
         writer.WriteObjectValue(EnvironmentImageRequest);
     }
     if (Optional.IsDefined(Location))
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location);
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ContainerResourceRequirements))
     {
         writer.WritePropertyName("containerResourceRequirements");
         writer.WriteObjectValue(ContainerResourceRequirements);
     }
     if (Optional.IsDefined(Location))
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location);
     }
     if (Optional.IsDefined(AuthEnabled))
     {
         writer.WritePropertyName("authEnabled");
         writer.WriteBooleanValue(AuthEnabled.Value);
     }
     if (Optional.IsDefined(SslEnabled))
     {
         writer.WritePropertyName("sslEnabled");
         writer.WriteBooleanValue(SslEnabled.Value);
     }
     if (Optional.IsDefined(AppInsightsEnabled))
     {
         writer.WritePropertyName("appInsightsEnabled");
         writer.WriteBooleanValue(AppInsightsEnabled.Value);
     }
     if (Optional.IsDefined(DataCollection))
     {
         writer.WritePropertyName("dataCollection");
         writer.WriteObjectValue(DataCollection);
     }
     if (Optional.IsDefined(SslCertificate))
     {
         writer.WritePropertyName("sslCertificate");
         writer.WriteStringValue(SslCertificate);
     }
     if (Optional.IsDefined(SslKey))
     {
         writer.WritePropertyName("sslKey");
         writer.WriteStringValue(SslKey);
     }
     if (Optional.IsDefined(Cname))
     {
         writer.WritePropertyName("cname");
         writer.WriteStringValue(Cname);
     }
     if (Optional.IsDefined(PublicIp))
     {
         writer.WritePropertyName("publicIp");
         writer.WriteStringValue(PublicIp);
     }
     if (Optional.IsDefined(PublicFqdn))
     {
         writer.WritePropertyName("publicFqdn");
         writer.WriteStringValue(PublicFqdn);
     }
     if (Optional.IsCollectionDefined(Models))
     {
         writer.WritePropertyName("models");
         writer.WriteStartArray();
         foreach (var item in Models)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(EnvironmentImageRequest))
     {
         writer.WritePropertyName("environmentImageRequest");
         writer.WriteObjectValue(EnvironmentImageRequest);
     }
     if (Optional.IsDefined(VnetConfiguration))
     {
         writer.WritePropertyName("vnetConfiguration");
         writer.WriteObjectValue(VnetConfiguration);
     }
     if (Optional.IsDefined(EncryptionProperties))
     {
         writer.WritePropertyName("encryptionProperties");
         writer.WriteObjectValue(EncryptionProperties);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(KvTags))
     {
         writer.WritePropertyName("kvTags");
         writer.WriteStartObject();
         foreach (var item in KvTags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WritePropertyName("computeType");
     writer.WriteStringValue(ComputeType.ToString());
     if (Optional.IsDefined(DeploymentType))
     {
         writer.WritePropertyName("deploymentType");
         writer.WriteStringValue(DeploymentType.Value.ToString());
     }
     writer.WriteEndObject();
 }
 internal AmlComputeNodesInformation(ComputeType computeType, string nextLink, IReadOnlyList <AmlComputeNodeInformation> nodes) : base(computeType, nextLink)
 {
     Nodes       = nodes;
     ComputeType = computeType;
 }
Exemple #16
0
        internal static Compute DeserializeCompute(JsonElement element)
        {
            if (element.TryGetProperty("computeType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "AKS": return(AKS.DeserializeAKS(element));

                case "AmlCompute": return(AmlCompute.DeserializeAmlCompute(element));

                case "ComputeInstance": return(ComputeInstance.DeserializeComputeInstance(element));

                case "DataFactory": return(DataFactory.DeserializeDataFactory(element));

                case "DataLakeAnalytics": return(DataLakeAnalytics.DeserializeDataLakeAnalytics(element));

                case "Databricks": return(Databricks.DeserializeDatabricks(element));

                case "HDInsight": return(HDInsight.DeserializeHDInsight(element));

                case "VirtualMachine": return(VirtualMachine.DeserializeVirtualMachine(element));
                }
            }
            ComputeType                  computeType       = default;
            Optional <string>            computeLocation   = default;
            Optional <ProvisioningState> provisioningState = default;
            Optional <string>            description       = default;
            Optional <DateTimeOffset>    createdOn         = default;
            Optional <DateTimeOffset>    modifiedOn        = default;
            Optional <string>            resourceId        = default;
            Optional <IReadOnlyList <MachineLearningServiceError> > provisioningErrors = default;
            Optional <bool> isAttachedCompute = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("computeType"))
                {
                    computeType = new ComputeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("computeLocation"))
                {
                    computeLocation = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    provisioningState = new ProvisioningState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("createdOn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    createdOn = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("modifiedOn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    modifiedOn = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("provisioningErrors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MachineLearningServiceError> array = new List <MachineLearningServiceError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MachineLearningServiceError.DeserializeMachineLearningServiceError(item));
                    }
                    provisioningErrors = array;
                    continue;
                }
                if (property.NameEquals("isAttachedCompute"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isAttachedCompute = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new Compute(computeType, computeLocation.Value, Optional.ToNullable(provisioningState), description.Value, Optional.ToNullable(createdOn), Optional.ToNullable(modifiedOn), resourceId.Value, Optional.ToList(provisioningErrors), Optional.ToNullable(isAttachedCompute)));
        }