DeployedIndex.fromJson constructor

DeployedIndex.fromJson(
  1. Object? j
)

Implementation

factory DeployedIndex.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return DeployedIndex(
    id: switch (json['id']) {
      null => '',
      Object $1 => decodeString($1),
    },
    index: switch (json['index']) {
      null => '',
      Object $1 => decodeString($1),
    },
    displayName: switch (json['displayName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    privateEndpoints: switch (json['privateEndpoints']) {
      null => null,
      Object $1 => IndexPrivateEndpoints.fromJson($1),
    },
    indexSyncTime: switch (json['indexSyncTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    automaticResources: switch (json['automaticResources']) {
      null => null,
      Object $1 => AutomaticResources.fromJson($1),
    },
    dedicatedResources: switch (json['dedicatedResources']) {
      null => null,
      Object $1 => DedicatedResources.fromJson($1),
    },
    enableAccessLogging: switch (json['enableAccessLogging']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    enableDatapointUpsertLogging:
        switch (json['enableDatapointUpsertLogging']) {
          null => false,
          Object $1 => decodeBool($1),
        },
    deployedIndexAuthConfig: switch (json['deployedIndexAuthConfig']) {
      null => null,
      Object $1 => DeployedIndexAuthConfig.fromJson($1),
    },
    reservedIpRanges: switch (json['reservedIpRanges']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"reservedIpRanges" is not a list'),
    },
    deploymentGroup: switch (json['deploymentGroup']) {
      null => '',
      Object $1 => decodeString($1),
    },
    pscAutomationConfigs: switch (json['pscAutomationConfigs']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) PscautomationConfig.fromJson(i),
      ],
      _ => throw const FormatException(
        '"pscAutomationConfigs" is not a list',
      ),
    },
  );
}