Skip to content

update_authorizer

update_authorizer(
    authorizer_name: AuthorizerName,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    authorizer_function_arn: Optional[AuthorizerFunctionArn] = None,
    token_key_name: Optional[TokenKeyName] = None,
    token_signing_public_keys: Optional[PublicKeyMap] = None,
    status: Optional[AuthorizerStatus] = None,
    enable_caching_for_http: Optional[EnableCachingForHttp] = None,
) -> UpdateAuthorizerResponse

Updates an authorizer.

Requires permission to access the UpdateAuthorizer action.

Parameters:

  • authorizer_name (AuthorizerName) –

    The authorizer name.

  • authorizer_function_arn (Optional[AuthorizerFunctionArn], default: None ) –

    The ARN of the authorizer's Lambda function.

  • token_key_name (Optional[TokenKeyName], default: None ) –

    The key used to extract the token from the HTTP headers.

  • token_signing_public_keys (Optional[PublicKeyMap], default: None ) –

    The public keys used to verify the token signature.

  • status (Optional[AuthorizerStatus], default: None ) –

    The status of the update authorizer request.

  • enable_caching_for_http (Optional[EnableCachingForHttp], default: None ) –

    When true, the result from the authorizer’s Lambda function is cached for the time specified in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def update_authorizer(
    self,
    authorizer_name: "capo_iot.types.authorizer_name.AuthorizerName",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    authorizer_function_arn: Optional[
        "capo_iot.types.authorizer_function_arn.AuthorizerFunctionArn"
    ] = None,
    token_key_name: Optional["capo_iot.types.token_key_name.TokenKeyName"] = None,
    token_signing_public_keys: Optional[
        "capo_iot.types.public_key_map.PublicKeyMap"
    ] = None,
    status: Optional["capo_iot.types.authorizer_status.AuthorizerStatus"] = None,
    enable_caching_for_http: Optional[
        "capo_iot.types.enable_caching_for_http.EnableCachingForHttp"
    ] = None,
) -> "capo_iot.types.update_authorizer_response.UpdateAuthorizerResponse":
    """<p>Updates an authorizer.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdateAuthorizer</a> action.</p>

    Args:
        authorizer_name: <p>The authorizer name.</p>
        authorizer_function_arn: <p>The ARN of the authorizer's Lambda function.</p>
        token_key_name: <p>The key used to extract the token from the HTTP headers. </p>
        token_signing_public_keys: <p>The public keys used to verify the token signature.</p>
        status: <p>The status of the update authorizer request.</p>
        enable_caching_for_http: <p>When <code>true</code>, the result from the authorizer’s Lambda function is cached for the time specified in <code>refreshAfterInSeconds</code>. The cached result is used while the device reuses the same HTTP connection.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.update_authorizer_request.UpdateAuthorizerRequest]",
    ) -> OperationResponse[
        "capo_iot.types.update_authorizer_response.UpdateAuthorizerResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_authorizer

        output, http_response = (
            capo_iot._operations.aws_iot_service.update_authorizer.update_authorizer(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAuthorizer")
    )
    input_: capo_iot.types.update_authorizer_request.UpdateAuthorizerRequest = {
        "authorizer_name": authorizer_name
    }
    if authorizer_function_arn is not None:
        input_["authorizer_function_arn"] = authorizer_function_arn
    if token_key_name is not None:
        input_["token_key_name"] = token_key_name
    if token_signing_public_keys is not None:
        input_["token_signing_public_keys"] = token_signing_public_keys
    if status is not None:
        input_["status"] = status
    if enable_caching_for_http is not None:
        input_["enable_caching_for_http"] = enable_caching_for_http

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output