-
Notifications
You must be signed in to change notification settings - Fork 20
/
api.go
51 lines (41 loc) · 1.53 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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(),
}
}