Project.fromMap constructor

Project.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Project.fromMap(Map<String, dynamic> map) {
  return Project(
    $id: map['\$id'].toString(),
    $createdAt: map['\$createdAt'].toString(),
    $updatedAt: map['\$updatedAt'].toString(),
    name: map['name'].toString(),
    teamId: map['teamId'].toString(),
    region: map['region'].toString(),
    devKeys: List<DevKey>.from(map['devKeys'].map((p) => DevKey.fromMap(p))),
    smtpEnabled: map['smtpEnabled'],
    smtpSenderName: map['smtpSenderName'].toString(),
    smtpSenderEmail: map['smtpSenderEmail'].toString(),
    smtpReplyToName: map['smtpReplyToName'].toString(),
    smtpReplyToEmail: map['smtpReplyToEmail'].toString(),
    smtpHost: map['smtpHost'].toString(),
    smtpPort: map['smtpPort'],
    smtpUsername: map['smtpUsername'].toString(),
    smtpPassword: map['smtpPassword'].toString(),
    smtpSecure: map['smtpSecure'].toString(),
    pingCount: map['pingCount'],
    pingedAt: map['pingedAt'].toString(),
    labels: List.from(map['labels'] ?? []),
    status: map['status'].toString(),
    authMethods: List<ProjectAuthMethod>.from(
        map['authMethods'].map((p) => ProjectAuthMethod.fromMap(p))),
    services: List<ProjectService>.from(
        map['services'].map((p) => ProjectService.fromMap(p))),
    protocols: List<ProjectProtocol>.from(
        map['protocols'].map((p) => ProjectProtocol.fromMap(p))),
    blocks: List<Block>.from(map['blocks'].map((p) => Block.fromMap(p))),
    consoleAccessedAt: map['consoleAccessedAt'].toString(),
    billingLimits: BillingLimits.fromMap(map['billingLimits']),
    oAuth2ServerEnabled: map['oAuth2ServerEnabled'],
    oAuth2ServerAuthorizationUrl:
        map['oAuth2ServerAuthorizationUrl'].toString(),
    oAuth2ServerScopes: List.from(map['oAuth2ServerScopes'] ?? []),
    oAuth2ServerAccessTokenDuration: map['oAuth2ServerAccessTokenDuration'],
    oAuth2ServerRefreshTokenDuration: map['oAuth2ServerRefreshTokenDuration'],
    oAuth2ServerPublicAccessTokenDuration:
        map['oAuth2ServerPublicAccessTokenDuration'],
    oAuth2ServerPublicRefreshTokenDuration:
        map['oAuth2ServerPublicRefreshTokenDuration'],
    oAuth2ServerConfidentialPkce: map['oAuth2ServerConfidentialPkce'],
    oAuth2ServerDiscoveryUrl: map['oAuth2ServerDiscoveryUrl'].toString(),
  );
}