InterconnectAttachment.fromJson constructor

InterconnectAttachment.fromJson(
  1. Object? j
)

Implementation

factory InterconnectAttachment.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return InterconnectAttachment(
    adminEnabled: switch (json['adminEnabled']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    attachmentGroup: switch (json['attachmentGroup']) {
      null => null,
      Object $1 => decodeString($1),
    },
    bandwidth: switch (json['bandwidth']) {
      null => null,
      Object $1 => decodeString($1),
    },
    candidateCloudRouterIpAddress:
        switch (json['candidateCloudRouterIpAddress']) {
          null => null,
          Object $1 => decodeString($1),
        },
    candidateCloudRouterIpv6Address:
        switch (json['candidateCloudRouterIpv6Address']) {
          null => null,
          Object $1 => decodeString($1),
        },
    candidateCustomerRouterIpAddress:
        switch (json['candidateCustomerRouterIpAddress']) {
          null => null,
          Object $1 => decodeString($1),
        },
    candidateCustomerRouterIpv6Address:
        switch (json['candidateCustomerRouterIpv6Address']) {
          null => null,
          Object $1 => decodeString($1),
        },
    candidateIpv6Subnets: switch (json['candidateIpv6Subnets']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"candidateIpv6Subnets" is not a list',
      ),
    },
    candidateSubnets: switch (json['candidateSubnets']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"candidateSubnets" is not a list'),
    },
    cloudRouterIpAddress: switch (json['cloudRouterIpAddress']) {
      null => null,
      Object $1 => decodeString($1),
    },
    cloudRouterIpv6Address: switch (json['cloudRouterIpv6Address']) {
      null => null,
      Object $1 => decodeString($1),
    },
    cloudRouterIpv6InterfaceId: switch (json['cloudRouterIpv6InterfaceId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    configurationConstraints: switch (json['configurationConstraints']) {
      null => null,
      Object $1 => InterconnectAttachmentConfigurationConstraints.fromJson(
        $1,
      ),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customerRouterIpAddress: switch (json['customerRouterIpAddress']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customerRouterIpv6Address: switch (json['customerRouterIpv6Address']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customerRouterIpv6InterfaceId:
        switch (json['customerRouterIpv6InterfaceId']) {
          null => null,
          Object $1 => decodeString($1),
        },
    dataplaneVersion: switch (json['dataplaneVersion']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    edgeAvailabilityDomain: switch (json['edgeAvailabilityDomain']) {
      null => null,
      Object $1 => decodeString($1),
    },
    encryption: switch (json['encryption']) {
      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),
    },
    interconnect: switch (json['interconnect']) {
      null => null,
      Object $1 => decodeString($1),
    },
    ipsecInternalAddresses: switch (json['ipsecInternalAddresses']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"ipsecInternalAddresses" is not a list',
      ),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    l2Forwarding: switch (json['l2Forwarding']) {
      null => null,
      Object $1 => InterconnectAttachmentL2Forwarding.fromJson($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'),
    },
    mtu: switch (json['mtu']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    operationalStatus: switch (json['operationalStatus']) {
      null => null,
      Object $1 => decodeString($1),
    },
    pairingKey: switch (json['pairingKey']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => InterconnectAttachmentParams.fromJson($1),
    },
    partnerAsn: switch (json['partnerAsn']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    partnerMetadata: switch (json['partnerMetadata']) {
      null => null,
      Object $1 => InterconnectAttachmentPartnerMetadata.fromJson($1),
    },
    privateInterconnectInfo: switch (json['privateInterconnectInfo']) {
      null => null,
      Object $1 => InterconnectAttachmentPrivateInfo.fromJson($1),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    remoteService: switch (json['remoteService']) {
      null => null,
      Object $1 => decodeString($1),
    },
    router: switch (json['router']) {
      null => null,
      Object $1 => decodeString($1),
    },
    satisfiesPzs: switch (json['satisfiesPzs']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    stackType: switch (json['stackType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    state: switch (json['state']) {
      null => null,
      Object $1 => decodeString($1),
    },
    subnetLength: switch (json['subnetLength']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    type: switch (json['type']) {
      null => null,
      Object $1 => decodeString($1),
    },
    vlanTag8021Q: switch (json['vlanTag8021q']) {
      null => null,
      Object $1 => decodeInt($1),
    },
  );
}