Skip to content

disassociate_product_from_portfolio

disassociate_product_from_portfolio(
    product_id: Id,
    portfolio_id: Id,
    *,
    config_overrides: Optional[ServiceCatalogClientConfig] = None,
    accept_language: Optional[AcceptLanguage] = None,
) -> DisassociateProductFromPortfolioOutput

Disassociates the specified product from the specified portfolio.

A delegated admin is authorized to invoke this command.

Parameters:

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

    The language code.

    • jp - Japanese

    • zh - Chinese

  • product_id (Id) –

    The product identifier.

  • portfolio_id (Id) –

    The portfolio identifier.

Raises:

Source code in docs_src/capo_service_catalog/_services/service_catalog.py
def disassociate_product_from_portfolio(
    self,
    product_id: "capo_service_catalog.types.id.Id",
    portfolio_id: "capo_service_catalog.types.id.Id",
    *,
    config_overrides: Optional[ServiceCatalogClientConfig] = None,
    accept_language: Optional[
        "capo_service_catalog.types.accept_language.AcceptLanguage"
    ] = None,
) -> "capo_service_catalog.types.disassociate_product_from_portfolio_output.DisassociateProductFromPortfolioOutput":
    """<p>Disassociates the specified product from the specified portfolio. </p> <p>A delegated admin is authorized to invoke this command.</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>
        product_id: <p>The product identifier.</p>
        portfolio_id: <p>The portfolio identifier.</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.resource_in_use_exception.ResourceInUseException: <p>A resource that is currently in use. Ensure that the resource is not in use and retry the operation.</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.
    """

    def _handler(
        req: "OperationRequest[capo_service_catalog.types.disassociate_product_from_portfolio_input.DisassociateProductFromPortfolioInput]",
    ) -> OperationResponse[
        "capo_service_catalog.types.disassociate_product_from_portfolio_output.DisassociateProductFromPortfolioOutput"
    ]:
        import capo_service_catalog._operations.aws242_service_catalog_service.disassociate_product_from_portfolio

        output, http_response = (
            capo_service_catalog._operations.aws242_service_catalog_service.disassociate_product_from_portfolio.disassociate_product_from_portfolio(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateProductFromPortfolio")
    )
    input_: capo_service_catalog.types.disassociate_product_from_portfolio_input.DisassociateProductFromPortfolioInput = {
        "product_id": product_id,
        "portfolio_id": portfolio_id,
    }
    if accept_language is not None:
        input_["accept_language"] = accept_language

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