Skip to content

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#

Check if an operation can be paginated.

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:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("cost-optimization-hub").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

generate_presigned_url#

Generate a presigned url given a client, its method, and arguments.

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)
    ...
  1. See GetPreferencesResponseTypeDef

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)
    ...
  1. See GetRecommendationResponseTypeDef
# get_recommendation method usage example with argument unpacking

kwargs: GetRecommendationRequestRequestTypeDef = {  # (1)
    "recommendationId": ...,
}

parent.get_recommendation(**kwargs)
  1. See GetRecommendationRequestRequestTypeDef

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,
    *,
    accountId: str = ...,
    includeOrganizationInfo: bool = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> ListEnrollmentStatusesResponseTypeDef:  # (1)
    ...
  1. See ListEnrollmentStatusesResponseTypeDef
# list_enrollment_statuses method usage example with argument unpacking

kwargs: ListEnrollmentStatusesRequestRequestTypeDef = {  # (1)
    "accountId": ...,
}

parent.list_enrollment_statuses(**kwargs)
  1. See ListEnrollmentStatusesRequestRequestTypeDef

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 = ...,
    nextToken: str = ...,
) -> ListRecommendationSummariesResponseTypeDef:  # (2)
    ...
  1. See FilterTypeDef
  2. See ListRecommendationSummariesResponseTypeDef
# list_recommendation_summaries method usage example with argument unpacking

kwargs: ListRecommendationSummariesRequestRequestTypeDef = {  # (1)
    "groupBy": ...,
}

parent.list_recommendation_summaries(**kwargs)
  1. See ListRecommendationSummariesRequestRequestTypeDef

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)
    includeAllRecommendations: bool = ...,
    maxResults: int = ...,
    nextToken: str = ...,
    orderBy: OrderByTypeDef = ...,  # (2)
) -> ListRecommendationsResponseTypeDef:  # (3)
    ...
  1. See FilterTypeDef
  2. See OrderByTypeDef
  3. See ListRecommendationsResponseTypeDef
# list_recommendations method usage example with argument unpacking

kwargs: ListRecommendationsRequestRequestTypeDef = {  # (1)
    "filter": ...,
}

parent.list_recommendations(**kwargs)
  1. See ListRecommendationsRequestRequestTypeDef

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)
    ...
  1. See EnrollmentStatusType
  2. See UpdateEnrollmentStatusResponseTypeDef
# update_enrollment_status method usage example with argument unpacking

kwargs: UpdateEnrollmentStatusRequestRequestTypeDef = {  # (1)
    "status": ...,
}

parent.update_enrollment_status(**kwargs)
  1. See UpdateEnrollmentStatusRequestRequestTypeDef

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,
    *,
    memberAccountDiscountVisibility: MemberAccountDiscountVisibilityType = ...,  # (1)
    savingsEstimationMode: SavingsEstimationModeType = ...,  # (2)
) -> UpdatePreferencesResponseTypeDef:  # (3)
    ...
  1. See MemberAccountDiscountVisibilityType
  2. See SavingsEstimationModeType
  3. See UpdatePreferencesResponseTypeDef
# update_preferences method usage example with argument unpacking

kwargs: UpdatePreferencesRequestRequestTypeDef = {  # (1)
    "memberAccountDiscountVisibility": ...,
}

parent.update_preferences(**kwargs)
  1. See UpdatePreferencesRequestRequestTypeDef

get_paginator#

Type annotations and code completion for boto3.client("cost-optimization-hub").get_paginator method with overloads.