getOpsMetadata method

Future<GetOpsMetadataResult> getOpsMetadata({
  1. required String opsMetadataArn,
  2. int? maxResults,
  3. String? nextToken,
})

View operational metadata related to an application in Application Manager.

May throw OpsMetadataNotFoundException. May throw OpsMetadataInvalidArgumentException. May throw InternalServerError.

Parameter opsMetadataArn : The Amazon Resource Name (ARN) of an OpsMetadata Object to view.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : A token to start the list. Use this token to get the next set of results.

Implementation

Future<GetOpsMetadataResult> getOpsMetadata({
  required String opsMetadataArn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(opsMetadataArn, 'opsMetadataArn');
  _s.validateStringLength(
    'opsMetadataArn',
    opsMetadataArn,
    1,
    1011,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetOpsMetadata'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OpsMetadataArn': opsMetadataArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetOpsMetadataResult.fromJson(jsonResponse.body);
}