GlobalOrganizationSetPolicyRequest.fromJson constructor

GlobalOrganizationSetPolicyRequest.fromJson(
  1. Object? j
)

Implementation

factory GlobalOrganizationSetPolicyRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return GlobalOrganizationSetPolicyRequest(
    bindings: switch (json['bindings']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Binding.fromJson(i)],
      _ => throw const FormatException('"bindings" is not a list'),
    },
    etag: switch (json['etag']) {
      null => null,
      Object $1 => decodeString($1),
    },
    policy: switch (json['policy']) {
      null => null,
      Object $1 => Policy.fromJson($1),
    },
  );
}