This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
types.go
213 lines (178 loc) · 7.35 KB
/
types.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// This source code file is AUTO-GENERATED by github.com/taskcluster/jsonschema2go
package model
import "encoding/json"
type (
// Reference of methods implemented by API
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#
APIReferenceFile struct {
// Link to schema for this reference. That is a link to this very document. Typically used to identify what kind of reference this file is.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/$schema
Schema string `json:"$schema"`
// BaseUrl for all _routes_ described in this document
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/baseUrl
BaseURL string `json:"baseUrl"`
// API description in markdown
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/description
Description string `json:"description"`
// Array of methods in this reference
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries
Entries []APIEntry `json:"entries"`
// API title in markdown
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/title
Title string `json:"title"`
// API reference version
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/version
Version json.RawMessage `json:"version"`
}
Entry struct {
// Arguments from `route` that must be replaced, they'll appear wrapped in brackets inside `route`.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/args
Args []string `json:"args"`
// Description (ie. documentation) for the API entry
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/description
Description string `json:"description"`
// JSON schema for input, if input is taken otherwise not present.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/input
Input string `json:"input,omitempty"`
// HTTP method (verb) used to access the function
//
// Possible values:
// * "get"
// * "post"
// * "put"
// * "head"
// * "delete"
// * "options"
// * "trace"
// * "copy"
// * "lock"
// * "mkcol"
// * "move"
// * "purge"
// * "propfind"
// * "proppatch"
// * "unlock"
// * "report"
// * "mkactivity"
// * "checkout"
// * "merge"
// * "m-search"
// * "notify"
// * "subscribe"
// * "unsubscribe"
// * "patch"
// * "search"
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/method
Method string `json:"method"`
// Name of the `function` this is a stable identifier for use in auto-generated client libraries
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/name
Name string `json:"name"`
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/output
Output string `json:"output,omitempty"`
// List of accepted query-string parameters, these are always optional.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/query
Query []string `json:"query,omitempty"`
// Route for the call, note that arguments wrapped with brackets, like `/v1/user/<userId>/` must be replaced. And the route must be appended to the `baseUrl`
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/route
Route string `json:"route"`
// Scope expression template specifying required scopes for a method. Not provided if authentication isn't required.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/scopes
Scopes ScopeExpressionTemplate `json:"scopes,omitempty"`
// Stability level of the API
//
// Possible values:
// * "deprecated"
// * "experimental"
// * "stable"
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/stability
Stability string `json:"stability"`
// Title of API entry
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/title
Title string `json:"title"`
// Type of entry, currently only `function`.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/properties/entries/items/properties/type
Type string `json:"type"`
}
// AllOf objects will evaluate to true if all subexpressions are true
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[2]
AllOf struct {
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[2]/properties/AllOf
AllOf []ScopeExpressionTemplate `json:"AllOf"`
}
// AnyOf objects will evaluate to true if any subexpressions are true
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[1]
AnyOf struct {
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[1]/properties/AnyOf
AnyOf []ScopeExpressionTemplate `json:"AnyOf"`
}
// for/each/in objects will replace themselves with an array of basic scopes. They will be flattened into the array this object is a part of.
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[4]
ForEachIn struct {
// Syntax: ^[\x20-\x7e]*$
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[4]/properties/each
Each string `json:"each"`
// Syntax: ^[\x20-\x7e]*$
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[4]/properties/for
For string `json:"for"`
// Syntax: ^[\x20-\x7e]*$
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[4]/properties/in
In string `json:"in"`
}
// if/then objects will replace themselves with the contents of then if the `if` is true
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[3]
IfThen struct {
// Syntax: ^[\x20-\x7e]*$
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[3]/properties/if
If string `json:"if"`
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[3]/properties/then
Then ScopeExpressionTemplate `json:"then"`
}
// The most basic element of a scope expression
//
// Syntax: ^[\x20-\x7e]*$
//
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate/oneOf[0]
RequiredScope string
// See http://schemas.taskcluster.net/base/v1/api-reference.json#/definitions/scopeExpressionTemplate
ScopeExpressionTemplate struct {
RawMessage json.RawMessage
// One of:
// * "AllOf"
// * "AnyOf"
// * "ForEachIn"
// * "IfThen"
// * "RequiredScope"
Type string
AllOf *AllOf
AnyOf *AnyOf
ForEachIn *ForEachIn
IfThen *IfThen
RequiredScope *RequiredScope
}
)