Skip to content

delete_portfolio_share async

delete_portfolio_share(
    portfolio_id: Id,
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    accept_language: Optional[AcceptLanguage] = None,
    account_id: Optional[AccountId] = None,
    organization_node: Optional[OrganizationNode] = None,
) -> DeletePortfolioShareOutput

Stops sharing the specified portfolio with the specified account or organization node. Shares to an organization node can only be deleted by the management account of an organization or by a delegated administrator.

Note that if a delegated admin is de-registered, portfolio shares created from that account are removed.

Parameters:

  • accept_language (Optional[AcceptLanguage], default: None ) –

    The language code.

    • jp - Japanese

    • zh - Chinese

  • portfolio_id (Id) –

    The portfolio identifier.

  • account_id (Optional[AccountId], default: None ) –

    The Amazon Web Services account ID.

  • organization_node (Optional[OrganizationNode], default: None ) –

    The organization node to whom you are going to stop sharing.

Raises:

Source code in docs_src/capo_service_catalog/_services/async_service_catalog.py
async def delete_portfolio_share(
    self,
    portfolio_id: "capo_service_catalog.types.id.Id",
    *,
    config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
    accept_language: Optional[
        "capo_service_catalog.types.accept_language.AcceptLanguage"
    ] = None,
    account_id: Optional["capo_service_catalog.types.account_id.AccountId"] = None,
    organization_node: Optional[
        "capo_service_catalog.types.organization_node.OrganizationNode"
    ] = None,
) -> "capo_service_catalog.types.delete_portfolio_share_output.DeletePortfolioShareOutput":
    """<p>Stops sharing the specified portfolio with the specified account or organization node. Shares to an organization node can only be deleted by the management account of an organization or by a delegated administrator.</p> <p>Note that if a delegated admin is de-registered, portfolio shares created from that account are removed.</p>

    Args:
        accept_language: <p>The language code.</p> <ul> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>
        portfolio_id: <p>The portfolio identifier.</p>
        account_id: <p>The Amazon Web Services account ID.</p>
        organization_node: <p>The organization node to whom you are going to stop sharing.</p>

    Raises:
        capo_service_catalog.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the operation are not valid.</p>
        capo_service_catalog.errors.invalid_state_exception.InvalidStateException: <p>An attempt was made to modify a resource that is in a state that is not valid. Check your resources to ensure that they are in valid states before retrying the operation.</p>
        capo_service_catalog.errors.operation_not_supported_exception.OperationNotSupportedException: <p>The operation is not supported.</p>
        capo_service_catalog.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_service_catalog.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_service_catalog.types.delete_portfolio_share_input.DeletePortfolioShareInput]",
    ) -> AsyncOperationResponse[
        "capo_service_catalog.types.delete_portfolio_share_output.DeletePortfolioShareOutput"
    ]:
        import capo_service_catalog._operations.aws242_service_catalog_service.delete_portfolio_share

        (
            output,
            http_response,
        ) = await capo_service_catalog._operations.aws242_service_catalog_service.delete_portfolio_share.async_delete_portfolio_share(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeletePortfolioShare")
    )
    input_: capo_service_catalog.types.delete_portfolio_share_input.DeletePortfolioShareInput = {
        "portfolio_id": portfolio_id
    }
    if accept_language is not None:
        input_["accept_language"] = accept_language
    if account_id is not None:
        input_["account_id"] = account_id
    if organization_node is not None:
        input_["organization_node"] = organization_node

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