BackendBucket.fromJson constructor

BackendBucket.fromJson(
  1. Object? j
)

Implementation

factory BackendBucket.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return BackendBucket(
    bucketName: switch (json['bucketName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    cdnPolicy: switch (json['cdnPolicy']) {
      null => null,
      Object $1 => BackendBucketCdnPolicy.fromJson($1),
    },
    compressionMode: switch (json['compressionMode']) {
      null => null,
      Object $1 => decodeString($1),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customResponseHeaders: switch (json['customResponseHeaders']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"customResponseHeaders" is not a list',
      ),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    edgeSecurityPolicy: switch (json['edgeSecurityPolicy']) {
      null => null,
      Object $1 => decodeString($1),
    },
    enableCdn: switch (json['enableCdn']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    loadBalancingScheme: switch (json['loadBalancingScheme']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => BackendBucketParams.fromJson($1),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    usedBy: switch (json['usedBy']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) BackendBucketUsedBy.fromJson(i),
      ],
      _ => throw const FormatException('"usedBy" is not a list'),
    },
  );
}