-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.gen.go
535 lines (453 loc) · 22.5 KB
/
types.gen.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
// Package influxdb3 provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
package influxdb3
import (
"encoding/json"
"time"
"github.com/oapi-codegen/runtime"
openapi_types "github.com/oapi-codegen/runtime/types"
)
const (
BearerAuthJwtScopes = "bearerAuthJwt.Scopes"
BearerAuthManagementTokenScopes = "bearerAuthManagementToken.Scopes"
)
// Defines values for ClusterDatabasePartitionTemplatePartBucketType.
const (
Bucket ClusterDatabasePartitionTemplatePartBucketType = "bucket"
)
// Defines values for ClusterDatabasePartitionTemplatePartTagValueType.
const (
Tag ClusterDatabasePartitionTemplatePartTagValueType = "tag"
)
// Defines values for ClusterDatabasePartitionTemplatePartTimeFormatType.
const (
Time ClusterDatabasePartitionTemplatePartTimeFormatType = "time"
)
// Defines values for DatabaseTokenResourceAllDatabases.
const (
Asterisk DatabaseTokenResourceAllDatabases = "*"
)
// ClusterDatabaseMaxColumnsPerTable The maximum number of columns per table for the cluster database
type ClusterDatabaseMaxColumnsPerTable = int32
// ClusterDatabaseMaxTables The maximum number of tables for the cluster database
type ClusterDatabaseMaxTables = int32
// ClusterDatabaseName The name of the cluster database
type ClusterDatabaseName = string
// ClusterDatabasePartitionTemplate A template for [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) a cluster database.
//
// Each template part is evaluated in sequence, concatinating the final
// partition key from the output of each part, delimited by the partition
// key delimiter `|`.
//
// For example, using the partition template below:
//
// ```json
// [
//
// {
// "type": "time",
// "value": "%Y"
// },
// {
// "type": "tag",
// "value": "bananas"
// },
// {
// "type": "tag",
// "value": "plátanos"
// },
// {
// "type": "bucket",
// "value": {
// "tagName": "c",
// "numberOfBuckets": 10
// }
// }
//
// ]
// ```
//
// The following partition keys are derived:
//
// - `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -> `2023|bananas|plátanos|5`
// - `time=2023-01-01, b=plátanos` -> `2023|!|plátanos|!`
// - `time=2023-01-01, another=cat, b=plátanos` -> `2023|!|plátanos|!`
// - `time=2023-01-01` -> `2023|!|!|!`
// - `time=2023-01-01, a=cat|dog, b=!, c=!` -> `2023|cat%7Cdog|%21|8`
// - `time=2023-01-01, a=%50, c=%50` -> `2023|%2550|!|9`
// - `time=2023-01-01, a=, c=` -> `2023|^|!|0`
// - `time=2023-01-01, a=<long string>` -> `2023|<long string>#|!|!`
// - `time=2023-01-01, c=<long string>` -> `2023|!|!|<bucket ID for untruncated long string>`
//
// When using the default [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) template (YYYY-MM-DD) there is no
// encoding necessary, as the derived partition key contains a single part, and
// no reserved characters. [`TemplatePart::Bucket`] parts by definition will
// always be within the part length limit and contain no restricted characters
// so are also not percent-encoded and/or truncated.
type ClusterDatabasePartitionTemplate = []ClusterDatabasePartitionTemplatePart
// ClusterDatabasePartitionTemplatePart A sub-part of a `PartitionTemplate`
type ClusterDatabasePartitionTemplatePart struct {
union json.RawMessage
}
// ClusterDatabasePartitionTemplatePartBucket A bucketing matcher that sorts data through a uniform hash function on the values of the given tag name.
//
// If a row does not contain a value for the specified tag name, the NULL/missing partition key part `!` is rendered.
type ClusterDatabasePartitionTemplatePartBucket struct {
Type *ClusterDatabasePartitionTemplatePartBucketType `json:"type,omitempty"`
Value *struct {
// NumberOfBuckets The number of buckets tag values are distributed across
NumberOfBuckets *int32 `json:"numberOfBuckets,omitempty"`
// TagName The name of the tag used to derive the bucket the data belongs in
TagName *string `json:"tagName,omitempty"`
} `json:"value,omitempty"`
}
// ClusterDatabasePartitionTemplatePartBucketType defines model for ClusterDatabasePartitionTemplatePartBucket.Type.
type ClusterDatabasePartitionTemplatePartBucketType string
// ClusterDatabasePartitionTemplatePartTagValue A tag value matcher that extracts a string value from the specified tag name
//
// If a row does not contain a value for the specified tag name, the NULL/missing partition key part `!` is rendered.
type ClusterDatabasePartitionTemplatePartTagValue struct {
Type *ClusterDatabasePartitionTemplatePartTagValueType `json:"type,omitempty"`
Value *string `json:"value,omitempty"`
}
// ClusterDatabasePartitionTemplatePartTagValueType defines model for ClusterDatabasePartitionTemplatePartTagValue.Type.
type ClusterDatabasePartitionTemplatePartTagValueType string
// ClusterDatabasePartitionTemplatePartTimeFormat A time format matcher that accepts a "strftime"-like format string and evaluates it against the "time" column
type ClusterDatabasePartitionTemplatePartTimeFormat struct {
Type *ClusterDatabasePartitionTemplatePartTimeFormatType `json:"type,omitempty"`
Value *string `json:"value,omitempty"`
}
// ClusterDatabasePartitionTemplatePartTimeFormatType defines model for ClusterDatabasePartitionTemplatePartTimeFormat.Type.
type ClusterDatabasePartitionTemplatePartTimeFormatType string
// ClusterDatabaseRetentionPeriod The retention period of the [cluster database](/influxdb/cloud-dedicated/admin/databases/) in nanoseconds, if applicable
//
// If the retention period is not set or is set to 0, the database will have infinite retention
type ClusterDatabaseRetentionPeriod = int64
// ClusterDatabaseTableName The name of the [cluster database](/influxdb/cloud-dedicated/admin/databases/) table
type ClusterDatabaseTableName = string
// DatabaseTokenAccessToken The access token that can be used to authenticate query and write requests to the cluster
//
// The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.
type DatabaseTokenAccessToken = string
// DatabaseTokenCreatedAt defines model for DatabaseTokenCreatedAt.
type DatabaseTokenCreatedAt = DateTimeRfc3339
// DatabaseTokenDescription The description of the database token
type DatabaseTokenDescription = string
// DatabaseTokenPermission The description of the database token
type DatabaseTokenPermission struct {
// Action The action the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) permission allows
Action *DatabaseTokenPermissionAction `json:"action,omitempty"`
// Resource The resource the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) permission applies to
Resource *DatabaseTokenPermissionResource `json:"resource,omitempty"`
}
// DatabaseTokenPermissionAction The action the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) permission allows
type DatabaseTokenPermissionAction = string
// DatabaseTokenPermissionResource The resource the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) permission applies to
type DatabaseTokenPermissionResource struct {
union json.RawMessage
}
// DatabaseTokenPermissions The list of permissions the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) allows
type DatabaseTokenPermissions = []DatabaseTokenPermission
// DatabaseTokenResourceAllDatabases A resource value for a [database token](/influxdb/cloud-dedicated/admin/tokens/database/) permission that refers to all databases
type DatabaseTokenResourceAllDatabases string
// DateTimeRfc3339 defines model for DateTimeRfc3339.
type DateTimeRfc3339 = time.Time
// Error defines model for Error.
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
}
// UuidV4 defines model for UuidV4.
type UuidV4 = openapi_types.UUID
// BadRequest defines model for BadRequest.
type BadRequest = Error
// Conflict defines model for Conflict.
type Conflict = Error
// Forbidden defines model for Forbidden.
type Forbidden = Error
// InternalServerError defines model for InternalServerError.
type InternalServerError = Error
// NotFound defines model for NotFound.
type NotFound = Error
// Unauthorized defines model for Unauthorized.
type Unauthorized = Error
// CreateClusterDatabaseJSONBody defines parameters for CreateClusterDatabase.
type CreateClusterDatabaseJSONBody struct {
// MaxColumnsPerTable The maximum number of columns per table for the cluster database
MaxColumnsPerTable *ClusterDatabaseMaxColumnsPerTable `json:"maxColumnsPerTable,omitempty"`
// MaxTables The maximum number of tables for the cluster database
MaxTables *ClusterDatabaseMaxTables `json:"maxTables,omitempty"`
// Name The name of the cluster database
Name ClusterDatabaseName `json:"name"`
// PartitionTemplate A template for [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) a cluster database.
//
// Each template part is evaluated in sequence, concatinating the final
// partition key from the output of each part, delimited by the partition
// key delimiter `|`.
//
// For example, using the partition template below:
//
// ```json
// [
// {
// "type": "time",
// "value": "%Y"
// },
// {
// "type": "tag",
// "value": "bananas"
// },
// {
// "type": "tag",
// "value": "plátanos"
// },
// {
// "type": "bucket",
// "value": {
// "tagName": "c",
// "numberOfBuckets": 10
// }
// }
// ]
// ```
//
// The following partition keys are derived:
//
// * `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -> `2023|bananas|plátanos|5`
// * `time=2023-01-01, b=plátanos` -> `2023|!|plátanos|!`
// * `time=2023-01-01, another=cat, b=plátanos` -> `2023|!|plátanos|!`
// * `time=2023-01-01` -> `2023|!|!|!`
// * `time=2023-01-01, a=cat|dog, b=!, c=!` -> `2023|cat%7Cdog|%21|8`
// * `time=2023-01-01, a=%50, c=%50` -> `2023|%2550|!|9`
// * `time=2023-01-01, a=, c=` -> `2023|^|!|0`
// * `time=2023-01-01, a=<long string>` -> `2023|<long string>#|!|!`
// * `time=2023-01-01, c=<long string>` -> `2023|!|!|<bucket ID for untruncated long string>`
//
// When using the default [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) template (YYYY-MM-DD) there is no
// encoding necessary, as the derived partition key contains a single part, and
// no reserved characters. [`TemplatePart::Bucket`] parts by definition will
// always be within the part length limit and contain no restricted characters
// so are also not percent-encoded and/or truncated.
PartitionTemplate *ClusterDatabasePartitionTemplate `json:"partitionTemplate,omitempty"`
// RetentionPeriod The retention period of the [cluster database](/influxdb/cloud-dedicated/admin/databases/) in nanoseconds, if applicable
//
// If the retention period is not set or is set to 0, the database will have infinite retention
RetentionPeriod *ClusterDatabaseRetentionPeriod `json:"retentionPeriod,omitempty"`
}
// UpdateClusterDatabaseJSONBody defines parameters for UpdateClusterDatabase.
type UpdateClusterDatabaseJSONBody struct {
// MaxColumnsPerTable The maximum number of columns per table for the cluster database
MaxColumnsPerTable *ClusterDatabaseMaxColumnsPerTable `json:"maxColumnsPerTable,omitempty"`
// MaxTables The maximum number of tables for the cluster database
MaxTables *ClusterDatabaseMaxTables `json:"maxTables,omitempty"`
// RetentionPeriod The retention period of the [cluster database](/influxdb/cloud-dedicated/admin/databases/) in nanoseconds, if applicable
//
// If the retention period is not set or is set to 0, the database will have infinite retention
RetentionPeriod *ClusterDatabaseRetentionPeriod `json:"retentionPeriod,omitempty"`
}
// CreateClusterDatabaseTableJSONBody defines parameters for CreateClusterDatabaseTable.
type CreateClusterDatabaseTableJSONBody struct {
// Name The name of the [cluster database](/influxdb/cloud-dedicated/admin/databases/) table
Name ClusterDatabaseTableName `json:"name"`
// PartitionTemplate A template for [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) a cluster database.
//
// Each template part is evaluated in sequence, concatinating the final
// partition key from the output of each part, delimited by the partition
// key delimiter `|`.
//
// For example, using the partition template below:
//
// ```json
// [
// {
// "type": "time",
// "value": "%Y"
// },
// {
// "type": "tag",
// "value": "bananas"
// },
// {
// "type": "tag",
// "value": "plátanos"
// },
// {
// "type": "bucket",
// "value": {
// "tagName": "c",
// "numberOfBuckets": 10
// }
// }
// ]
// ```
//
// The following partition keys are derived:
//
// * `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -> `2023|bananas|plátanos|5`
// * `time=2023-01-01, b=plátanos` -> `2023|!|plátanos|!`
// * `time=2023-01-01, another=cat, b=plátanos` -> `2023|!|plátanos|!`
// * `time=2023-01-01` -> `2023|!|!|!`
// * `time=2023-01-01, a=cat|dog, b=!, c=!` -> `2023|cat%7Cdog|%21|8`
// * `time=2023-01-01, a=%50, c=%50` -> `2023|%2550|!|9`
// * `time=2023-01-01, a=, c=` -> `2023|^|!|0`
// * `time=2023-01-01, a=<long string>` -> `2023|<long string>#|!|!`
// * `time=2023-01-01, c=<long string>` -> `2023|!|!|<bucket ID for untruncated long string>`
//
// When using the default [partitioning](/influxdb/cloud-dedicated/admin/custom-partitions/) template (YYYY-MM-DD) there is no
// encoding necessary, as the derived partition key contains a single part, and
// no reserved characters. [`TemplatePart::Bucket`] parts by definition will
// always be within the part length limit and contain no restricted characters
// so are also not percent-encoded and/or truncated.
PartitionTemplate *ClusterDatabasePartitionTemplate `json:"partitionTemplate,omitempty"`
}
// CreateDatabaseTokenJSONBody defines parameters for CreateDatabaseToken.
type CreateDatabaseTokenJSONBody struct {
// Description The description of the database token
Description DatabaseTokenDescription `json:"description"`
// Permissions The list of permissions the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) allows
Permissions *DatabaseTokenPermissions `json:"permissions,omitempty"`
}
// UpdateDatabaseTokenJSONBody defines parameters for UpdateDatabaseToken.
type UpdateDatabaseTokenJSONBody struct {
// Description The description of the database token
Description *DatabaseTokenDescription `json:"description,omitempty"`
// Permissions The list of permissions the [database token](/influxdb/cloud-dedicated/admin/tokens/database/) allows
Permissions *DatabaseTokenPermissions `json:"permissions,omitempty"`
}
// CreateClusterDatabaseJSONRequestBody defines body for CreateClusterDatabase for application/json ContentType.
type CreateClusterDatabaseJSONRequestBody CreateClusterDatabaseJSONBody
// UpdateClusterDatabaseJSONRequestBody defines body for UpdateClusterDatabase for application/json ContentType.
type UpdateClusterDatabaseJSONRequestBody UpdateClusterDatabaseJSONBody
// CreateClusterDatabaseTableJSONRequestBody defines body for CreateClusterDatabaseTable for application/json ContentType.
type CreateClusterDatabaseTableJSONRequestBody CreateClusterDatabaseTableJSONBody
// CreateDatabaseTokenJSONRequestBody defines body for CreateDatabaseToken for application/json ContentType.
type CreateDatabaseTokenJSONRequestBody CreateDatabaseTokenJSONBody
// UpdateDatabaseTokenJSONRequestBody defines body for UpdateDatabaseToken for application/json ContentType.
type UpdateDatabaseTokenJSONRequestBody UpdateDatabaseTokenJSONBody
// AsClusterDatabasePartitionTemplatePartTagValue returns the union data inside the ClusterDatabasePartitionTemplatePart as a ClusterDatabasePartitionTemplatePartTagValue
func (t ClusterDatabasePartitionTemplatePart) AsClusterDatabasePartitionTemplatePartTagValue() (ClusterDatabasePartitionTemplatePartTagValue, error) {
var body ClusterDatabasePartitionTemplatePartTagValue
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromClusterDatabasePartitionTemplatePartTagValue overwrites any union data inside the ClusterDatabasePartitionTemplatePart as the provided ClusterDatabasePartitionTemplatePartTagValue
func (t *ClusterDatabasePartitionTemplatePart) FromClusterDatabasePartitionTemplatePartTagValue(v ClusterDatabasePartitionTemplatePartTagValue) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeClusterDatabasePartitionTemplatePartTagValue performs a merge with any union data inside the ClusterDatabasePartitionTemplatePart, using the provided ClusterDatabasePartitionTemplatePartTagValue
func (t *ClusterDatabasePartitionTemplatePart) MergeClusterDatabasePartitionTemplatePartTagValue(v ClusterDatabasePartitionTemplatePartTagValue) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsClusterDatabasePartitionTemplatePartTimeFormat returns the union data inside the ClusterDatabasePartitionTemplatePart as a ClusterDatabasePartitionTemplatePartTimeFormat
func (t ClusterDatabasePartitionTemplatePart) AsClusterDatabasePartitionTemplatePartTimeFormat() (ClusterDatabasePartitionTemplatePartTimeFormat, error) {
var body ClusterDatabasePartitionTemplatePartTimeFormat
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromClusterDatabasePartitionTemplatePartTimeFormat overwrites any union data inside the ClusterDatabasePartitionTemplatePart as the provided ClusterDatabasePartitionTemplatePartTimeFormat
func (t *ClusterDatabasePartitionTemplatePart) FromClusterDatabasePartitionTemplatePartTimeFormat(v ClusterDatabasePartitionTemplatePartTimeFormat) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeClusterDatabasePartitionTemplatePartTimeFormat performs a merge with any union data inside the ClusterDatabasePartitionTemplatePart, using the provided ClusterDatabasePartitionTemplatePartTimeFormat
func (t *ClusterDatabasePartitionTemplatePart) MergeClusterDatabasePartitionTemplatePartTimeFormat(v ClusterDatabasePartitionTemplatePartTimeFormat) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsClusterDatabasePartitionTemplatePartBucket returns the union data inside the ClusterDatabasePartitionTemplatePart as a ClusterDatabasePartitionTemplatePartBucket
func (t ClusterDatabasePartitionTemplatePart) AsClusterDatabasePartitionTemplatePartBucket() (ClusterDatabasePartitionTemplatePartBucket, error) {
var body ClusterDatabasePartitionTemplatePartBucket
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromClusterDatabasePartitionTemplatePartBucket overwrites any union data inside the ClusterDatabasePartitionTemplatePart as the provided ClusterDatabasePartitionTemplatePartBucket
func (t *ClusterDatabasePartitionTemplatePart) FromClusterDatabasePartitionTemplatePartBucket(v ClusterDatabasePartitionTemplatePartBucket) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeClusterDatabasePartitionTemplatePartBucket performs a merge with any union data inside the ClusterDatabasePartitionTemplatePart, using the provided ClusterDatabasePartitionTemplatePartBucket
func (t *ClusterDatabasePartitionTemplatePart) MergeClusterDatabasePartitionTemplatePartBucket(v ClusterDatabasePartitionTemplatePartBucket) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
func (t ClusterDatabasePartitionTemplatePart) MarshalJSON() ([]byte, error) {
b, err := t.union.MarshalJSON()
return b, err
}
func (t *ClusterDatabasePartitionTemplatePart) UnmarshalJSON(b []byte) error {
err := t.union.UnmarshalJSON(b)
return err
}
// AsClusterDatabaseName returns the union data inside the DatabaseTokenPermissionResource as a ClusterDatabaseName
func (t DatabaseTokenPermissionResource) AsClusterDatabaseName() (ClusterDatabaseName, error) {
var body ClusterDatabaseName
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromClusterDatabaseName overwrites any union data inside the DatabaseTokenPermissionResource as the provided ClusterDatabaseName
func (t *DatabaseTokenPermissionResource) FromClusterDatabaseName(v ClusterDatabaseName) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeClusterDatabaseName performs a merge with any union data inside the DatabaseTokenPermissionResource, using the provided ClusterDatabaseName
func (t *DatabaseTokenPermissionResource) MergeClusterDatabaseName(v ClusterDatabaseName) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsDatabaseTokenResourceAllDatabases returns the union data inside the DatabaseTokenPermissionResource as a DatabaseTokenResourceAllDatabases
func (t DatabaseTokenPermissionResource) AsDatabaseTokenResourceAllDatabases() (DatabaseTokenResourceAllDatabases, error) {
var body DatabaseTokenResourceAllDatabases
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromDatabaseTokenResourceAllDatabases overwrites any union data inside the DatabaseTokenPermissionResource as the provided DatabaseTokenResourceAllDatabases
func (t *DatabaseTokenPermissionResource) FromDatabaseTokenResourceAllDatabases(v DatabaseTokenResourceAllDatabases) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeDatabaseTokenResourceAllDatabases performs a merge with any union data inside the DatabaseTokenPermissionResource, using the provided DatabaseTokenResourceAllDatabases
func (t *DatabaseTokenPermissionResource) MergeDatabaseTokenResourceAllDatabases(v DatabaseTokenResourceAllDatabases) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
func (t DatabaseTokenPermissionResource) MarshalJSON() ([]byte, error) {
b, err := t.union.MarshalJSON()
return b, err
}
func (t *DatabaseTokenPermissionResource) UnmarshalJSON(b []byte) error {
err := t.union.UnmarshalJSON(b)
return err
}