Interconnect.fromJson constructor

Interconnect.fromJson(
  1. Object? j
)

Implementation

factory Interconnect.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Interconnect(
    aaiEnabled: switch (json['aaiEnabled']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    adminEnabled: switch (json['adminEnabled']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    applicationAwareInterconnect:
        switch (json['applicationAwareInterconnect']) {
          null => null,
          Object $1 => InterconnectApplicationAwareInterconnect.fromJson($1),
        },
    availableFeatures: switch (json['availableFeatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"availableFeatures" is not a list'),
    },
    circuitInfos: switch (json['circuitInfos']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) InterconnectCircuitInfo.fromJson(i),
      ],
      _ => throw const FormatException('"circuitInfos" is not a list'),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customerName: switch (json['customerName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    effectiveLocation: switch (json['effectiveLocation']) {
      null => null,
      Object $1 => decodeString($1),
    },
    expectedOutages: switch (json['expectedOutages']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) InterconnectOutageNotification.fromJson(i),
      ],
      _ => throw const FormatException('"expectedOutages" is not a list'),
    },
    googleIpAddress: switch (json['googleIpAddress']) {
      null => null,
      Object $1 => decodeString($1),
    },
    googleReferenceId: switch (json['googleReferenceId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    interconnectAttachments: switch (json['interconnectAttachments']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"interconnectAttachments" is not a list',
      ),
    },
    interconnectGroups: switch (json['interconnectGroups']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"interconnectGroups" is not a list'),
    },
    interconnectType: switch (json['interconnectType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    labelFingerprint: switch (json['labelFingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    linkType: switch (json['linkType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    location: switch (json['location']) {
      null => null,
      Object $1 => decodeString($1),
    },
    macsec: switch (json['macsec']) {
      null => null,
      Object $1 => InterconnectMacsec.fromJson($1),
    },
    macsecEnabled: switch (json['macsecEnabled']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    nocContactEmail: switch (json['nocContactEmail']) {
      null => null,
      Object $1 => decodeString($1),
    },
    operationalStatus: switch (json['operationalStatus']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => InterconnectParams.fromJson($1),
    },
    peerIpAddress: switch (json['peerIpAddress']) {
      null => null,
      Object $1 => decodeString($1),
    },
    provisionedLinkCount: switch (json['provisionedLinkCount']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    remoteLocation: switch (json['remoteLocation']) {
      null => null,
      Object $1 => decodeString($1),
    },
    requestedFeatures: switch (json['requestedFeatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"requestedFeatures" is not a list'),
    },
    requestedLinkCount: switch (json['requestedLinkCount']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    satisfiesPzs: switch (json['satisfiesPzs']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLinkWithId: switch (json['selfLinkWithId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    state: switch (json['state']) {
      null => null,
      Object $1 => decodeString($1),
    },
    subzone: switch (json['subzone']) {
      null => null,
      Object $1 => decodeString($1),
    },
    wireGroups: switch (json['wireGroups']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"wireGroups" is not a list'),
    },
  );
}