internal BigDataPoolResourceInfo(string id, string name, string type, IDictionary <string, string> tags, string location, string provisioningState, AutoScaleProperties autoScale, DateTimeOffset?creationDate, AutoPauseProperties autoPause, bool?isComputeIsolationEnabled, bool?sessionLevelPackagesEnabled, int?cacheSize, DynamicExecutorAllocation dynamicExecutorAllocation, string sparkEventsFolder, int?nodeCount, LibraryRequirements libraryRequirements, LibraryRequirements sparkConfigProperties, string sparkVersion, string defaultSparkLogFolder, NodeSize?nodeSize, NodeSizeFamily?nodeSizeFamily) : base(id, name, type, tags, location) { ProvisioningState = provisioningState; AutoScale = autoScale; CreationDate = creationDate; AutoPause = autoPause; IsComputeIsolationEnabled = isComputeIsolationEnabled; SessionLevelPackagesEnabled = sessionLevelPackagesEnabled; CacheSize = cacheSize; DynamicExecutorAllocation = dynamicExecutorAllocation; SparkEventsFolder = sparkEventsFolder; NodeCount = nodeCount; LibraryRequirements = libraryRequirements; SparkConfigProperties = sparkConfigProperties; SparkVersion = sparkVersion; DefaultSparkLogFolder = defaultSparkLogFolder; NodeSize = nodeSize; NodeSizeFamily = nodeSizeFamily; }
internal static BigDataPoolResourceInfo DeserializeBigDataPoolResourceInfo(JsonElement element) { Optional <IDictionary <string, string> > tags = default; string location = default; Optional <string> id = default; Optional <string> name = default; Optional <string> type = default; Optional <string> provisioningState = default; Optional <AutoScaleProperties> autoScale = default; Optional <DateTimeOffset> creationDate = default; Optional <AutoPauseProperties> autoPause = default; Optional <bool> isComputeIsolationEnabled = default; Optional <bool> sessionLevelPackagesEnabled = default; Optional <int> cacheSize = default; Optional <DynamicExecutorAllocation> dynamicExecutorAllocation = default; Optional <string> sparkEventsFolder = default; Optional <int> nodeCount = default; Optional <LibraryRequirements> libraryRequirements = default; Optional <IList <LibraryInfo> > customLibraries = default; Optional <LibraryRequirements> sparkConfigProperties = default; Optional <string> sparkVersion = default; Optional <string> defaultSparkLogFolder = default; Optional <NodeSize> nodeSize = default; Optional <NodeSizeFamily> nodeSizeFamily = default; Optional <DateTimeOffset> lastSucceededTimestamp = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("tags")) { 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()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("provisioningState")) { provisioningState = property0.Value.GetString(); continue; } if (property0.NameEquals("autoScale")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } autoScale = AutoScaleProperties.DeserializeAutoScaleProperties(property0.Value); continue; } if (property0.NameEquals("creationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } creationDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("autoPause")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } autoPause = AutoPauseProperties.DeserializeAutoPauseProperties(property0.Value); continue; } if (property0.NameEquals("isComputeIsolationEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isComputeIsolationEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("sessionLevelPackagesEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } sessionLevelPackagesEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("cacheSize")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } cacheSize = property0.Value.GetInt32(); continue; } if (property0.NameEquals("dynamicExecutorAllocation")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } dynamicExecutorAllocation = DynamicExecutorAllocation.DeserializeDynamicExecutorAllocation(property0.Value); continue; } if (property0.NameEquals("sparkEventsFolder")) { sparkEventsFolder = property0.Value.GetString(); continue; } if (property0.NameEquals("nodeCount")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } nodeCount = property0.Value.GetInt32(); continue; } if (property0.NameEquals("libraryRequirements")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } libraryRequirements = LibraryRequirements.DeserializeLibraryRequirements(property0.Value); continue; } if (property0.NameEquals("customLibraries")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <LibraryInfo> array = new List <LibraryInfo>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(LibraryInfo.DeserializeLibraryInfo(item)); } customLibraries = array; continue; } if (property0.NameEquals("sparkConfigProperties")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } sparkConfigProperties = LibraryRequirements.DeserializeLibraryRequirements(property0.Value); continue; } if (property0.NameEquals("sparkVersion")) { sparkVersion = property0.Value.GetString(); continue; } if (property0.NameEquals("defaultSparkLogFolder")) { defaultSparkLogFolder = property0.Value.GetString(); continue; } if (property0.NameEquals("nodeSize")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } nodeSize = new NodeSize(property0.Value.GetString()); continue; } if (property0.NameEquals("nodeSizeFamily")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } nodeSizeFamily = new NodeSizeFamily(property0.Value.GetString()); continue; } if (property0.NameEquals("lastSucceededTimestamp")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } lastSucceededTimestamp = property0.Value.GetDateTimeOffset("O"); continue; } } continue; } } return(new BigDataPoolResourceInfo(id.Value, name.Value, type.Value, Optional.ToDictionary(tags), location, provisioningState.Value, autoScale.Value, Optional.ToNullable(creationDate), autoPause.Value, Optional.ToNullable(isComputeIsolationEnabled), Optional.ToNullable(sessionLevelPackagesEnabled), Optional.ToNullable(cacheSize), dynamicExecutorAllocation.Value, sparkEventsFolder.Value, Optional.ToNullable(nodeCount), libraryRequirements.Value, Optional.ToList(customLibraries), sparkConfigProperties.Value, sparkVersion.Value, defaultSparkLogFolder.Value, Optional.ToNullable(nodeSize), Optional.ToNullable(nodeSizeFamily), Optional.ToNullable(lastSucceededTimestamp))); }