def create_backend_auth(
self,
app_id: "capo_amplifybackend.types.__string.__string",
*,
config_overrides: Optional[AmplifyBackendClientConfig] = None,
backend_environment_name: Optional[
"capo_amplifybackend.types.__string.__string"
] = None,
resource_config: Optional[
"capo_amplifybackend.types.create_backend_auth_resource_config.CreateBackendAuthResourceConfig"
] = None,
resource_name: Optional["capo_amplifybackend.types.__string.__string"] = None,
) -> "capo_amplifybackend.types.create_backend_auth_response.CreateBackendAuthResponse":
"""<p>Creates a new backend authentication resource.</p>
Args:
app_id: <p>The app ID.</p>
backend_environment_name: <p>The name of the backend environment.</p>
resource_config: <p>The resource configuration for this request object.</p>
resource_name: <p>The name of this resource.</p>
Raises:
capo_amplifybackend.errors.bad_request_exception.BadRequestException: <p>An error returned if a request is not formed properly.</p>
capo_amplifybackend.errors.gateway_timeout_exception.GatewayTimeoutException: <p>An error returned if there's a temporary issue with the service.</p>
capo_amplifybackend.errors.not_found_exception.NotFoundException: <p>An error returned when a specific resource type is not found.</p>
capo_amplifybackend.errors.too_many_requests_exception.TooManyRequestsException: <p>An error that is returned when a limit of a specific type has been exceeded.</p>
capo_amplifybackend.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_amplifybackend.types.create_backend_auth_request.CreateBackendAuthRequest]",
) -> OperationResponse[
"capo_amplifybackend.types.create_backend_auth_response.CreateBackendAuthResponse"
]:
import capo_amplifybackend._operations.amplify_backend.create_backend_auth
output, http_response = (
capo_amplifybackend._operations.amplify_backend.create_backend_auth.create_backend_auth(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_amplifybackend.types.create_backend_auth_request.CreateBackendAuthRequest",
) -> dict[str, Any]:
import capo_amplifybackend.types.create_backend_auth_request
return (
capo_amplifybackend.types.create_backend_auth_request.redact_sensitive(
input_
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreateBackendAuth", redact_input=_redact_input),
)
input_: capo_amplifybackend.types.create_backend_auth_request.CreateBackendAuthRequest = {
"app_id": app_id
}
if backend_environment_name is not None:
input_["backend_environment_name"] = backend_environment_name
if resource_config is not None:
input_["resource_config"] = resource_config
if resource_name is not None:
input_["resource_name"] = resource_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output