-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheuassemblyai.go
More file actions
103 lines (88 loc) · 3.43 KB
/
euassemblyai.go
File metadata and controls
103 lines (88 loc) · 3.43 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package hanzoai
import (
"context"
"errors"
"fmt"
"net/http"
"slices"
"github.com/hanzoai/go-sdk/internal/requestconfig"
"github.com/hanzoai/go-sdk/option"
)
// EuAssemblyaiService contains methods and other services that help with
// interacting with the Hanzo API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewEuAssemblyaiService] method instead.
type EuAssemblyaiService struct {
Options []option.RequestOption
}
// NewEuAssemblyaiService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewEuAssemblyaiService(opts ...option.RequestOption) (r *EuAssemblyaiService) {
r = &EuAssemblyaiService{}
r.Options = opts
return
}
// Assemblyai Proxy Route
func (r *EuAssemblyaiService) New(ctx context.Context, endpoint string, opts ...option.RequestOption) (res *EuAssemblyaiNewResponse, err error) {
opts = slices.Concat(r.Options, opts)
if endpoint == "" {
err = errors.New("missing required endpoint parameter")
return
}
path := fmt.Sprintf("eu.assemblyai/%s", endpoint)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...)
return
}
// Assemblyai Proxy Route
func (r *EuAssemblyaiService) Get(ctx context.Context, endpoint string, opts ...option.RequestOption) (res *EuAssemblyaiGetResponse, err error) {
opts = slices.Concat(r.Options, opts)
if endpoint == "" {
err = errors.New("missing required endpoint parameter")
return
}
path := fmt.Sprintf("eu.assemblyai/%s", endpoint)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
// Assemblyai Proxy Route
func (r *EuAssemblyaiService) Update(ctx context.Context, endpoint string, opts ...option.RequestOption) (res *EuAssemblyaiUpdateResponse, err error) {
opts = slices.Concat(r.Options, opts)
if endpoint == "" {
err = errors.New("missing required endpoint parameter")
return
}
path := fmt.Sprintf("eu.assemblyai/%s", endpoint)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &res, opts...)
return
}
// Assemblyai Proxy Route
func (r *EuAssemblyaiService) Delete(ctx context.Context, endpoint string, opts ...option.RequestOption) (res *EuAssemblyaiDeleteResponse, err error) {
opts = slices.Concat(r.Options, opts)
if endpoint == "" {
err = errors.New("missing required endpoint parameter")
return
}
path := fmt.Sprintf("eu.assemblyai/%s", endpoint)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return
}
// Assemblyai Proxy Route
func (r *EuAssemblyaiService) Patch(ctx context.Context, endpoint string, opts ...option.RequestOption) (res *EuAssemblyaiPatchResponse, err error) {
opts = slices.Concat(r.Options, opts)
if endpoint == "" {
err = errors.New("missing required endpoint parameter")
return
}
path := fmt.Sprintf("eu.assemblyai/%s", endpoint)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &res, opts...)
return
}
type EuAssemblyaiNewResponse = interface{}
type EuAssemblyaiGetResponse = interface{}
type EuAssemblyaiUpdateResponse = interface{}
type EuAssemblyaiDeleteResponse = interface{}
type EuAssemblyaiPatchResponse = interface{}