CostOptimizationHubClient#
Index > CostOptimizationHub > CostOptimizationHubClient
Auto-generated documentation for CostOptimizationHub type annotations stubs module mypy-boto3-cost-optimization-hub.
CostOptimizationHubClient#
Type annotations and code completion for boto3.client("cost-optimization-hub")
.
boto3 documentation
# CostOptimizationHubClient usage example
from boto3.session import Session
from mypy_boto3_cost_optimization_hub.client import CostOptimizationHubClient
def get_cost-optimization-hub_client() -> CostOptimizationHubClient:
return Session().client("cost-optimization-hub")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("cost-optimization-hub").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("cost-optimization-hub")
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)
# Exceptions.exceptions type checking example
from mypy_boto3_cost_optimization_hub.client import Exceptions
def handle_error(exc: Exceptions.AccessDeniedException) -> None:
...
Methods#
can_paginate#
Type annotations and code completion for boto3.client("cost-optimization-hub").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
generate_presigned_url#
Type annotations and code completion for boto3.client("cost-optimization-hub").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
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 boto3.client("cost-optimization-hub").get_preferences
method.
boto3 documentation
# get_preferences method definition
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 boto3.client("cost-optimization-hub").get_recommendation
method.
boto3 documentation
# get_recommendation method definition
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 boto3.client("cost-optimization-hub").list_enrollment_statuses
method.
boto3 documentation
# list_enrollment_statuses method definition
def list_enrollment_statuses(
self,
*,
includeOrganizationInfo: bool = ...,
accountId: str = ...,
nextToken: str = ...,
maxResults: int = ...,
) -> ListEnrollmentStatusesResponseTypeDef: # (1)
...
# list_enrollment_statuses method usage example with argument unpacking
kwargs: ListEnrollmentStatusesRequestRequestTypeDef = { # (1)
"includeOrganizationInfo": ...,
}
parent.list_enrollment_statuses(**kwargs)
list_recommendation_summaries#
Returns a concise representation of savings estimates for resources.
Type annotations and code completion for boto3.client("cost-optimization-hub").list_recommendation_summaries
method.
boto3 documentation
# list_recommendation_summaries method definition
def list_recommendation_summaries(
self,
*,
groupBy: str,
filter: FilterTypeDef = ..., # (1)
maxResults: int = ...,
metrics: Sequence[SummaryMetricsType] = ..., # (2)
nextToken: str = ...,
) -> ListRecommendationSummariesResponseTypeDef: # (3)
...
# 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 boto3.client("cost-optimization-hub").list_recommendations
method.
boto3 documentation
# list_recommendations method definition
def list_recommendations(
self,
*,
filter: FilterTypeDef = ..., # (1)
orderBy: OrderByTypeDef = ..., # (2)
includeAllRecommendations: bool = ...,
maxResults: int = ...,
nextToken: str = ...,
) -> 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 boto3.client("cost-optimization-hub").update_enrollment_status
method.
boto3 documentation
# update_enrollment_status method definition
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 boto3.client("cost-optimization-hub").update_preferences
method.
boto3 documentation
# update_preferences method definition
def update_preferences(
self,
*,
savingsEstimationMode: SavingsEstimationModeType = ..., # (1)
memberAccountDiscountVisibility: MemberAccountDiscountVisibilityType = ..., # (2)
) -> UpdatePreferencesResponseTypeDef: # (3)
...
- See SavingsEstimationModeType
- See MemberAccountDiscountVisibilityType
- See UpdatePreferencesResponseTypeDef
# update_preferences method usage example with argument unpacking
kwargs: UpdatePreferencesRequestRequestTypeDef = { # (1)
"savingsEstimationMode": ...,
}
parent.update_preferences(**kwargs)
get_paginator#
Type annotations and code completion for boto3.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