InterconnectGroup.fromJson constructor

InterconnectGroup.fromJson(
  1. Object? j
)

Implementation

factory InterconnectGroup.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return InterconnectGroup(
    configured: switch (json['configured']) {
      null => null,
      Object $1 => InterconnectGroupConfigured.fromJson($1),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    etag: switch (json['etag']) {
      null => null,
      Object $1 => decodeString($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    intent: switch (json['intent']) {
      null => null,
      Object $1 => InterconnectGroupIntent.fromJson($1),
    },
    interconnects: switch (json['interconnects']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): InterconnectGroupInterconnect.fromJson(
            e.value,
          ),
      },
      _ => throw const FormatException('"interconnects" is not an object'),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    physicalStructure: switch (json['physicalStructure']) {
      null => null,
      Object $1 => InterconnectGroupPhysicalStructure.fromJson($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}