Build.fromJson constructor

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

Implementation

factory Build.fromJson(Map<String, dynamic> json) {
  return Build(
    arn: json['arn'] as String?,
    artifacts: json['artifacts'] != null
        ? BuildArtifacts.fromJson(json['artifacts'] as Map<String, dynamic>)
        : null,
    buildBatchArn: json['buildBatchArn'] as String?,
    buildComplete: json['buildComplete'] as bool?,
    buildNumber: json['buildNumber'] as int?,
    buildStatus: (json['buildStatus'] as String?)?.toStatusType(),
    cache: json['cache'] != null
        ? ProjectCache.fromJson(json['cache'] as Map<String, dynamic>)
        : null,
    currentPhase: json['currentPhase'] as String?,
    debugSession: json['debugSession'] != null
        ? DebugSession.fromJson(json['debugSession'] as Map<String, dynamic>)
        : null,
    encryptionKey: json['encryptionKey'] as String?,
    endTime: timeStampFromJson(json['endTime']),
    environment: json['environment'] != null
        ? ProjectEnvironment.fromJson(
            json['environment'] as Map<String, dynamic>)
        : null,
    exportedEnvironmentVariables: (json['exportedEnvironmentVariables']
            as List?)
        ?.whereNotNull()
        .map((e) =>
            ExportedEnvironmentVariable.fromJson(e as Map<String, dynamic>))
        .toList(),
    fileSystemLocations: (json['fileSystemLocations'] as List?)
        ?.whereNotNull()
        .map((e) =>
            ProjectFileSystemLocation.fromJson(e as Map<String, dynamic>))
        .toList(),
    id: json['id'] as String?,
    initiator: json['initiator'] as String?,
    logs: json['logs'] != null
        ? LogsLocation.fromJson(json['logs'] as Map<String, dynamic>)
        : null,
    networkInterface: json['networkInterface'] != null
        ? NetworkInterface.fromJson(
            json['networkInterface'] as Map<String, dynamic>)
        : null,
    phases: (json['phases'] as List?)
        ?.whereNotNull()
        .map((e) => BuildPhase.fromJson(e as Map<String, dynamic>))
        .toList(),
    projectName: json['projectName'] as String?,
    queuedTimeoutInMinutes: json['queuedTimeoutInMinutes'] as int?,
    reportArns: (json['reportArns'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    resolvedSourceVersion: json['resolvedSourceVersion'] as String?,
    secondaryArtifacts: (json['secondaryArtifacts'] as List?)
        ?.whereNotNull()
        .map((e) => BuildArtifacts.fromJson(e as Map<String, dynamic>))
        .toList(),
    secondarySourceVersions: (json['secondarySourceVersions'] as List?)
        ?.whereNotNull()
        .map((e) => ProjectSourceVersion.fromJson(e as Map<String, dynamic>))
        .toList(),
    secondarySources: (json['secondarySources'] as List?)
        ?.whereNotNull()
        .map((e) => ProjectSource.fromJson(e as Map<String, dynamic>))
        .toList(),
    serviceRole: json['serviceRole'] as String?,
    source: json['source'] != null
        ? ProjectSource.fromJson(json['source'] as Map<String, dynamic>)
        : null,
    sourceVersion: json['sourceVersion'] as String?,
    startTime: timeStampFromJson(json['startTime']),
    timeoutInMinutes: json['timeoutInMinutes'] as int?,
    vpcConfig: json['vpcConfig'] != null
        ? VpcConfig.fromJson(json['vpcConfig'] as Map<String, dynamic>)
        : null,
  );
}