def generate_delete_method()

in src/sagemaker_core/tools/resources_codegen.py [0:0]


    def generate_delete_method(self, resource_name: str, **kwargs) -> str:
        """Auto-Generate 'delete' object Method [delete API] for a resource.

        Args:
            resource_name (str): The resource name.

        Returns:
            str: The formatted delete Method template.
        """
        operation_name = "Delete" + resource_name
        operation_metadata = self.operations[operation_name]
        resource_operation_input_shape_name = operation_metadata["input"]["shape"]

        # Generate the arguments for the 'update' method
        delete_args = self._generate_method_args(
            resource_operation_input_shape_name, kwargs["resource_attributes"]
        )
        operation_input_args = self._generate_operation_input_necessary_args(
            operation_metadata, kwargs["resource_attributes"]
        )

        operation = convert_to_snake_case(operation_name)

        # generate docstring
        docstring = self._generate_docstring(
            title=f"Delete a {resource_name} resource",
            operation_name=operation_name,
            resource_name=resource_name,
            include_session_region=False,
            include_return_resource_docstring=False,
        )

        formatted_method = DELETE_METHOD_TEMPLATE.format(
            docstring=docstring,
            resource_name=resource_name,
            delete_args=delete_args,
            operation_input_args=operation_input_args,
            operation=operation,
        )
        return formatted_method