-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathadminorganizationcertificate.go
More file actions
547 lines (498 loc) · 23.7 KB
/
Copy pathadminorganizationcertificate.go
File metadata and controls
547 lines (498 loc) · 23.7 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
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
536
537
538
539
540
541
542
543
544
545
546
547
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package openai
import (
"context"
"errors"
"net/http"
"net/url"
"slices"
"github.com/openai/openai-go/v3/internal/apijson"
"github.com/openai/openai-go/v3/internal/apiquery"
"github.com/openai/openai-go/v3/internal/requestconfig"
"github.com/openai/openai-go/v3/option"
"github.com/openai/openai-go/v3/packages/pagination"
"github.com/openai/openai-go/v3/packages/param"
"github.com/openai/openai-go/v3/packages/respjson"
"github.com/openai/openai-go/v3/shared/constant"
)
// AdminOrganizationCertificateService contains methods and other services that
// help with interacting with the openai 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 [NewAdminOrganizationCertificateService] method instead.
type AdminOrganizationCertificateService struct {
Options []option.RequestOption
}
// NewAdminOrganizationCertificateService 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 NewAdminOrganizationCertificateService(opts ...option.RequestOption) (r AdminOrganizationCertificateService) {
r = AdminOrganizationCertificateService{}
r.Options = opts
return
}
// Upload a certificate to the organization. This does **not** automatically
// activate the certificate.
//
// Organizations can upload up to 50 certificates.
func (r *AdminOrganizationCertificateService) New(ctx context.Context, body AdminOrganizationCertificateNewParams, opts ...option.RequestOption) (res *Certificate, err error) {
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
path := "organization/certificates"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return res, err
}
// Get a certificate that has been uploaded to the organization.
//
// You can get a certificate regardless of whether it is active or not.
func (r *AdminOrganizationCertificateService) Get(ctx context.Context, certificateID string, query AdminOrganizationCertificateGetParams, opts ...option.RequestOption) (res *Certificate, err error) {
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
if certificateID == "" {
err = errors.New("missing required certificate_id parameter")
return nil, err
}
path := requestconfig.FormatPath("organization/certificates/%s", certificateID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
return res, err
}
// Modify a certificate. Note that only the name can be modified.
func (r *AdminOrganizationCertificateService) Update(ctx context.Context, certificateID string, body AdminOrganizationCertificateUpdateParams, opts ...option.RequestOption) (res *Certificate, err error) {
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
if certificateID == "" {
err = errors.New("missing required certificate_id parameter")
return nil, err
}
path := requestconfig.FormatPath("organization/certificates/%s", certificateID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return res, err
}
// List uploaded certificates for this organization.
func (r *AdminOrganizationCertificateService) List(ctx context.Context, query AdminOrganizationCertificateListParams, opts ...option.RequestOption) (res *pagination.ConversationCursorPage[AdminOrganizationCertificateListResponse], err error) {
var raw *http.Response
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "organization/certificates"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// List uploaded certificates for this organization.
func (r *AdminOrganizationCertificateService) ListAutoPaging(ctx context.Context, query AdminOrganizationCertificateListParams, opts ...option.RequestOption) *pagination.ConversationCursorPageAutoPager[AdminOrganizationCertificateListResponse] {
return pagination.NewConversationCursorPageAutoPager(r.List(ctx, query, opts...))
}
// Delete a certificate from the organization.
//
// The certificate must be inactive for the organization and all projects.
func (r *AdminOrganizationCertificateService) Delete(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *AdminOrganizationCertificateDeleteResponse, err error) {
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
if certificateID == "" {
err = errors.New("missing required certificate_id parameter")
return nil, err
}
path := requestconfig.FormatPath("organization/certificates/%s", certificateID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return res, err
}
// Activate certificates at the organization level.
//
// You can atomically and idempotently activate up to 10 certificates at a time.
func (r *AdminOrganizationCertificateService) Activate(ctx context.Context, body AdminOrganizationCertificateActivateParams, opts ...option.RequestOption) (res *pagination.Page[AdminOrganizationCertificateActivateResponse], err error) {
var raw *http.Response
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "organization/certificates/activate"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodPost, path, body, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Activate certificates at the organization level.
//
// You can atomically and idempotently activate up to 10 certificates at a time.
func (r *AdminOrganizationCertificateService) ActivateAutoPaging(ctx context.Context, body AdminOrganizationCertificateActivateParams, opts ...option.RequestOption) *pagination.PageAutoPager[AdminOrganizationCertificateActivateResponse] {
return pagination.NewPageAutoPager(r.Activate(ctx, body, opts...))
}
// Deactivate certificates at the organization level.
//
// You can atomically and idempotently deactivate up to 10 certificates at a time.
func (r *AdminOrganizationCertificateService) Deactivate(ctx context.Context, body AdminOrganizationCertificateDeactivateParams, opts ...option.RequestOption) (res *pagination.Page[AdminOrganizationCertificateDeactivateResponse], err error) {
var raw *http.Response
var preClientOpts = []option.RequestOption{requestconfig.WithAdminAPIKeyAuthSecurity()}
opts = slices.Concat(preClientOpts, r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "organization/certificates/deactivate"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodPost, path, body, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Deactivate certificates at the organization level.
//
// You can atomically and idempotently deactivate up to 10 certificates at a time.
func (r *AdminOrganizationCertificateService) DeactivateAutoPaging(ctx context.Context, body AdminOrganizationCertificateDeactivateParams, opts ...option.RequestOption) *pagination.PageAutoPager[AdminOrganizationCertificateDeactivateResponse] {
return pagination.NewPageAutoPager(r.Deactivate(ctx, body, opts...))
}
// Represents an individual `certificate` uploaded to the organization.
type Certificate struct {
// The identifier, which can be referenced in API endpoints
ID string `json:"id" api:"required"`
CertificateDetails CertificateCertificateDetails `json:"certificate_details" api:"required"`
// The Unix timestamp (in seconds) of when the certificate was uploaded.
CreatedAt int64 `json:"created_at" api:"required" format:"unixtime"`
// The name of the certificate.
Name string `json:"name" api:"required"`
// The object type.
//
// - If creating, updating, or getting a specific certificate, the object type is
// `certificate`.
// - If listing, activating, or deactivating certificates for the organization, the
// object type is `organization.certificate`.
// - If listing, activating, or deactivating certificates for a project, the object
// type is `organization.project.certificate`.
//
// Any of "certificate", "organization.certificate",
// "organization.project.certificate".
Object CertificateObject `json:"object" api:"required"`
// Whether the certificate is currently active at the specified scope. Not returned
// when getting details for a specific certificate.
Active bool `json:"active"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CertificateDetails respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Object respjson.Field
Active respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r Certificate) RawJSON() string { return r.JSON.raw }
func (r *Certificate) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type CertificateCertificateDetails struct {
// The content of the certificate in PEM format.
Content string `json:"content"`
// The Unix timestamp (in seconds) of when the certificate expires.
ExpiresAt int64 `json:"expires_at" format:"unixtime"`
// The Unix timestamp (in seconds) of when the certificate becomes valid.
ValidAt int64 `json:"valid_at" format:"unixtime"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
ExpiresAt respjson.Field
ValidAt respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r CertificateCertificateDetails) RawJSON() string { return r.JSON.raw }
func (r *CertificateCertificateDetails) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// The object type.
//
// - If creating, updating, or getting a specific certificate, the object type is
// `certificate`.
// - If listing, activating, or deactivating certificates for the organization, the
// object type is `organization.certificate`.
// - If listing, activating, or deactivating certificates for a project, the object
// type is `organization.project.certificate`.
type CertificateObject string
const (
CertificateObjectCertificate CertificateObject = "certificate"
CertificateObjectOrganizationCertificate CertificateObject = "organization.certificate"
CertificateObjectOrganizationProjectCertificate CertificateObject = "organization.project.certificate"
)
// Represents an individual certificate configured at the organization level.
type AdminOrganizationCertificateListResponse struct {
// The identifier, which can be referenced in API endpoints
ID string `json:"id" api:"required"`
// Whether the certificate is currently active at the organization level.
Active bool `json:"active" api:"required"`
CertificateDetails AdminOrganizationCertificateListResponseCertificateDetails `json:"certificate_details" api:"required"`
// The Unix timestamp (in seconds) of when the certificate was uploaded.
CreatedAt int64 `json:"created_at" api:"required" format:"unixtime"`
// The name of the certificate.
Name string `json:"name" api:"required"`
// The object type, which is always `organization.certificate`.
Object constant.OrganizationCertificate `json:"object" default:"organization.certificate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
CertificateDetails respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateListResponse) RawJSON() string { return r.JSON.raw }
func (r *AdminOrganizationCertificateListResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateListResponseCertificateDetails struct {
// The Unix timestamp (in seconds) of when the certificate expires.
ExpiresAt int64 `json:"expires_at" format:"unixtime"`
// The Unix timestamp (in seconds) of when the certificate becomes valid.
ValidAt int64 `json:"valid_at" format:"unixtime"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
ValidAt respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateListResponseCertificateDetails) RawJSON() string {
return r.JSON.raw
}
func (r *AdminOrganizationCertificateListResponseCertificateDetails) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateDeleteResponse struct {
// The ID of the certificate that was deleted.
ID string `json:"id" api:"required"`
// The object type, must be `certificate.deleted`.
Object constant.CertificateDeleted `json:"object" default:"certificate.deleted"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateDeleteResponse) RawJSON() string { return r.JSON.raw }
func (r *AdminOrganizationCertificateDeleteResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Represents an individual certificate configured at the organization level.
type AdminOrganizationCertificateActivateResponse struct {
// The identifier, which can be referenced in API endpoints
ID string `json:"id" api:"required"`
// Whether the certificate is currently active at the organization level.
Active bool `json:"active" api:"required"`
CertificateDetails AdminOrganizationCertificateActivateResponseCertificateDetails `json:"certificate_details" api:"required"`
// The Unix timestamp (in seconds) of when the certificate was uploaded.
CreatedAt int64 `json:"created_at" api:"required" format:"unixtime"`
// The name of the certificate.
Name string `json:"name" api:"required"`
// The object type, which is always `organization.certificate`.
Object constant.OrganizationCertificate `json:"object" default:"organization.certificate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
CertificateDetails respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateActivateResponse) RawJSON() string { return r.JSON.raw }
func (r *AdminOrganizationCertificateActivateResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateActivateResponseCertificateDetails struct {
// The Unix timestamp (in seconds) of when the certificate expires.
ExpiresAt int64 `json:"expires_at" format:"unixtime"`
// The Unix timestamp (in seconds) of when the certificate becomes valid.
ValidAt int64 `json:"valid_at" format:"unixtime"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
ValidAt respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateActivateResponseCertificateDetails) RawJSON() string {
return r.JSON.raw
}
func (r *AdminOrganizationCertificateActivateResponseCertificateDetails) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Represents an individual certificate configured at the organization level.
type AdminOrganizationCertificateDeactivateResponse struct {
// The identifier, which can be referenced in API endpoints
ID string `json:"id" api:"required"`
// Whether the certificate is currently active at the organization level.
Active bool `json:"active" api:"required"`
CertificateDetails AdminOrganizationCertificateDeactivateResponseCertificateDetails `json:"certificate_details" api:"required"`
// The Unix timestamp (in seconds) of when the certificate was uploaded.
CreatedAt int64 `json:"created_at" api:"required" format:"unixtime"`
// The name of the certificate.
Name string `json:"name" api:"required"`
// The object type, which is always `organization.certificate`.
Object constant.OrganizationCertificate `json:"object" default:"organization.certificate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
CertificateDetails respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateDeactivateResponse) RawJSON() string { return r.JSON.raw }
func (r *AdminOrganizationCertificateDeactivateResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateDeactivateResponseCertificateDetails struct {
// The Unix timestamp (in seconds) of when the certificate expires.
ExpiresAt int64 `json:"expires_at" format:"unixtime"`
// The Unix timestamp (in seconds) of when the certificate becomes valid.
ValidAt int64 `json:"valid_at" format:"unixtime"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
ValidAt respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r AdminOrganizationCertificateDeactivateResponseCertificateDetails) RawJSON() string {
return r.JSON.raw
}
func (r *AdminOrganizationCertificateDeactivateResponseCertificateDetails) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateNewParams struct {
// The certificate content in PEM format
Certificate string `json:"certificate" api:"required"`
// An optional name for the certificate
Name param.Opt[string] `json:"name,omitzero"`
paramObj
}
func (r AdminOrganizationCertificateNewParams) MarshalJSON() (data []byte, err error) {
type shadow AdminOrganizationCertificateNewParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AdminOrganizationCertificateNewParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateGetParams struct {
// A list of additional fields to include in the response. Currently the only
// supported value is `content` to fetch the PEM content of the certificate.
//
// Any of "content".
Include []string `query:"include,omitzero" json:"-"`
paramObj
}
// URLQuery serializes [AdminOrganizationCertificateGetParams]'s query parameters
// as `url.Values`.
func (r AdminOrganizationCertificateGetParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatBrackets,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AdminOrganizationCertificateUpdateParams struct {
// The updated name for the certificate
Name param.Opt[string] `json:"name,omitzero"`
paramObj
}
func (r AdminOrganizationCertificateUpdateParams) MarshalJSON() (data []byte, err error) {
type shadow AdminOrganizationCertificateUpdateParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AdminOrganizationCertificateUpdateParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateListParams struct {
// A cursor for use in pagination. `after` is an object ID that defines your place
// in the list. For instance, if you make a list request and receive 100 objects,
// ending with obj_foo, your subsequent call can include after=obj_foo in order to
// fetch the next page of the list.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// A limit on the number of objects to be returned. Limit can range between 1 and
// 100, and the default is 20.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort order by the `created_at` timestamp of the objects. `asc` for ascending
// order and `desc` for descending order.
//
// Any of "asc", "desc".
Order AdminOrganizationCertificateListParamsOrder `query:"order,omitzero" json:"-"`
paramObj
}
// URLQuery serializes [AdminOrganizationCertificateListParams]'s query parameters
// as `url.Values`.
func (r AdminOrganizationCertificateListParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatBrackets,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
// Sort order by the `created_at` timestamp of the objects. `asc` for ascending
// order and `desc` for descending order.
type AdminOrganizationCertificateListParamsOrder string
const (
AdminOrganizationCertificateListParamsOrderAsc AdminOrganizationCertificateListParamsOrder = "asc"
AdminOrganizationCertificateListParamsOrderDesc AdminOrganizationCertificateListParamsOrder = "desc"
)
type AdminOrganizationCertificateActivateParams struct {
CertificateIDs []string `json:"certificate_ids,omitzero" api:"required"`
paramObj
}
func (r AdminOrganizationCertificateActivateParams) MarshalJSON() (data []byte, err error) {
type shadow AdminOrganizationCertificateActivateParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AdminOrganizationCertificateActivateParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type AdminOrganizationCertificateDeactivateParams struct {
CertificateIDs []string `json:"certificate_ids,omitzero" api:"required"`
paramObj
}
func (r AdminOrganizationCertificateDeactivateParams) MarshalJSON() (data []byte, err error) {
type shadow AdminOrganizationCertificateDeactivateParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AdminOrganizationCertificateDeactivateParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}