WorkspaceDirectory.fromJson constructor

WorkspaceDirectory.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory WorkspaceDirectory.fromJson(Map<String, dynamic> json) {
  return WorkspaceDirectory(
    alias: json['Alias'] as String?,
    customerUserName: json['CustomerUserName'] as String?,
    directoryId: json['DirectoryId'] as String?,
    directoryName: json['DirectoryName'] as String?,
    directoryType:
        (json['DirectoryType'] as String?)?.toWorkspaceDirectoryType(),
    dnsIpAddresses: (json['DnsIpAddresses'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    iamRoleId: json['IamRoleId'] as String?,
    registrationCode: json['RegistrationCode'] as String?,
    selfservicePermissions: json['SelfservicePermissions'] != null
        ? SelfservicePermissions.fromJson(
            json['SelfservicePermissions'] as Map<String, dynamic>)
        : null,
    state: (json['State'] as String?)?.toWorkspaceDirectoryState(),
    subnetIds: (json['SubnetIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    tenancy: (json['Tenancy'] as String?)?.toTenancy(),
    workspaceAccessProperties: json['WorkspaceAccessProperties'] != null
        ? WorkspaceAccessProperties.fromJson(
            json['WorkspaceAccessProperties'] as Map<String, dynamic>)
        : null,
    workspaceCreationProperties: json['WorkspaceCreationProperties'] != null
        ? DefaultWorkspaceCreationProperties.fromJson(
            json['WorkspaceCreationProperties'] as Map<String, dynamic>)
        : null,
    workspaceSecurityGroupId: json['WorkspaceSecurityGroupId'] as String?,
    ipGroupIds: (json['ipGroupIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
  );
}