Skip to content

update_type

update_type(
    api_id: String,
    type_name: ResourceName,
    format: TypeDefinitionFormat,
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    definition: Optional[String] = None,
) -> UpdateTypeResponse

Updates a Type object.

Parameters:

Raises:

  • BadRequestException –

    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.

  • ConcurrentModificationException –

    Another modification is in progress at this time and it must complete before you can make your change.

  • InternalFailureException –

    An internal AppSync error occurred. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource, and then try again.

  • UnauthorizedException –

    You aren't authorized to perform this operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appsync/_services/app_sync.py
def update_type(
    self,
    api_id: "capo_appsync.types.string.String",
    type_name: "capo_appsync.types.resource_name.ResourceName",
    format: "capo_appsync.types.type_definition_format.TypeDefinitionFormat",
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    definition: Optional["capo_appsync.types.string.String"] = None,
) -> "capo_appsync.types.update_type_response.UpdateTypeResponse":
    """<p>Updates a <code>Type</code> object.</p>

    Args:
        api_id: <p>The API ID.</p>
        type_name: <p>The new type name.</p>
        definition: <p>The new definition.</p>
        format: <p>The new type format: SDL or JSON.</p>

    Raises:
        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.concurrent_modification_exception.ConcurrentModificationException: <p>Another modification is in progress at this time and it must complete before you can make your change.</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.unauthorized_exception.UnauthorizedException: <p>You aren't authorized to perform this operation.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appsync.types.update_type_request.UpdateTypeRequest]",
    ) -> OperationResponse[
        "capo_appsync.types.update_type_response.UpdateTypeResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.update_type

        output, http_response = (
            capo_appsync._operations.aws_deepdish_control_plane_service.update_type.update_type(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateType")
    )
    input_: capo_appsync.types.update_type_request.UpdateTypeRequest = {
        "api_id": api_id,
        "type_name": type_name,
        "format": format,
    }
    if definition is not None:
        input_["definition"] = definition

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