-
Notifications
You must be signed in to change notification settings - Fork 541
/
accessapplicationpolicy.go
621 lines (552 loc) · 24.5 KB
/
accessapplicationpolicy.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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package zero_trust
import (
"context"
"fmt"
"net/http"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/pagination"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/cloudflare/cloudflare-go/v2/shared"
)
// AccessApplicationPolicyService contains methods and other services that help
// with interacting with the cloudflare 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
// [NewAccessApplicationPolicyService] method instead.
type AccessApplicationPolicyService struct {
Options []option.RequestOption
}
// NewAccessApplicationPolicyService 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 NewAccessApplicationPolicyService(opts ...option.RequestOption) (r *AccessApplicationPolicyService) {
r = &AccessApplicationPolicyService{}
r.Options = opts
return
}
// Create a new Access policy for an application.
func (r *AccessApplicationPolicyService) New(ctx context.Context, uuid string, params AccessApplicationPolicyNewParams, opts ...option.RequestOption) (res *Policy, err error) {
opts = append(r.Options[:], opts...)
var env AccessApplicationPolicyNewResponseEnvelope
var accountOrZone string
var accountOrZoneID param.Field[string]
if params.AccountID.Present {
accountOrZone = "accounts"
accountOrZoneID = params.AccountID
} else {
accountOrZone = "zones"
accountOrZoneID = params.ZoneID
}
path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Update a configured Access policy.
func (r *AccessApplicationPolicyService) Update(ctx context.Context, uuid1 string, uuid string, params AccessApplicationPolicyUpdateParams, opts ...option.RequestOption) (res *Policy, err error) {
opts = append(r.Options[:], opts...)
var env AccessApplicationPolicyUpdateResponseEnvelope
var accountOrZone string
var accountOrZoneID param.Field[string]
if params.AccountID.Present {
accountOrZone = "accounts"
accountOrZoneID = params.AccountID
} else {
accountOrZone = "zones"
accountOrZoneID = params.ZoneID
}
path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Lists Access policies configured for an application.
func (r *AccessApplicationPolicyService) List(ctx context.Context, uuid string, query AccessApplicationPolicyListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Policy], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
var accountOrZone string
var accountOrZoneID param.Field[string]
if query.AccountID.Present {
accountOrZone = "accounts"
accountOrZoneID = query.AccountID
} else {
accountOrZone = "zones"
accountOrZoneID = query.ZoneID
}
path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Lists Access policies configured for an application.
func (r *AccessApplicationPolicyService) ListAutoPaging(ctx context.Context, uuid string, query AccessApplicationPolicyListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Policy] {
return pagination.NewSinglePageAutoPager(r.List(ctx, uuid, query, opts...))
}
// Delete an Access policy.
func (r *AccessApplicationPolicyService) Delete(ctx context.Context, uuid1 string, uuid string, body AccessApplicationPolicyDeleteParams, opts ...option.RequestOption) (res *AccessApplicationPolicyDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env AccessApplicationPolicyDeleteResponseEnvelope
var accountOrZone string
var accountOrZoneID param.Field[string]
if body.AccountID.Present {
accountOrZone = "accounts"
accountOrZoneID = body.AccountID
} else {
accountOrZone = "zones"
accountOrZoneID = body.ZoneID
}
path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Fetches a single Access policy.
func (r *AccessApplicationPolicyService) Get(ctx context.Context, uuid1 string, uuid string, query AccessApplicationPolicyGetParams, opts ...option.RequestOption) (res *Policy, err error) {
opts = append(r.Options[:], opts...)
var env AccessApplicationPolicyGetResponseEnvelope
var accountOrZone string
var accountOrZoneID param.Field[string]
if query.AccountID.Present {
accountOrZone = "accounts"
accountOrZoneID = query.AccountID
} else {
accountOrZone = "zones"
accountOrZoneID = query.ZoneID
}
path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// A group of email addresses that can approve a temporary authentication request.
type ApprovalGroup struct {
// The number of approvals needed to obtain access.
ApprovalsNeeded float64 `json:"approvals_needed,required"`
// A list of emails that can approve the access request.
EmailAddresses []string `json:"email_addresses"`
// The UUID of an re-usable email list.
EmailListUUID string `json:"email_list_uuid"`
JSON approvalGroupJSON `json:"-"`
}
// approvalGroupJSON contains the JSON metadata for the struct [ApprovalGroup]
type approvalGroupJSON struct {
ApprovalsNeeded apijson.Field
EmailAddresses apijson.Field
EmailListUUID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ApprovalGroup) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r approvalGroupJSON) RawJSON() string {
return r.raw
}
// A group of email addresses that can approve a temporary authentication request.
type ApprovalGroupParam struct {
// The number of approvals needed to obtain access.
ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"`
// A list of emails that can approve the access request.
EmailAddresses param.Field[[]string] `json:"email_addresses"`
// The UUID of an re-usable email list.
EmailListUUID param.Field[string] `json:"email_list_uuid"`
}
func (r ApprovalGroupParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type Policy struct {
// UUID
ID string `json:"id"`
// Administrators who can approve a temporary authentication request.
ApprovalGroups []ApprovalGroup `json:"approval_groups"`
// Requires the user to request access from an administrator at the start of each
// session.
ApprovalRequired bool `json:"approval_required"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// The action Access will take if a user matches this policy.
Decision PolicyDecision `json:"decision"`
// Rules evaluated with a NOT logical operator. To match the policy, a user cannot
// meet any of the Exclude rules.
Exclude []AccessRule `json:"exclude"`
// Rules evaluated with an OR logical operator. A user needs to meet only one of
// the Include rules.
Include []AccessRule `json:"include"`
// Require this application to be served in an isolated browser for users matching
// this policy. 'Client Web Isolation' must be on for the account in order to use
// this feature.
IsolationRequired bool `json:"isolation_required"`
// The name of the Access policy.
Name string `json:"name"`
// The order of execution for this policy. Must be unique for each policy.
Precedence int64 `json:"precedence"`
// A custom message that will appear on the purpose justification screen.
PurposeJustificationPrompt string `json:"purpose_justification_prompt"`
// Require users to enter a justification when they log in to the application.
PurposeJustificationRequired bool `json:"purpose_justification_required"`
// Rules evaluated with an AND logical operator. To match the policy, a user must
// meet all of the Require rules.
Require []AccessRule `json:"require"`
// The amount of time that tokens issued for the application will be valid. Must be
// in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s,
// m, h.
SessionDuration string `json:"session_duration"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON policyJSON `json:"-"`
}
// policyJSON contains the JSON metadata for the struct [Policy]
type policyJSON struct {
ID apijson.Field
ApprovalGroups apijson.Field
ApprovalRequired apijson.Field
CreatedAt apijson.Field
Decision apijson.Field
Exclude apijson.Field
Include apijson.Field
IsolationRequired apijson.Field
Name apijson.Field
Precedence apijson.Field
PurposeJustificationPrompt apijson.Field
PurposeJustificationRequired apijson.Field
Require apijson.Field
SessionDuration apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *Policy) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyJSON) RawJSON() string {
return r.raw
}
// The action Access will take if a user matches this policy.
type PolicyDecision string
const (
PolicyDecisionAllow PolicyDecision = "allow"
PolicyDecisionDeny PolicyDecision = "deny"
PolicyDecisionNonIdentity PolicyDecision = "non_identity"
PolicyDecisionBypass PolicyDecision = "bypass"
)
func (r PolicyDecision) IsKnown() bool {
switch r {
case PolicyDecisionAllow, PolicyDecisionDeny, PolicyDecisionNonIdentity, PolicyDecisionBypass:
return true
}
return false
}
type AccessApplicationPolicyDeleteResponse struct {
// UUID
ID string `json:"id"`
JSON accessApplicationPolicyDeleteResponseJSON `json:"-"`
}
// accessApplicationPolicyDeleteResponseJSON contains the JSON metadata for the
// struct [AccessApplicationPolicyDeleteResponse]
type accessApplicationPolicyDeleteResponseJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AccessApplicationPolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r accessApplicationPolicyDeleteResponseJSON) RawJSON() string {
return r.raw
}
type AccessApplicationPolicyNewParams struct {
// The action Access will take if a user matches this policy.
Decision param.Field[AccessApplicationPolicyNewParamsDecision] `json:"decision,required"`
// Rules evaluated with an OR logical operator. A user needs to meet only one of
// the Include rules.
Include param.Field[[]AccessRuleUnionParam] `json:"include,required"`
// The name of the Access policy.
Name param.Field[string] `json:"name,required"`
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
ZoneID param.Field[string] `path:"zone_id"`
// Administrators who can approve a temporary authentication request.
ApprovalGroups param.Field[[]ApprovalGroupParam] `json:"approval_groups"`
// Requires the user to request access from an administrator at the start of each
// session.
ApprovalRequired param.Field[bool] `json:"approval_required"`
// Rules evaluated with a NOT logical operator. To match the policy, a user cannot
// meet any of the Exclude rules.
Exclude param.Field[[]AccessRuleUnionParam] `json:"exclude"`
// Require this application to be served in an isolated browser for users matching
// this policy. 'Client Web Isolation' must be on for the account in order to use
// this feature.
IsolationRequired param.Field[bool] `json:"isolation_required"`
// The order of execution for this policy. Must be unique for each policy.
Precedence param.Field[int64] `json:"precedence"`
// A custom message that will appear on the purpose justification screen.
PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"`
// Require users to enter a justification when they log in to the application.
PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"`
// Rules evaluated with an AND logical operator. To match the policy, a user must
// meet all of the Require rules.
Require param.Field[[]AccessRuleUnionParam] `json:"require"`
// The amount of time that tokens issued for the application will be valid. Must be
// in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s,
// m, h.
SessionDuration param.Field[string] `json:"session_duration"`
}
func (r AccessApplicationPolicyNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The action Access will take if a user matches this policy.
type AccessApplicationPolicyNewParamsDecision string
const (
AccessApplicationPolicyNewParamsDecisionAllow AccessApplicationPolicyNewParamsDecision = "allow"
AccessApplicationPolicyNewParamsDecisionDeny AccessApplicationPolicyNewParamsDecision = "deny"
AccessApplicationPolicyNewParamsDecisionNonIdentity AccessApplicationPolicyNewParamsDecision = "non_identity"
AccessApplicationPolicyNewParamsDecisionBypass AccessApplicationPolicyNewParamsDecision = "bypass"
)
func (r AccessApplicationPolicyNewParamsDecision) IsKnown() bool {
switch r {
case AccessApplicationPolicyNewParamsDecisionAllow, AccessApplicationPolicyNewParamsDecisionDeny, AccessApplicationPolicyNewParamsDecisionNonIdentity, AccessApplicationPolicyNewParamsDecisionBypass:
return true
}
return false
}
type AccessApplicationPolicyNewResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success AccessApplicationPolicyNewResponseEnvelopeSuccess `json:"success,required"`
Result Policy `json:"result"`
JSON accessApplicationPolicyNewResponseEnvelopeJSON `json:"-"`
}
// accessApplicationPolicyNewResponseEnvelopeJSON contains the JSON metadata for
// the struct [AccessApplicationPolicyNewResponseEnvelope]
type accessApplicationPolicyNewResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AccessApplicationPolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r accessApplicationPolicyNewResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type AccessApplicationPolicyNewResponseEnvelopeSuccess bool
const (
AccessApplicationPolicyNewResponseEnvelopeSuccessTrue AccessApplicationPolicyNewResponseEnvelopeSuccess = true
)
func (r AccessApplicationPolicyNewResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case AccessApplicationPolicyNewResponseEnvelopeSuccessTrue:
return true
}
return false
}
type AccessApplicationPolicyUpdateParams struct {
// The action Access will take if a user matches this policy.
Decision param.Field[AccessApplicationPolicyUpdateParamsDecision] `json:"decision,required"`
// Rules evaluated with an OR logical operator. A user needs to meet only one of
// the Include rules.
Include param.Field[[]AccessRuleUnionParam] `json:"include,required"`
// The name of the Access policy.
Name param.Field[string] `json:"name,required"`
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
ZoneID param.Field[string] `path:"zone_id"`
// Administrators who can approve a temporary authentication request.
ApprovalGroups param.Field[[]ApprovalGroupParam] `json:"approval_groups"`
// Requires the user to request access from an administrator at the start of each
// session.
ApprovalRequired param.Field[bool] `json:"approval_required"`
// Rules evaluated with a NOT logical operator. To match the policy, a user cannot
// meet any of the Exclude rules.
Exclude param.Field[[]AccessRuleUnionParam] `json:"exclude"`
// Require this application to be served in an isolated browser for users matching
// this policy. 'Client Web Isolation' must be on for the account in order to use
// this feature.
IsolationRequired param.Field[bool] `json:"isolation_required"`
// The order of execution for this policy. Must be unique for each policy.
Precedence param.Field[int64] `json:"precedence"`
// A custom message that will appear on the purpose justification screen.
PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"`
// Require users to enter a justification when they log in to the application.
PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"`
// Rules evaluated with an AND logical operator. To match the policy, a user must
// meet all of the Require rules.
Require param.Field[[]AccessRuleUnionParam] `json:"require"`
// The amount of time that tokens issued for the application will be valid. Must be
// in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s,
// m, h.
SessionDuration param.Field[string] `json:"session_duration"`
}
func (r AccessApplicationPolicyUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The action Access will take if a user matches this policy.
type AccessApplicationPolicyUpdateParamsDecision string
const (
AccessApplicationPolicyUpdateParamsDecisionAllow AccessApplicationPolicyUpdateParamsDecision = "allow"
AccessApplicationPolicyUpdateParamsDecisionDeny AccessApplicationPolicyUpdateParamsDecision = "deny"
AccessApplicationPolicyUpdateParamsDecisionNonIdentity AccessApplicationPolicyUpdateParamsDecision = "non_identity"
AccessApplicationPolicyUpdateParamsDecisionBypass AccessApplicationPolicyUpdateParamsDecision = "bypass"
)
func (r AccessApplicationPolicyUpdateParamsDecision) IsKnown() bool {
switch r {
case AccessApplicationPolicyUpdateParamsDecisionAllow, AccessApplicationPolicyUpdateParamsDecisionDeny, AccessApplicationPolicyUpdateParamsDecisionNonIdentity, AccessApplicationPolicyUpdateParamsDecisionBypass:
return true
}
return false
}
type AccessApplicationPolicyUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success AccessApplicationPolicyUpdateResponseEnvelopeSuccess `json:"success,required"`
Result Policy `json:"result"`
JSON accessApplicationPolicyUpdateResponseEnvelopeJSON `json:"-"`
}
// accessApplicationPolicyUpdateResponseEnvelopeJSON contains the JSON metadata for
// the struct [AccessApplicationPolicyUpdateResponseEnvelope]
type accessApplicationPolicyUpdateResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AccessApplicationPolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r accessApplicationPolicyUpdateResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type AccessApplicationPolicyUpdateResponseEnvelopeSuccess bool
const (
AccessApplicationPolicyUpdateResponseEnvelopeSuccessTrue AccessApplicationPolicyUpdateResponseEnvelopeSuccess = true
)
func (r AccessApplicationPolicyUpdateResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case AccessApplicationPolicyUpdateResponseEnvelopeSuccessTrue:
return true
}
return false
}
type AccessApplicationPolicyListParams struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
ZoneID param.Field[string] `path:"zone_id"`
}
type AccessApplicationPolicyDeleteParams struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
ZoneID param.Field[string] `path:"zone_id"`
}
type AccessApplicationPolicyDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success AccessApplicationPolicyDeleteResponseEnvelopeSuccess `json:"success,required"`
Result AccessApplicationPolicyDeleteResponse `json:"result"`
JSON accessApplicationPolicyDeleteResponseEnvelopeJSON `json:"-"`
}
// accessApplicationPolicyDeleteResponseEnvelopeJSON contains the JSON metadata for
// the struct [AccessApplicationPolicyDeleteResponseEnvelope]
type accessApplicationPolicyDeleteResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AccessApplicationPolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r accessApplicationPolicyDeleteResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type AccessApplicationPolicyDeleteResponseEnvelopeSuccess bool
const (
AccessApplicationPolicyDeleteResponseEnvelopeSuccessTrue AccessApplicationPolicyDeleteResponseEnvelopeSuccess = true
)
func (r AccessApplicationPolicyDeleteResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case AccessApplicationPolicyDeleteResponseEnvelopeSuccessTrue:
return true
}
return false
}
type AccessApplicationPolicyGetParams struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
ZoneID param.Field[string] `path:"zone_id"`
}
type AccessApplicationPolicyGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success AccessApplicationPolicyGetResponseEnvelopeSuccess `json:"success,required"`
Result Policy `json:"result"`
JSON accessApplicationPolicyGetResponseEnvelopeJSON `json:"-"`
}
// accessApplicationPolicyGetResponseEnvelopeJSON contains the JSON metadata for
// the struct [AccessApplicationPolicyGetResponseEnvelope]
type accessApplicationPolicyGetResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AccessApplicationPolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r accessApplicationPolicyGetResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type AccessApplicationPolicyGetResponseEnvelopeSuccess bool
const (
AccessApplicationPolicyGetResponseEnvelopeSuccessTrue AccessApplicationPolicyGetResponseEnvelopeSuccess = true
)
func (r AccessApplicationPolicyGetResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case AccessApplicationPolicyGetResponseEnvelopeSuccessTrue:
return true
}
return false
}