Bucket.fromJson constructor

Bucket.fromJson(
  1. Map _json
)

Implementation

Bucket.fromJson(core.Map _json)
    : this(
        acl: _json.containsKey('acl')
            ? (_json['acl'] as core.List)
                .map((value) => BucketAccessControl.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        autoclass: _json.containsKey('autoclass')
            ? BucketAutoclass.fromJson(
                _json['autoclass'] as core.Map<core.String, core.dynamic>)
            : null,
        billing: _json.containsKey('billing')
            ? BucketBilling.fromJson(
                _json['billing'] as core.Map<core.String, core.dynamic>)
            : null,
        cors: _json.containsKey('cors')
            ? (_json['cors'] as core.List)
                .map((value) => BucketCors.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        defaultEventBasedHold: _json.containsKey('defaultEventBasedHold')
            ? _json['defaultEventBasedHold'] as core.bool
            : null,
        defaultObjectAcl: _json.containsKey('defaultObjectAcl')
            ? (_json['defaultObjectAcl'] as core.List)
                .map((value) => ObjectAccessControl.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        encryption: _json.containsKey('encryption')
            ? BucketEncryption.fromJson(
                _json['encryption'] as core.Map<core.String, core.dynamic>)
            : null,
        etag: _json.containsKey('etag') ? _json['etag'] as core.String : null,
        iamConfiguration: _json.containsKey('iamConfiguration')
            ? BucketIamConfiguration.fromJson(_json['iamConfiguration']
                as core.Map<core.String, core.dynamic>)
            : null,
        id: _json.containsKey('id') ? _json['id'] as core.String : null,
        kind: _json.containsKey('kind') ? _json['kind'] as core.String : null,
        labels: _json.containsKey('labels')
            ? (_json['labels'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.String,
                ),
              )
            : null,
        lifecycle: _json.containsKey('lifecycle')
            ? BucketLifecycle.fromJson(
                _json['lifecycle'] as core.Map<core.String, core.dynamic>)
            : null,
        location: _json.containsKey('location')
            ? _json['location'] as core.String
            : null,
        locationType: _json.containsKey('locationType')
            ? _json['locationType'] as core.String
            : null,
        logging: _json.containsKey('logging')
            ? BucketLogging.fromJson(
                _json['logging'] as core.Map<core.String, core.dynamic>)
            : null,
        metageneration: _json.containsKey('metageneration')
            ? _json['metageneration'] as core.String
            : null,
        name: _json.containsKey('name') ? _json['name'] as core.String : null,
        owner: _json.containsKey('owner')
            ? BucketOwner.fromJson(
                _json['owner'] as core.Map<core.String, core.dynamic>)
            : null,
        projectNumber: _json.containsKey('projectNumber')
            ? _json['projectNumber'] as core.String
            : null,
        retentionPolicy: _json.containsKey('retentionPolicy')
            ? BucketRetentionPolicy.fromJson(_json['retentionPolicy']
                as core.Map<core.String, core.dynamic>)
            : null,
        rpo: _json.containsKey('rpo') ? _json['rpo'] as core.String : null,
        satisfiesPZS: _json.containsKey('satisfiesPZS')
            ? _json['satisfiesPZS'] as core.bool
            : null,
        selfLink: _json.containsKey('selfLink')
            ? _json['selfLink'] as core.String
            : null,
        storageClass: _json.containsKey('storageClass')
            ? _json['storageClass'] as core.String
            : null,
        timeCreated: _json.containsKey('timeCreated')
            ? core.DateTime.parse(_json['timeCreated'] as core.String)
            : null,
        updated: _json.containsKey('updated')
            ? core.DateTime.parse(_json['updated'] as core.String)
            : null,
        versioning: _json.containsKey('versioning')
            ? BucketVersioning.fromJson(
                _json['versioning'] as core.Map<core.String, core.dynamic>)
            : null,
        website: _json.containsKey('website')
            ? BucketWebsite.fromJson(
                _json['website'] as core.Map<core.String, core.dynamic>)
            : null,
      );