def associate_api(
self,
domain_name: "capo_appsync.types.domain_name.DomainName",
api_id: "capo_appsync.types.string.String",
*,
config_overrides: Optional[AppSyncClientConfig] = None,
) -> "capo_appsync.types.associate_api_response.AssociateApiResponse":
"""<p>Maps an endpoint to your custom domain.</p>
Args:
domain_name: <p>The domain name.</p>
api_id: <p>The API ID. Private APIs can not be associated with custom domains.</p>
Raises:
capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
capo_appsync.errors.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</p>
capo_appsync.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_appsync.types.associate_api_request.AssociateApiRequest]",
) -> OperationResponse[
"capo_appsync.types.associate_api_response.AssociateApiResponse"
]:
import capo_appsync._operations.aws_deepdish_control_plane_service.associate_api
output, http_response = (
capo_appsync._operations.aws_deepdish_control_plane_service.associate_api.associate_api(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateApi")
)
input_: capo_appsync.types.associate_api_request.AssociateApiRequest = {
"domain_name": domain_name,
"api_id": api_id,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output