Snapshot.fromJson constructor

Snapshot.fromJson(
  1. Map _json
)

Implementation

Snapshot.fromJson(core.Map _json)
    : this(
        creationTime: _json.containsKey('creationTime')
            ? _json['creationTime'] as core.String
            : null,
        description: _json.containsKey('description')
            ? _json['description'] as core.String
            : null,
        diskSizeBytes: _json.containsKey('diskSizeBytes')
            ? _json['diskSizeBytes'] as core.String
            : null,
        id: _json.containsKey('id') ? _json['id'] as core.String : null,
        projectId: _json.containsKey('projectId')
            ? _json['projectId'] as core.String
            : null,
        pubsubMetadata: _json.containsKey('pubsubMetadata')
            ? (_json['pubsubMetadata'] as core.List)
                .map<PubsubSnapshotMetadata>((value) =>
                    PubsubSnapshotMetadata.fromJson(
                        value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        region: _json.containsKey('region')
            ? _json['region'] as core.String
            : null,
        sourceJobId: _json.containsKey('sourceJobId')
            ? _json['sourceJobId'] as core.String
            : null,
        state:
            _json.containsKey('state') ? _json['state'] as core.String : null,
        ttl: _json.containsKey('ttl') ? _json['ttl'] as core.String : null,
      );