Skip to content

list_connection_items async

list_connection_items(
    environment_arn: EnvironmentArn,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    connection_id: Optional[ConnectionId] = None,
    provider_config: Optional[ConnectionProviderKey] = None,
    parent_id: Optional[ConnectionItemId] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListConnectionItemsOutput

Lists the items that a connection can access, one level at a time, to help you find a document without knowing its URL. The list contains only items that the connection is authorized to access. If more results are available, the response includes nextToken. To get the next page, call this operation again with that token.

To list the top level, omit parentId. To list the contents of an item, such as a repository, site, library, or folder, specify its id. You can't list the contents of a FILE.

Parameters:

  • environment_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of this governance environment.

  • connection_id (Optional[ConnectionId], default: None ) –

    The ID of the GitHub or SharePoint connection to browse, as returned by ListEnvironmentConnections. An Amazon S3 connection has no ID. To browse one, use providerConfig.

    Specify either connectionId or providerConfig, but not both.

  • provider_config (Optional[ConnectionProviderKey], default: None ) –

    The connection to browse, identified by what it connects to.

  • parent_id (Optional[ConnectionItemId], default: None ) –

    The ID of the item whose contents you want to list. To list the top level, omit this parameter.

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

    The maximum number of items to return on one page. If you omit it, the operation uses its default page size.

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

    The token for the next page of results, from a previous response.

Raises:

Examples:

Browse an S3 connection Lists the prefixes and objects at the top of an S3 connection, named by its source URI.

>>> await client.list_connection_items(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', provider_config={'s3': {'sourceUri': 's3://payments-prod-evidence/pci-dss/'}})
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def list_connection_items(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    connection_id: Optional[
        "capo_assurance.types.connection_id.ConnectionId"
    ] = None,
    provider_config: Optional[
        "capo_assurance.types.connection_provider_key.ConnectionProviderKey"
    ] = None,
    parent_id: Optional[
        "capo_assurance.types.connection_item_id.ConnectionItemId"
    ] = None,
    max_results: Optional["capo_assurance.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_assurance.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_assurance.types.list_connection_items_output.ListConnectionItemsOutput":
    """<p>Lists the items that a connection can access, one level at a time, to help you find a document without knowing its URL. The list contains only items that the connection is authorized to access. If more results are available, the response includes <code>nextToken</code>. To get the next page, call this operation again with that token.</p> <p>To list the top level, omit <code>parentId</code>. To list the contents of an item, such as a repository, site, library, or folder, specify its <code>id</code>. You can't list the contents of a <code>FILE</code>.</p>

    Args:
        environment_arn: <p>The Amazon Resource Name (ARN) of this governance environment.</p>
        connection_id: <p>The ID of the GitHub or SharePoint connection to browse, as returned by <code>ListEnvironmentConnections</code>. An Amazon S3 connection has no ID. To browse one, use <code>providerConfig</code>.</p> <p>Specify either <code>connectionId</code> or <code>providerConfig</code>, but not both.</p>
        provider_config: <p>The connection to browse, identified by what it connects to.</p>
        parent_id: <p>The ID of the item whose contents you want to list. To list the top level, omit this parameter.</p>
        max_results: <p>The maximum number of items to return on one page. If you omit it, the operation uses its default page size.</p>
        next_token: <p>The token for the next page of results, from a previous response.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Browse an S3 connection
        Lists the prefixes and objects at the top of an S3 connection, named by its source URI.

        >>> await client.list_connection_items(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', provider_config={'s3': {'sourceUri': 's3://payments-prod-evidence/pci-dss/'}})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.list_connection_items_input.ListConnectionItemsInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.list_connection_items_output.ListConnectionItemsOutput"
    ]:
        import capo_assurance._operations.assurance.list_connection_items

        (
            output,
            http_response,
        ) = await capo_assurance._operations.assurance.list_connection_items.async_list_connection_items(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_assurance.types.list_connection_items_input.ListConnectionItemsInput",
    ) -> dict[str, Any]:
        import capo_assurance.types.list_connection_items_input

        return capo_assurance.types.list_connection_items_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_assurance.types.list_connection_items_output.ListConnectionItemsOutput",
    ) -> dict[str, Any]:
        import capo_assurance.types.list_connection_items_output

        return capo_assurance.types.list_connection_items_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListConnectionItems",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_assurance.types.list_connection_items_input.ListConnectionItemsInput = {
        "environment_arn": environment_arn
    }
    if connection_id is not None:
        input_["connection_id"] = connection_id
    if provider_config is not None:
        input_["provider_config"] = provider_config
    if parent_id is not None:
        input_["parent_id"] = parent_id
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output