internal static BatchDeploymentProperties DeserializeBatchDeploymentProperties(JsonElement element) { Optional <string> compute = default; Optional <int> errorThreshold = default; Optional <BatchLoggingLevel> loggingLevel = default; Optional <int> maxConcurrencyPerInstance = default; Optional <long> miniBatchSize = default; Optional <AssetReferenceBase> model = default; Optional <BatchOutputAction> outputAction = default; Optional <string> outputFileName = default; Optional <DeploymentProvisioningState> provisioningState = default; Optional <ResourceConfiguration> resources = default; Optional <BatchRetrySettings> retrySettings = default; Optional <CodeConfiguration> codeConfiguration = default; Optional <string> description = default; Optional <string> environmentId = default; Optional <IDictionary <string, string> > environmentVariables = default; Optional <IDictionary <string, string> > properties = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("compute")) { if (property.Value.ValueKind == JsonValueKind.Null) { compute = null; continue; } compute = property.Value.GetString(); continue; } if (property.NameEquals("errorThreshold")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } errorThreshold = property.Value.GetInt32(); continue; } if (property.NameEquals("loggingLevel")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } loggingLevel = new BatchLoggingLevel(property.Value.GetString()); continue; } if (property.NameEquals("maxConcurrencyPerInstance")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } maxConcurrencyPerInstance = property.Value.GetInt32(); continue; } if (property.NameEquals("miniBatchSize")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } miniBatchSize = property.Value.GetInt64(); continue; } if (property.NameEquals("model")) { if (property.Value.ValueKind == JsonValueKind.Null) { model = null; continue; } model = AssetReferenceBase.DeserializeAssetReferenceBase(property.Value); continue; } if (property.NameEquals("outputAction")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } outputAction = new BatchOutputAction(property.Value.GetString()); continue; } if (property.NameEquals("outputFileName")) { if (property.Value.ValueKind == JsonValueKind.Null) { outputFileName = null; continue; } outputFileName = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new DeploymentProvisioningState(property.Value.GetString()); continue; } if (property.NameEquals("resources")) { if (property.Value.ValueKind == JsonValueKind.Null) { resources = null; continue; } resources = ResourceConfiguration.DeserializeResourceConfiguration(property.Value); continue; } if (property.NameEquals("retrySettings")) { if (property.Value.ValueKind == JsonValueKind.Null) { retrySettings = null; continue; } retrySettings = BatchRetrySettings.DeserializeBatchRetrySettings(property.Value); continue; } if (property.NameEquals("codeConfiguration")) { if (property.Value.ValueKind == JsonValueKind.Null) { codeConfiguration = null; continue; } codeConfiguration = CodeConfiguration.DeserializeCodeConfiguration(property.Value); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { description = null; continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("environmentId")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentId = null; continue; } environmentId = property.Value.GetString(); continue; } if (property.NameEquals("environmentVariables")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentVariables = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } environmentVariables = dictionary; continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { properties = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } properties = dictionary; continue; } } return(new BatchDeploymentProperties(codeConfiguration.Value, description.Value, environmentId.Value, Optional.ToDictionary(environmentVariables), Optional.ToDictionary(properties), compute.Value, Optional.ToNullable(errorThreshold), Optional.ToNullable(loggingLevel), Optional.ToNullable(maxConcurrencyPerInstance), Optional.ToNullable(miniBatchSize), model.Value, Optional.ToNullable(outputAction), outputFileName.Value, Optional.ToNullable(provisioningState), resources.Value, retrySettings.Value)); }
internal static TrialComponent DeserializeTrialComponent(JsonElement element) { Optional <string> codeId = default; string command = default; Optional <DistributionConfiguration> distribution = default; string environmentId = default; Optional <IDictionary <string, string> > environmentVariables = default; Optional <ResourceConfiguration> resources = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("codeId")) { if (property.Value.ValueKind == JsonValueKind.Null) { codeId = null; continue; } codeId = property.Value.GetString(); continue; } if (property.NameEquals("command")) { command = property.Value.GetString(); continue; } if (property.NameEquals("distribution")) { if (property.Value.ValueKind == JsonValueKind.Null) { distribution = null; continue; } distribution = DistributionConfiguration.DeserializeDistributionConfiguration(property.Value); continue; } if (property.NameEquals("environmentId")) { environmentId = property.Value.GetString(); continue; } if (property.NameEquals("environmentVariables")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentVariables = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } environmentVariables = dictionary; continue; } if (property.NameEquals("resources")) { if (property.Value.ValueKind == JsonValueKind.Null) { resources = null; continue; } resources = ResourceConfiguration.DeserializeResourceConfiguration(property.Value); continue; } } return(new TrialComponent(codeId.Value, command, distribution.Value, environmentId, Optional.ToDictionary(environmentVariables), resources.Value)); }
internal static AutoMLJob DeserializeAutoMLJob(JsonElement element) { Optional <string> environmentId = default; Optional <IDictionary <string, string> > environmentVariables = default; Optional <IDictionary <string, JobOutput> > outputs = default; Optional <ResourceConfiguration> resources = default; AutoMLVertical taskDetails = default; Optional <string> computeId = default; Optional <string> displayName = default; Optional <string> experimentName = default; Optional <IdentityConfiguration> identity = default; Optional <bool> isArchived = default; JobType jobType = default; Optional <ScheduleBase> schedule = default; Optional <IDictionary <string, JobService> > services = default; Optional <JobStatus> status = default; Optional <string> description = default; Optional <IDictionary <string, string> > properties = default; Optional <IDictionary <string, string> > tags = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("environmentId")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentId = null; continue; } environmentId = property.Value.GetString(); continue; } if (property.NameEquals("environmentVariables")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentVariables = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } environmentVariables = dictionary; continue; } if (property.NameEquals("outputs")) { if (property.Value.ValueKind == JsonValueKind.Null) { outputs = null; continue; } Dictionary <string, JobOutput> dictionary = new Dictionary <string, JobOutput>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, JobOutput.DeserializeJobOutput(property0.Value)); } } outputs = dictionary; continue; } if (property.NameEquals("resources")) { if (property.Value.ValueKind == JsonValueKind.Null) { resources = null; continue; } resources = ResourceConfiguration.DeserializeResourceConfiguration(property.Value); continue; } if (property.NameEquals("taskDetails")) { taskDetails = AutoMLVertical.DeserializeAutoMLVertical(property.Value); continue; } if (property.NameEquals("computeId")) { if (property.Value.ValueKind == JsonValueKind.Null) { computeId = null; continue; } computeId = property.Value.GetString(); continue; } if (property.NameEquals("displayName")) { if (property.Value.ValueKind == JsonValueKind.Null) { displayName = null; continue; } displayName = property.Value.GetString(); continue; } if (property.NameEquals("experimentName")) { if (property.Value.ValueKind == JsonValueKind.Null) { experimentName = null; continue; } experimentName = property.Value.GetString(); continue; } if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { identity = null; continue; } identity = IdentityConfiguration.DeserializeIdentityConfiguration(property.Value); continue; } if (property.NameEquals("isArchived")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } isArchived = property.Value.GetBoolean(); continue; } if (property.NameEquals("jobType")) { jobType = new JobType(property.Value.GetString()); continue; } if (property.NameEquals("schedule")) { if (property.Value.ValueKind == JsonValueKind.Null) { schedule = null; continue; } schedule = ScheduleBase.DeserializeScheduleBase(property.Value); continue; } if (property.NameEquals("services")) { if (property.Value.ValueKind == JsonValueKind.Null) { services = null; continue; } Dictionary <string, JobService> dictionary = new Dictionary <string, JobService>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, JobService.DeserializeJobService(property0.Value)); } } services = dictionary; continue; } if (property.NameEquals("status")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } status = new JobStatus(property.Value.GetString()); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { description = null; continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { properties = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } properties = dictionary; continue; } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) { tags = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } tags = dictionary; continue; } } return(new AutoMLJob(description.Value, Optional.ToDictionary(properties), Optional.ToDictionary(tags), computeId.Value, displayName.Value, experimentName.Value, identity.Value, Optional.ToNullable(isArchived), jobType, schedule.Value, Optional.ToDictionary(services), Optional.ToNullable(status), environmentId.Value, Optional.ToDictionary(environmentVariables), Optional.ToDictionary(outputs), resources.Value, taskDetails)); }
internal static CommandJob DeserializeCommandJob(JsonElement element) { Optional <string> codeId = default; string command = default; Optional <DistributionConfiguration> distribution = default; string environmentId = default; Optional <IDictionary <string, string> > environmentVariables = default; Optional <IDictionary <string, JobInput> > inputs = default; Optional <CommandJobLimits> limits = default; Optional <IDictionary <string, JobOutput> > outputs = default; Optional <BinaryData> parameters = default; Optional <ResourceConfiguration> resources = default; Optional <string> computeId = default; Optional <string> displayName = default; Optional <string> experimentName = default; Optional <IdentityConfiguration> identity = default; Optional <bool> isArchived = default; JobType jobType = default; Optional <ScheduleBase> schedule = default; Optional <IDictionary <string, JobService> > services = default; Optional <JobStatus> status = default; Optional <string> description = default; Optional <IDictionary <string, string> > properties = default; Optional <IDictionary <string, string> > tags = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("codeId")) { if (property.Value.ValueKind == JsonValueKind.Null) { codeId = null; continue; } codeId = property.Value.GetString(); continue; } if (property.NameEquals("command")) { command = property.Value.GetString(); continue; } if (property.NameEquals("distribution")) { if (property.Value.ValueKind == JsonValueKind.Null) { distribution = null; continue; } distribution = DistributionConfiguration.DeserializeDistributionConfiguration(property.Value); continue; } if (property.NameEquals("environmentId")) { environmentId = property.Value.GetString(); continue; } if (property.NameEquals("environmentVariables")) { if (property.Value.ValueKind == JsonValueKind.Null) { environmentVariables = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } environmentVariables = dictionary; continue; } if (property.NameEquals("inputs")) { if (property.Value.ValueKind == JsonValueKind.Null) { inputs = null; continue; } Dictionary <string, JobInput> dictionary = new Dictionary <string, JobInput>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, JobInput.DeserializeJobInput(property0.Value)); } } inputs = dictionary; continue; } if (property.NameEquals("limits")) { if (property.Value.ValueKind == JsonValueKind.Null) { limits = null; continue; } limits = CommandJobLimits.DeserializeCommandJobLimits(property.Value); continue; } if (property.NameEquals("outputs")) { if (property.Value.ValueKind == JsonValueKind.Null) { outputs = null; continue; } Dictionary <string, JobOutput> dictionary = new Dictionary <string, JobOutput>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, JobOutput.DeserializeJobOutput(property0.Value)); } } outputs = dictionary; continue; } if (property.NameEquals("parameters")) { if (property.Value.ValueKind == JsonValueKind.Null) { parameters = null; continue; } parameters = BinaryData.FromString(property.Value.GetRawText()); continue; } if (property.NameEquals("resources")) { if (property.Value.ValueKind == JsonValueKind.Null) { resources = null; continue; } resources = ResourceConfiguration.DeserializeResourceConfiguration(property.Value); continue; } if (property.NameEquals("computeId")) { if (property.Value.ValueKind == JsonValueKind.Null) { computeId = null; continue; } computeId = property.Value.GetString(); continue; } if (property.NameEquals("displayName")) { if (property.Value.ValueKind == JsonValueKind.Null) { displayName = null; continue; } displayName = property.Value.GetString(); continue; } if (property.NameEquals("experimentName")) { if (property.Value.ValueKind == JsonValueKind.Null) { experimentName = null; continue; } experimentName = property.Value.GetString(); continue; } if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { identity = null; continue; } identity = IdentityConfiguration.DeserializeIdentityConfiguration(property.Value); continue; } if (property.NameEquals("isArchived")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } isArchived = property.Value.GetBoolean(); continue; } if (property.NameEquals("jobType")) { jobType = new JobType(property.Value.GetString()); continue; } if (property.NameEquals("schedule")) { if (property.Value.ValueKind == JsonValueKind.Null) { schedule = null; continue; } schedule = ScheduleBase.DeserializeScheduleBase(property.Value); continue; } if (property.NameEquals("services")) { if (property.Value.ValueKind == JsonValueKind.Null) { services = null; continue; } Dictionary <string, JobService> dictionary = new Dictionary <string, JobService>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, JobService.DeserializeJobService(property0.Value)); } } services = dictionary; continue; } if (property.NameEquals("status")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } status = new JobStatus(property.Value.GetString()); continue; } if (property.NameEquals("description")) { if (property.Value.ValueKind == JsonValueKind.Null) { description = null; continue; } description = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { properties = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } properties = dictionary; continue; } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) { tags = null; continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { if (property0.Value.ValueKind == JsonValueKind.Null) { dictionary.Add(property0.Name, null); } else { dictionary.Add(property0.Name, property0.Value.GetString()); } } tags = dictionary; continue; } } return(new CommandJob(description.Value, Optional.ToDictionary(properties), Optional.ToDictionary(tags), computeId.Value, displayName.Value, experimentName.Value, identity.Value, Optional.ToNullable(isArchived), jobType, schedule.Value, Optional.ToDictionary(services), Optional.ToNullable(status), codeId.Value, command, distribution.Value, environmentId, Optional.ToDictionary(environmentVariables), Optional.ToDictionary(inputs), limits.Value, Optional.ToDictionary(outputs), parameters.Value, resources.Value)); }