Skip to content

list_permission_associations

list_permission_associations(
    *,
    config_overrides: Optional[RAMClientConfig] = None,
    permission_arn: Optional[String] = None,
    permission_version: Optional[Integer] = None,
    association_status: Optional[ResourceShareAssociationStatus] = None,
    resource_type: Optional[String] = None,
    feature_set: Optional[PermissionFeatureSet] = None,
    default_version: Optional[Boolean] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxResults] = None,
) -> ListPermissionAssociationsResponse

Lists information about the managed permission and its associations to any resource shares that use this managed permission. This lets you see which resource shares use which versions of the specified managed permission.

Always check the NextToken response parameter for a null value when calling a paginated operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.

Parameters:

  • permission_arn (Optional[String], default: None ) –

    Specifies the Amazon Resource Name (ARN) of the managed permission.

  • permission_version (Optional[Integer], default: None ) –

    Specifies that you want to list only those associations with resource shares that use this version of the managed permission. If you don't provide a value for this parameter, then the operation returns information about associations with resource shares that use any version of the managed permission.

  • association_status (Optional[ResourceShareAssociationStatus], default: None ) –

    Specifies that you want to list only those associations with resource shares that match this status.

  • resource_type (Optional[String], default: None ) –

    Specifies that you want to list only those associations with resource shares that include at least one resource of this resource type.

  • feature_set (Optional[PermissionFeatureSet], default: None ) –

    Specifies that you want to list only those associations with resource shares that have a featureSet with this value.

  • default_version (Optional[Boolean], default: None ) –

    When true, specifies that you want to list only those associations with resource shares that use the default version of the specified managed permission.

    When false (the default value), lists associations with resource shares that use any version of the specified managed permission.

  • next_token (Optional[String], default: None ) –

    Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

  • max_results (Optional[MaxResults], default: None ) –

    Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

Raises:

Source code in docs_src/capo_ram/_services/ram.py
def list_permission_associations(
    self,
    *,
    config_overrides: Optional[RAMClientConfig] = None,
    permission_arn: Optional["capo_ram.types.string.String"] = None,
    permission_version: Optional["capo_ram.types.integer.Integer"] = None,
    association_status: Optional[
        "capo_ram.types.resource_share_association_status.ResourceShareAssociationStatus"
    ] = None,
    resource_type: Optional["capo_ram.types.string.String"] = None,
    feature_set: Optional[
        "capo_ram.types.permission_feature_set.PermissionFeatureSet"
    ] = None,
    default_version: Optional["capo_ram.types.boolean.Boolean"] = None,
    next_token: Optional["capo_ram.types.string.String"] = None,
    max_results: Optional["capo_ram.types.max_results.MaxResults"] = None,
) -> "capo_ram.types.list_permission_associations_response.ListPermissionAssociationsResponse":
    """<p>Lists information about the managed permission and its associations to any resource shares that use this managed permission. This lets you see which resource shares use which versions of the specified managed permission.</p> <note> <p>Always check the <code>NextToken</code> response parameter for a <code>null</code> value when calling a paginated operation. These operations can occasionally return an empty set of results even when there are more results available. The <code>NextToken</code> response parameter value is <code>null</code> <i>only</i> when there are no more results to display.</p> </note>

    Args:
        permission_arn: <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the managed permission.</p>
        permission_version: <p>Specifies that you want to list only those associations with resource shares that use this version of the managed permission. If you don't provide a value for this parameter, then the operation returns information about associations with resource shares that use any version of the managed permission.</p>
        association_status: <p>Specifies that you want to list only those associations with resource shares that match this status.</p>
        resource_type: <p>Specifies that you want to list only those associations with resource shares that include at least one resource of this resource type.</p>
        feature_set: <p>Specifies that you want to list only those associations with resource shares that have a <code>featureSet</code> with this value.</p>
        default_version: <p>When <code>true</code>, specifies that you want to list only those associations with resource shares that use the default version of the specified managed permission.</p> <p>When <code>false</code> (the default value), lists associations with resource shares that use any version of the specified managed permission.</p>
        next_token: <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>NextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>NextToken</code> response to request the next page of results.</p>
        max_results: <p>Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the <code>NextToken</code> response element is returned with a value (not null). Include the specified value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>

    Raises:
        capo_ram.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The operation failed because the specified value for <code>NextToken</code> isn't valid. You must specify a value you received in the <code>NextToken</code> response of a previous call to this operation.</p>
        capo_ram.errors.invalid_parameter_exception.InvalidParameterException: <p>The operation failed because a parameter you specified isn't valid.</p>
        capo_ram.errors.malformed_arn_exception.MalformedArnException: <p>The operation failed because the specified <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> has a format that isn't valid.</p>
        capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
        capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
        capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ram.types.list_permission_associations_request.ListPermissionAssociationsRequest]",
    ) -> OperationResponse[
        "capo_ram.types.list_permission_associations_response.ListPermissionAssociationsResponse"
    ]:
        import capo_ram._operations.amazon_resource_sharing.list_permission_associations

        output, http_response = (
            capo_ram._operations.amazon_resource_sharing.list_permission_associations.list_permission_associations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPermissionAssociations")
    )
    input_: capo_ram.types.list_permission_associations_request.ListPermissionAssociationsRequest = {}
    if permission_arn is not None:
        input_["permission_arn"] = permission_arn
    if permission_version is not None:
        input_["permission_version"] = permission_version
    if association_status is not None:
        input_["association_status"] = association_status
    if resource_type is not None:
        input_["resource_type"] = resource_type
    if feature_set is not None:
        input_["feature_set"] = feature_set
    if default_version is not None:
        input_["default_version"] = default_version
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output