CostOptimizationHubClient#
Index > CostOptimizationHub > CostOptimizationHubClient
Auto-generated documentation for CostOptimizationHub type annotations stubs module types-aiobotocore-cost-optimization-hub.
CostOptimizationHubClient#
Type annotations and code completion for session.client("cost-optimization-hub")
boto3 documentation
# CostOptimizationHubClient usage example
from aioboto3.session import Session
from types_aiobotocore_cost_optimization_hub.client import CostOptimizationHubClient
session = Session()
async with session.client("cost-optimization-hub") as client:
client: CostOptimizationHubClient
Exceptions#
aioboto3
client exceptions are generated in runtime.
This class provides code completion for session.client("cost-optimization-hub").exceptions
structure.
# CostOptimizationHubClient.exceptions usage example
async with session.client("cost-optimization-hub") as client:
try:
do_something(client)
except (
client.exceptions.AccessDeniedException,
client.exceptions.ClientError,
client.exceptions.InternalServerException,
client.exceptions.ResourceNotFoundException,
client.exceptions.ThrottlingException,
client.exceptions.ValidationException,
) as e:
print(e)
# CostOptimizationHubClient.exceptions type checking example
from types_aiobotocore_cost_optimization_hub.client import Exceptions
def handle_error(exc: Exceptions.AccessDeniedException) -> None:
...
Methods#
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for session.client("cost-optimization-hub").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
close#
Closes underlying endpoint connections.
Type annotations and code completion for session.client("cost-optimization-hub").close
method.
boto3 documentation
# close method definition
await def close(
self,
) -> None:
...
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for session.client("cost-optimization-hub").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
await def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_preferences#
Returns a set of preferences for an account in order to add account-specific preferences into the service.
Type annotations and code completion for session.client("cost-optimization-hub").get_preferences
method.
boto3 documentation
# get_preferences method definition
await def get_preferences(
self,
) -> GetPreferencesResponseTypeDef: # (1)
...
get_recommendation#
Returns both the current and recommended resource configuration and the estimated cost impact for a recommendation.
Type annotations and code completion for session.client("cost-optimization-hub").get_recommendation
method.
boto3 documentation
# get_recommendation method definition
await def get_recommendation(
self,
*,
recommendationId: str,
) -> GetRecommendationResponseTypeDef: # (1)
...
# get_recommendation method usage example with argument unpacking
kwargs: GetRecommendationRequestRequestTypeDef = { # (1)
"recommendationId": ...,
}
parent.get_recommendation(**kwargs)
list_enrollment_statuses#
Retrieves the enrollment status for an account.
Type annotations and code completion for session.client("cost-optimization-hub").list_enrollment_statuses
method.
boto3 documentation
# list_enrollment_statuses method definition
await def list_enrollment_statuses(
self,
*,
accountId: str = ...,
includeOrganizationInfo: bool = ...,
maxResults: int = ...,
nextToken: str = ...,
) -> ListEnrollmentStatusesResponseTypeDef: # (1)
...
# list_enrollment_statuses method usage example with argument unpacking
kwargs: ListEnrollmentStatusesRequestRequestTypeDef = { # (1)
"accountId": ...,
}
parent.list_enrollment_statuses(**kwargs)
list_recommendation_summaries#
Returns a concise representation of savings estimates for resources.
Type annotations and code completion for session.client("cost-optimization-hub").list_recommendation_summaries
method.
boto3 documentation
# list_recommendation_summaries method definition
await def list_recommendation_summaries(
self,
*,
groupBy: str,
filter: FilterTypeDef = ..., # (1)
maxResults: int = ...,
nextToken: str = ...,
) -> ListRecommendationSummariesResponseTypeDef: # (2)
...
# list_recommendation_summaries method usage example with argument unpacking
kwargs: ListRecommendationSummariesRequestRequestTypeDef = { # (1)
"groupBy": ...,
}
parent.list_recommendation_summaries(**kwargs)
list_recommendations#
Returns a list of recommendations.
Type annotations and code completion for session.client("cost-optimization-hub").list_recommendations
method.
boto3 documentation
# list_recommendations method definition
await def list_recommendations(
self,
*,
filter: FilterTypeDef = ..., # (1)
includeAllRecommendations: bool = ...,
maxResults: int = ...,
nextToken: str = ...,
orderBy: OrderByTypeDef = ..., # (2)
) -> ListRecommendationsResponseTypeDef: # (3)
...
# list_recommendations method usage example with argument unpacking
kwargs: ListRecommendationsRequestRequestTypeDef = { # (1)
"filter": ...,
}
parent.list_recommendations(**kwargs)
update_enrollment_status#
Updates the enrollment (opt in and opt out) status of an account to the Cost Optimization Hub service.
Type annotations and code completion for session.client("cost-optimization-hub").update_enrollment_status
method.
boto3 documentation
# update_enrollment_status method definition
await def update_enrollment_status(
self,
*,
status: EnrollmentStatusType, # (1)
includeMemberAccounts: bool = ...,
) -> UpdateEnrollmentStatusResponseTypeDef: # (2)
...
# update_enrollment_status method usage example with argument unpacking
kwargs: UpdateEnrollmentStatusRequestRequestTypeDef = { # (1)
"status": ...,
}
parent.update_enrollment_status(**kwargs)
update_preferences#
Updates a set of preferences for an account in order to add account-specific preferences into the service.
Type annotations and code completion for session.client("cost-optimization-hub").update_preferences
method.
boto3 documentation
# update_preferences method definition
await def update_preferences(
self,
*,
memberAccountDiscountVisibility: MemberAccountDiscountVisibilityType = ..., # (1)
savingsEstimationMode: SavingsEstimationModeType = ..., # (2)
) -> UpdatePreferencesResponseTypeDef: # (3)
...
- See MemberAccountDiscountVisibilityType
- See SavingsEstimationModeType
- See UpdatePreferencesResponseTypeDef
# update_preferences method usage example with argument unpacking
kwargs: UpdatePreferencesRequestRequestTypeDef = { # (1)
"memberAccountDiscountVisibility": ...,
}
parent.update_preferences(**kwargs)
__aenter__#
Type annotations and code completion for session.client("cost-optimization-hub").__aenter__
method.
boto3 documentation
# __aenter__ method definition
await def __aenter__(
self,
) -> CostOptimizationHubClient:
...
__aexit__#
Type annotations and code completion for session.client("cost-optimization-hub").__aexit__
method.
boto3 documentation
# __aexit__ method definition
await def __aexit__(
self,
exc_type: Any,
exc_val: Any,
exc_tb: Any,
) -> Any:
...
get_paginator#
Type annotations and code completion for session.client("cost-optimization-hub").get_paginator
method with overloads.
client.get_paginator("list_enrollment_statuses")
-> ListEnrollmentStatusesPaginatorclient.get_paginator("list_recommendation_summaries")
-> ListRecommendationSummariesPaginatorclient.get_paginator("list_recommendations")
-> ListRecommendationsPaginator