This repository was archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsource.go
More file actions
139 lines (117 loc) · 4.45 KB
/
source.go
File metadata and controls
139 lines (117 loc) · 4.45 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/hookdeck/hookdeck-go-sdk/core"
time "time"
)
type SourceCreateRequest struct {
// A unique name for the source
Name string `json:"name" url:"-"`
// Description for the source
Description *core.Optional[string] `json:"description,omitempty" url:"-"`
AllowedHttpMethods *core.Optional[SourceAllowedHttpMethod] `json:"allowed_http_methods,omitempty" url:"-"`
CustomResponse *core.Optional[SourceCustomResponse] `json:"custom_response,omitempty" url:"-"`
Verification *core.Optional[VerificationConfig] `json:"verification,omitempty" url:"-"`
}
type SourceListRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
Name *string `json:"-" url:"name,omitempty"`
Disabled *bool `json:"-" url:"disabled,omitempty"`
DisabledAt *time.Time `json:"-" url:"disabled_at,omitempty"`
OrderBy *SourceListRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *SourceListRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type SourceRetrieveRequest struct {
Include *string `json:"-" url:"include,omitempty"`
}
type SourceDeleteResponse struct {
// ID of the source
Id string `json:"id" url:"id"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (s *SourceDeleteResponse) GetExtraProperties() map[string]interface{} {
return s.extraProperties
}
func (s *SourceDeleteResponse) UnmarshalJSON(data []byte) error {
type unmarshaler SourceDeleteResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = SourceDeleteResponse(value)
extraProperties, err := core.ExtractExtraProperties(data, *s)
if err != nil {
return err
}
s.extraProperties = extraProperties
s._rawJSON = json.RawMessage(data)
return nil
}
func (s *SourceDeleteResponse) String() string {
if len(s._rawJSON) > 0 {
if value, err := core.StringifyJSON(s._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}
type SourceListRequestDir string
const (
SourceListRequestDirAsc SourceListRequestDir = "asc"
SourceListRequestDirDesc SourceListRequestDir = "desc"
)
func NewSourceListRequestDirFromString(s string) (SourceListRequestDir, error) {
switch s {
case "asc":
return SourceListRequestDirAsc, nil
case "desc":
return SourceListRequestDirDesc, nil
}
var t SourceListRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (s SourceListRequestDir) Ptr() *SourceListRequestDir {
return &s
}
type SourceListRequestOrderBy string
const (
SourceListRequestOrderByCreatedAt SourceListRequestOrderBy = "created_at"
)
func NewSourceListRequestOrderByFromString(s string) (SourceListRequestOrderBy, error) {
switch s {
case "created_at":
return SourceListRequestOrderByCreatedAt, nil
}
var t SourceListRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (s SourceListRequestOrderBy) Ptr() *SourceListRequestOrderBy {
return &s
}
type SourceUpdateRequest struct {
// A unique name for the source
Name *core.Optional[string] `json:"name,omitempty" url:"-"`
// Description for the source
Description *core.Optional[string] `json:"description,omitempty" url:"-"`
AllowedHttpMethods *core.Optional[SourceAllowedHttpMethod] `json:"allowed_http_methods,omitempty" url:"-"`
CustomResponse *core.Optional[SourceCustomResponse] `json:"custom_response,omitempty" url:"-"`
Verification *core.Optional[VerificationConfig] `json:"verification,omitempty" url:"-"`
}
type SourceUpsertRequest struct {
// A unique name for the source
Name string `json:"name" url:"-"`
// Description for the source
Description *core.Optional[string] `json:"description,omitempty" url:"-"`
AllowedHttpMethods *core.Optional[SourceAllowedHttpMethod] `json:"allowed_http_methods,omitempty" url:"-"`
CustomResponse *core.Optional[SourceCustomResponse] `json:"custom_response,omitempty" url:"-"`
Verification *core.Optional[VerificationConfig] `json:"verification,omitempty" url:"-"`
}