async def list_accepted_portfolio_shares(
self,
*,
config_overrides: Optional[AsyncServiceCatalogClientConfig] = None,
accept_language: Optional[
"capo_service_catalog.types.accept_language.AcceptLanguage"
] = None,
page_token: Optional["capo_service_catalog.types.page_token.PageToken"] = None,
page_size: Optional[
"capo_service_catalog.types.page_size_max100.PageSizeMax100"
] = None,
portfolio_share_type: Optional[
"capo_service_catalog.types.portfolio_share_type.PortfolioShareType"
] = None,
) -> "capo_service_catalog.types.list_accepted_portfolio_shares_output.ListAcceptedPortfolioSharesOutput":
"""<p>Lists all imported portfolios for which account-to-account shares were accepted by this account. By specifying the <code>PortfolioShareType</code>, you can list portfolios for which organizational shares were accepted by this account.</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>
page_token: <p>The page token for the next set of results. To retrieve the first set of results, use null.</p>
page_size: <p>The maximum number of items to return with this call.</p>
portfolio_share_type: <p>The type of shared portfolios to list. The default is to list imported portfolios.</p> <ul> <li> <p> <code>AWS_ORGANIZATIONS</code> - List portfolios accepted and shared via organizational sharing by the management account or delegated administrator of your organization.</p> </li> <li> <p> <code>AWS_SERVICECATALOG</code> - Deprecated type.</p> </li> <li> <p> <code>IMPORTED</code> - List imported portfolios that have been accepted and shared through account-to-account sharing.</p> </li> </ul>
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.operation_not_supported_exception.OperationNotSupportedException: <p>The operation is not supported.</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.list_accepted_portfolio_shares_input.ListAcceptedPortfolioSharesInput]",
) -> AsyncOperationResponse[
"capo_service_catalog.types.list_accepted_portfolio_shares_output.ListAcceptedPortfolioSharesOutput"
]:
if req.options.protocol == "awsJson1_1":
import capo_service_catalog._operations.aws242_service_catalog_service.aws_json1_1.list_accepted_portfolio_shares
(
output,
http_response,
) = await capo_service_catalog._operations.aws242_service_catalog_service.aws_json1_1.list_accepted_portfolio_shares.async_list_accepted_portfolio_shares(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_service_catalog._operations.aws242_service_catalog_service.rpcv2_cbor.list_accepted_portfolio_shares
(
output,
http_response,
) = await capo_service_catalog._operations.aws242_service_catalog_service.rpcv2_cbor.list_accepted_portfolio_shares.async_list_accepted_portfolio_shares(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListAcceptedPortfolioShares")
)
input_: capo_service_catalog.types.list_accepted_portfolio_shares_input.ListAcceptedPortfolioSharesInput = {}
if accept_language is not None:
input_["accept_language"] = accept_language
if page_token is not None:
input_["page_token"] = page_token
if page_size is not None:
input_["page_size"] = page_size
if portfolio_share_type is not None:
input_["portfolio_share_type"] = portfolio_share_type
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output