getLifecyclePolicies method

Future<GetLifecyclePoliciesResponse> getLifecyclePolicies({
  1. List<String>? policyIds,
  2. List<ResourceTypeValues>? resourceTypes,
  3. GettablePolicyStateValues? state,
  4. List<String>? tagsToAdd,
  5. List<String>? targetTags,
})

Gets summary information about all or the specified data lifecycle policies.

To get complete information about a policy, use GetLifecyclePolicy.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw InternalServerException. May throw LimitExceededException.

Parameter policyIds : The identifiers of the data lifecycle policies.

Parameter resourceTypes : The resource type.

Parameter state : The activation state.

Parameter tagsToAdd : The tags to add to objects created by the policy.

Tags are strings in the format key=value.

These user-defined tags are added in addition to the AWS-added lifecycle tags.

Parameter targetTags : The target tag for a policy.

Tags are strings in the format key=value.

Implementation

Future<GetLifecyclePoliciesResponse> getLifecyclePolicies({
  List<String>? policyIds,
  List<ResourceTypeValues>? resourceTypes,
  GettablePolicyStateValues? state,
  List<String>? tagsToAdd,
  List<String>? targetTags,
}) async {
  final $query = <String, List<String>>{
    if (policyIds != null) 'policyIds': policyIds,
    if (resourceTypes != null)
      'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(),
    if (state != null) 'state': [state.toValue()],
    if (tagsToAdd != null) 'tagsToAdd': tagsToAdd,
    if (targetTags != null) 'targetTags': targetTags,
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/policies',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetLifecyclePoliciesResponse.fromJson(response);
}