getRemoteClusterInfo method

Future<MmRemoteClusterInfo?> getRemoteClusterInfo(
  1. String remoteId
)

Get remote cluster info by ID for user.

Get remote cluster info based on remoteId. Minimum server version: 5.50 ##### Permissions Must be authenticated and user must belong to at least one channel shared with the remote cluster.

Parameters:

  • String remoteId (required): Remote Cluster GUID

Implementation

Future<MmRemoteClusterInfo?> getRemoteClusterInfo(
  String remoteId,
) async {
  final response = await getRemoteClusterInfoWithHttpInfo(
    remoteId,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(
      await _decodeBodyBytes(response),
      'MmRemoteClusterInfo',
    ) as MmRemoteClusterInfo;
  }
  return null;
}