// Code generated by "gen"; DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package template

import (
	"context"

	"github.com/clerk/clerk-sdk-go/v2"
)

// Get retrieves details for a template.
func Get(ctx context.Context, params *GetParams) (*clerk.Template, error) {
	return getClient().Get(ctx, params)
}

// Update updates an existing template or creates a new one with the
// provided params.
func Update(ctx context.Context, params *UpdateParams) (*clerk.Template, error) {
	return getClient().Update(ctx, params)
}

// Delete deletes a custom user template.
func Delete(ctx context.Context, params *DeleteParams) (*clerk.DeletedResource, error) {
	return getClient().Delete(ctx, params)
}

// Revert reverts a template to its default state.
func Revert(ctx context.Context, params *RevertParams) (*clerk.Template, error) {
	return getClient().Revert(ctx, params)
}

// ToggleDelivery sets the delivery by Clerk for a template.
func ToggleDelivery(ctx context.Context, params *ToggleDeliveryParams) (*clerk.Template, error) {
	return getClient().ToggleDelivery(ctx, params)
}

// Preview returns a preview of a template.
func Preview(ctx context.Context, params *PreviewParams) (*clerk.TemplatePreview, error) {
	return getClient().Preview(ctx, params)
}

// List returns a list of templates of a given type.
func List(ctx context.Context, params *ListParams) (*clerk.TemplateList, error) {
	return getClient().List(ctx, params)
}

func getClient() *Client {
	return &Client{
		Backend: clerk.GetBackend(),
	}
}
