InstanceGroupsSetNamedPortsRequest.fromJson constructor

InstanceGroupsSetNamedPortsRequest.fromJson(
  1. Object? j
)

Implementation

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