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/service_catalog.py
| def delete_portfolio_share(
self,
portfolio_id: "capo_service_catalog.types.id.Id",
*,
config_overrides: Optional[ServiceCatalogClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_service_catalog.types.delete_portfolio_share_input.DeletePortfolioShareInput]",
) -> OperationResponse[
"capo_service_catalog.types.delete_portfolio_share_output.DeletePortfolioShareOutput"
]:
if req.options.protocol == "awsJson1_1":
import capo_service_catalog._operations.aws242_service_catalog_service.aws_json1_1.delete_portfolio_share
output, http_response = (
capo_service_catalog._operations.aws242_service_catalog_service.aws_json1_1.delete_portfolio_share.delete_portfolio_share(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_service_catalog._operations.aws242_service_catalog_service.rpcv2_cbor.delete_portfolio_share
output, http_response = (
capo_service_catalog._operations.aws242_service_catalog_service.rpcv2_cbor.delete_portfolio_share.delete_portfolio_share(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|