Skip to content

list_subscriptions

list_subscriptions(
    domain_identifier: DomainId,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    subscription_request_identifier: Optional[SubscriptionRequestId] = None,
    status: Optional[SubscriptionStatus] = None,
    subscribed_listing_id: Optional[ListingId] = None,
    owning_project_id: Optional[ProjectId] = None,
    owning_iam_principal_arn: Optional[IamPrincipalArn] = None,
    owning_user_id: Optional[UserProfileId] = None,
    owning_group_id: Optional[GroupProfileId] = None,
    approver_project_id: Optional[ProjectId] = None,
    sort_by: Optional[SortKey] = None,
    sort_order: Optional[SortOrder] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListSubscriptionsOutput

Lists subscriptions in Amazon DataZone.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the Amazon DataZone domain.

  • subscription_request_identifier (Optional[SubscriptionRequestId], default: None ) –

    The identifier of the subscription request for the subscriptions that you want to list.

  • status (Optional[SubscriptionStatus], default: None ) –

    The status of the subscriptions that you want to list.

    This is not a required parameter, but if not provided, by default, Amazon DataZone returns only APPROVED subscriptions.

  • subscribed_listing_id (Optional[ListingId], default: None ) –

    The identifier of the subscribed listing for the subscriptions that you want to list.

  • owning_project_id (Optional[ProjectId], default: None ) –

    The identifier of the owning project.

  • owning_iam_principal_arn (Optional[IamPrincipalArn], default: None ) –

    The ARN of the owning IAM principal.

  • owning_user_id (Optional[UserProfileId], default: None ) –

    The ID of the owning user.

  • owning_group_id (Optional[GroupProfileId], default: None ) –

    The ID of the owning group.

  • approver_project_id (Optional[ProjectId], default: None ) –

    The identifier of the project for the subscription's approver.

  • sort_by (Optional[SortKey], default: None ) –

    Specifies the way in which the results of this action are to be sorted.

  • sort_order (Optional[SortOrder], default: None ) –

    Specifies the sort order for the results of this action.

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

    The maximum number of subscriptions to return in a single call to ListSubscriptions. When the number of subscriptions to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListSubscriptions to list the next set of Subscriptions.

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

    When the number of subscriptions is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of subscriptions, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListSubscriptions to list the next set of subscriptions.

Raises:

Source code in docs_src/capo_datazone/_services/data_zone.py
def list_subscriptions(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    subscription_request_identifier: Optional[
        "capo_datazone.types.subscription_request_id.SubscriptionRequestId"
    ] = None,
    status: Optional[
        "capo_datazone.types.subscription_status.SubscriptionStatus"
    ] = None,
    subscribed_listing_id: Optional[
        "capo_datazone.types.listing_id.ListingId"
    ] = None,
    owning_project_id: Optional["capo_datazone.types.project_id.ProjectId"] = None,
    owning_iam_principal_arn: Optional[
        "capo_datazone.types.iam_principal_arn.IamPrincipalArn"
    ] = None,
    owning_user_id: Optional[
        "capo_datazone.types.user_profile_id.UserProfileId"
    ] = None,
    owning_group_id: Optional[
        "capo_datazone.types.group_profile_id.GroupProfileId"
    ] = None,
    approver_project_id: Optional[
        "capo_datazone.types.project_id.ProjectId"
    ] = None,
    sort_by: Optional["capo_datazone.types.sort_key.SortKey"] = None,
    sort_order: Optional["capo_datazone.types.sort_order.SortOrder"] = None,
    max_results: Optional["capo_datazone.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_datazone.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_datazone.types.list_subscriptions_output.ListSubscriptionsOutput":
    """<p>Lists subscriptions in Amazon DataZone.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon DataZone domain.</p>
        subscription_request_identifier: <p>The identifier of the subscription request for the subscriptions that you want to list.</p>
        status: <p>The status of the subscriptions that you want to list.</p> <note> <p>This is not a required parameter, but if not provided, by default, Amazon DataZone returns only <code>APPROVED</code> subscriptions. </p> </note>
        subscribed_listing_id: <p>The identifier of the subscribed listing for the subscriptions that you want to list.</p>
        owning_project_id: <p>The identifier of the owning project.</p>
        owning_iam_principal_arn: <p>The ARN of the owning IAM principal.</p>
        owning_user_id: <p>The ID of the owning user.</p>
        owning_group_id: <p>The ID of the owning group.</p>
        approver_project_id: <p>The identifier of the project for the subscription's approver.</p>
        sort_by: <p>Specifies the way in which the results of this action are to be sorted.</p>
        sort_order: <p>Specifies the sort order for the results of this action.</p>
        max_results: <p>The maximum number of subscriptions to return in a single call to <code>ListSubscriptions</code>. When the number of subscriptions to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>ListSubscriptions</code> to list the next set of Subscriptions. </p>
        next_token: <p>When the number of subscriptions is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of subscriptions, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListSubscriptions</code> to list the next set of subscriptions.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_datazone.types.list_subscriptions_input.ListSubscriptionsInput]",
    ) -> OperationResponse[
        "capo_datazone.types.list_subscriptions_output.ListSubscriptionsOutput"
    ]:
        import capo_datazone._operations.data_zone.list_subscriptions

        output, http_response = (
            capo_datazone._operations.data_zone.list_subscriptions.list_subscriptions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_datazone.types.list_subscriptions_output.ListSubscriptionsOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.list_subscriptions_output

        return capo_datazone.types.list_subscriptions_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListSubscriptions", redact_output=_redact_output),
    )
    input_: capo_datazone.types.list_subscriptions_input.ListSubscriptionsInput = {
        "domain_identifier": domain_identifier
    }
    if subscription_request_identifier is not None:
        input_["subscription_request_identifier"] = subscription_request_identifier
    if status is not None:
        input_["status"] = status
    if subscribed_listing_id is not None:
        input_["subscribed_listing_id"] = subscribed_listing_id
    if owning_project_id is not None:
        input_["owning_project_id"] = owning_project_id
    if owning_iam_principal_arn is not None:
        input_["owning_iam_principal_arn"] = owning_iam_principal_arn
    if owning_user_id is not None:
        input_["owning_user_id"] = owning_user_id
    if owning_group_id is not None:
        input_["owning_group_id"] = owning_group_id
    if approver_project_id is not None:
        input_["approver_project_id"] = approver_project_id
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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