internal Workspace(string id, string name, string type, IDictionary <string, string> tags, string location, ManagedIdentity identity, DataLakeStorageAccountDetails defaultDataLakeStorage, string sqlAdministratorLoginPassword, string managedResourceGroupName, string provisioningState, string sqlAdministratorLogin, VirtualNetworkProfile virtualNetworkProfile, IDictionary <string, string> connectivityEndpoints, string managedVirtualNetwork, IList <PrivateEndpointConnection> privateEndpointConnections, EncryptionDetails encryption, Guid?workspaceUID, IReadOnlyDictionary <string, object> extraProperties, ManagedVirtualNetworkSettings managedVirtualNetworkSettings, WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration, BabylonConfiguration babylonConfiguration) : base(id, name, type, tags, location) { Identity = identity; DefaultDataLakeStorage = defaultDataLakeStorage; SqlAdministratorLoginPassword = sqlAdministratorLoginPassword; ManagedResourceGroupName = managedResourceGroupName; ProvisioningState = provisioningState; SqlAdministratorLogin = sqlAdministratorLogin; VirtualNetworkProfile = virtualNetworkProfile; ConnectivityEndpoints = connectivityEndpoints; ManagedVirtualNetwork = managedVirtualNetwork; PrivateEndpointConnections = privateEndpointConnections; Encryption = encryption; WorkspaceUID = workspaceUID; ExtraProperties = extraProperties; ManagedVirtualNetworkSettings = managedVirtualNetworkSettings; WorkspaceRepositoryConfiguration = workspaceRepositoryConfiguration; BabylonConfiguration = babylonConfiguration; }
internal static Workspace DeserializeWorkspace(JsonElement element) { Optional <ManagedIdentity> identity = default; Optional <IDictionary <string, string> > tags = default; string location = default; Optional <string> id = default; Optional <string> name = default; Optional <string> type = default; Optional <DataLakeStorageAccountDetails> defaultDataLakeStorage = default; Optional <string> sqlAdministratorLoginPassword = default; Optional <string> managedResourceGroupName = default; Optional <string> provisioningState = default; Optional <string> sqlAdministratorLogin = default; Optional <VirtualNetworkProfile> virtualNetworkProfile = default; Optional <IDictionary <string, string> > connectivityEndpoints = default; Optional <string> managedVirtualNetwork = default; Optional <IList <PrivateEndpointConnection> > privateEndpointConnections = default; Optional <EncryptionDetails> encryption = default; Optional <Guid> workspaceUID = default; Optional <IReadOnlyDictionary <string, object> > extraProperties = default; Optional <ManagedVirtualNetworkSettings> managedVirtualNetworkSettings = default; Optional <WorkspaceRepositoryConfiguration> workspaceRepositoryConfiguration = default; Optional <PurviewConfiguration> purviewConfiguration = default; Optional <string> adlaResourceId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } identity = ManagedIdentity.DeserializeManagedIdentity(property.Value); continue; } 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("defaultDataLakeStorage")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } defaultDataLakeStorage = DataLakeStorageAccountDetails.DeserializeDataLakeStorageAccountDetails(property0.Value); continue; } if (property0.NameEquals("sqlAdministratorLoginPassword")) { sqlAdministratorLoginPassword = property0.Value.GetString(); continue; } if (property0.NameEquals("managedResourceGroupName")) { managedResourceGroupName = property0.Value.GetString(); continue; } if (property0.NameEquals("provisioningState")) { provisioningState = property0.Value.GetString(); continue; } if (property0.NameEquals("sqlAdministratorLogin")) { sqlAdministratorLogin = property0.Value.GetString(); continue; } if (property0.NameEquals("virtualNetworkProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } virtualNetworkProfile = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value); continue; } if (property0.NameEquals("connectivityEndpoints")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property1 in property0.Value.EnumerateObject()) { dictionary.Add(property1.Name, property1.Value.GetString()); } connectivityEndpoints = dictionary; continue; } if (property0.NameEquals("managedVirtualNetwork")) { managedVirtualNetwork = property0.Value.GetString(); continue; } if (property0.NameEquals("privateEndpointConnections")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <PrivateEndpointConnection> array = new List <PrivateEndpointConnection>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(PrivateEndpointConnection.DeserializePrivateEndpointConnection(item)); } privateEndpointConnections = array; continue; } if (property0.NameEquals("encryption")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } encryption = EncryptionDetails.DeserializeEncryptionDetails(property0.Value); continue; } if (property0.NameEquals("workspaceUID")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } workspaceUID = property0.Value.GetGuid(); continue; } if (property0.NameEquals("extraProperties")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } Dictionary <string, object> dictionary = new Dictionary <string, object>(); foreach (var property1 in property0.Value.EnumerateObject()) { dictionary.Add(property1.Name, property1.Value.GetObject()); } extraProperties = dictionary; continue; } if (property0.NameEquals("managedVirtualNetworkSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } managedVirtualNetworkSettings = ManagedVirtualNetworkSettings.DeserializeManagedVirtualNetworkSettings(property0.Value); continue; } if (property0.NameEquals("workspaceRepositoryConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } workspaceRepositoryConfiguration = WorkspaceRepositoryConfiguration.DeserializeWorkspaceRepositoryConfiguration(property0.Value); continue; } if (property0.NameEquals("purviewConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } purviewConfiguration = PurviewConfiguration.DeserializePurviewConfiguration(property0.Value); continue; } if (property0.NameEquals("adlaResourceId")) { adlaResourceId = property0.Value.GetString(); continue; } } continue; } } return(new Workspace(id.Value, name.Value, type.Value, Optional.ToDictionary(tags), location, identity.Value, defaultDataLakeStorage.Value, sqlAdministratorLoginPassword.Value, managedResourceGroupName.Value, provisioningState.Value, sqlAdministratorLogin.Value, virtualNetworkProfile.Value, Optional.ToDictionary(connectivityEndpoints), managedVirtualNetwork.Value, Optional.ToList(privateEndpointConnections), encryption.Value, Optional.ToNullable(workspaceUID), Optional.ToDictionary(extraProperties), managedVirtualNetworkSettings.Value, workspaceRepositoryConfiguration.Value, purviewConfiguration.Value, adlaResourceId.Value)); }