NotebookExecutionJob.fromJson constructor

NotebookExecutionJob.fromJson(
  1. Object? j
)

Implementation

factory NotebookExecutionJob.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return NotebookExecutionJob(
    dataformRepositorySource: switch (json['dataformRepositorySource']) {
      null => null,
      Object $1 => NotebookExecutionJob_DataformRepositorySource.fromJson($1),
    },
    gcsNotebookSource: switch (json['gcsNotebookSource']) {
      null => null,
      Object $1 => NotebookExecutionJob_GcsNotebookSource.fromJson($1),
    },
    directNotebookSource: switch (json['directNotebookSource']) {
      null => null,
      Object $1 => NotebookExecutionJob_DirectNotebookSource.fromJson($1),
    },
    notebookRuntimeTemplateResourceName:
        switch (json['notebookRuntimeTemplateResourceName']) {
          null => null,
          Object $1 => decodeString($1),
        },
    customEnvironmentSpec: switch (json['customEnvironmentSpec']) {
      null => null,
      Object $1 => NotebookExecutionJob_CustomEnvironmentSpec.fromJson($1),
    },
    gcsOutputUri: switch (json['gcsOutputUri']) {
      null => null,
      Object $1 => decodeString($1),
    },
    executionUser: switch (json['executionUser']) {
      null => null,
      Object $1 => decodeString($1),
    },
    serviceAccount: switch (json['serviceAccount']) {
      null => null,
      Object $1 => decodeString($1),
    },
    workbenchRuntime: switch (json['workbenchRuntime']) {
      null => null,
      Object $1 => NotebookExecutionJob_WorkbenchRuntime.fromJson($1),
    },
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    displayName: switch (json['displayName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    executionTimeout: switch (json['executionTimeout']) {
      null => null,
      Object $1 => protobuf.Duration.fromJson($1),
    },
    scheduleResourceName: switch (json['scheduleResourceName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    jobState: switch (json['jobState']) {
      null => JobState.$default,
      Object $1 => JobState.fromJson($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => Status.fromJson($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    kernelName: switch (json['kernelName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    encryptionSpec: switch (json['encryptionSpec']) {
      null => null,
      Object $1 => EncryptionSpec.fromJson($1),
    },
  );
}