Branch.fromJson constructor

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

Implementation

factory Branch.fromJson(Map<String, dynamic> json) {
  return Branch(
    activeJobId: json['activeJobId'] as String,
    branchArn: json['branchArn'] as String,
    branchName: json['branchName'] as String,
    createTime: nonNullableTimeStampFromJson(json['createTime'] as Object),
    customDomains: (json['customDomains'] as List)
        .whereNotNull()
        .map((e) => e as String)
        .toList(),
    description: json['description'] as String,
    displayName: json['displayName'] as String,
    enableAutoBuild: json['enableAutoBuild'] as bool,
    enableBasicAuth: json['enableBasicAuth'] as bool,
    enableNotification: json['enableNotification'] as bool,
    enablePullRequestPreview: json['enablePullRequestPreview'] as bool,
    environmentVariables:
        (json['environmentVariables'] as Map<String, dynamic>)
            .map((k, e) => MapEntry(k, e as String)),
    framework: json['framework'] as String,
    stage: (json['stage'] as String).toStage(),
    totalNumberOfJobs: json['totalNumberOfJobs'] as String,
    ttl: json['ttl'] as String,
    updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object),
    associatedResources: (json['associatedResources'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    backendEnvironmentArn: json['backendEnvironmentArn'] as String?,
    basicAuthCredentials: json['basicAuthCredentials'] as String?,
    buildSpec: json['buildSpec'] as String?,
    destinationBranch: json['destinationBranch'] as String?,
    enablePerformanceMode: json['enablePerformanceMode'] as bool?,
    pullRequestEnvironmentName: json['pullRequestEnvironmentName'] as String?,
    sourceBranch: json['sourceBranch'] as String?,
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    thumbnailUrl: json['thumbnailUrl'] as String?,
  );
}