NetworkAttachment.fromJson constructor

NetworkAttachment.fromJson(
  1. Object? j
)

Implementation

factory NetworkAttachment.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return NetworkAttachment(
    connectionEndpoints: switch (json['connectionEndpoints']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) NetworkAttachmentConnectedEndpoint.fromJson(i),
      ],
      _ => throw const FormatException('"connectionEndpoints" is not a list'),
    },
    connectionPreference: switch (json['connectionPreference']) {
      null => null,
      Object $1 => decodeString($1),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    fingerprint: switch (json['fingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    network: switch (json['network']) {
      null => null,
      Object $1 => decodeString($1),
    },
    producerAcceptLists: switch (json['producerAcceptLists']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"producerAcceptLists" is not a list'),
    },
    producerRejectLists: switch (json['producerRejectLists']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"producerRejectLists" is not a list'),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLinkWithId: switch (json['selfLinkWithId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    subnetworks: switch (json['subnetworks']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"subnetworks" is not a list'),
    },
  );
}