getService method

Future<GetServiceResponse> getService({
  1. required String id,
})

Gets the settings for a specified service.

May throw InvalidInput. May throw ServiceNotFound.

Parameter id : The ID or Amazon Resource Name (ARN) of the service that you want to get settings for. For services created by consumers in a shared namespace, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide.

Implementation

Future<GetServiceResponse> getService({
  required String id,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Route53AutoNaming_v20170314.GetService'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
    },
  );

  return GetServiceResponse.fromJson(jsonResponse.body);
}