ServiceAttachmentConnectedEndpoint.fromJson constructor

ServiceAttachmentConnectedEndpoint.fromJson(
  1. Object? j
)

Implementation

factory ServiceAttachmentConnectedEndpoint.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ServiceAttachmentConnectedEndpoint(
    consumerNetwork: switch (json['consumerNetwork']) {
      null => null,
      Object $1 => decodeString($1),
    },
    endpoint: switch (json['endpoint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    endpointWithId: switch (json['endpointWithId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    natIps: switch (json['natIps']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"natIps" is not a list'),
    },
    propagatedConnectionCount: switch (json['propagatedConnectionCount']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    pscConnectionId: switch (json['pscConnectionId']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}