getAssociatedResource method

Future<GetAssociatedResourceResponse> getAssociatedResource({
  1. required String application,
  2. required String resource,
  3. required ResourceType resourceType,
  4. int? maxResults,
  5. String? nextToken,
  6. List<ResourceItemStatus>? resourceTagStatus,
})

Gets the resource associated with the application.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter application : The name, ID, or ARN of the application.

Parameter resource : The name or ID of the resource associated with the application.

Parameter resourceType : The type of resource associated with the application.

Parameter maxResults : The maximum number of results to return. If the parameter is omitted, it defaults to 25. The value is optional.

Parameter nextToken : A unique pagination token for each page of results. Make the call again with the returned token to retrieve the next page of results.

Parameter resourceTagStatus : States whether an application tag is applied, not applied, in the process of being applied, or skipped.

Implementation

Future<GetAssociatedResourceResponse> getAssociatedResource({
  required String application,
  required String resource,
  required ResourceType resourceType,
  int? maxResults,
  String? nextToken,
  List<ResourceItemStatus>? resourceTagStatus,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (resourceTagStatus != null)
      'resourceTagStatus': resourceTagStatus.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/applications/${Uri.encodeComponent(application)}/resources/${Uri.encodeComponent(resourceType.value)}/${Uri.encodeComponent(resource)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetAssociatedResourceResponse.fromJson(response);
}