7
7
"errors"
8
8
"fmt"
9
9
"net/http"
10
+ "reflect"
10
11
"time"
11
12
12
13
"github.com/cloudflare/cloudflare-go/v4/internal/apijson"
@@ -15,6 +16,7 @@ import (
15
16
"github.com/cloudflare/cloudflare-go/v4/option"
16
17
"github.com/cloudflare/cloudflare-go/v4/packages/pagination"
17
18
"github.com/cloudflare/cloudflare-go/v4/shared"
19
+ "github.com/tidwall/gjson"
18
20
)
19
21
20
22
// DLPEmailRuleService contains methods and other services that help with
@@ -236,10 +238,10 @@ func (r DLPEmailRuleNewResponseActionAction) IsKnown() bool {
236
238
}
237
239
238
240
type DLPEmailRuleNewResponseCondition struct {
239
- Operator DLPEmailRuleNewResponseConditionsOperator `json:"operator,required"`
240
- Selector DLPEmailRuleNewResponseConditionsSelector `json:"selector,required"`
241
- Value interface {} `json:"value,required"`
242
- JSON dlpEmailRuleNewResponseConditionJSON `json:"-"`
241
+ Operator DLPEmailRuleNewResponseConditionsOperator `json:"operator,required"`
242
+ Selector DLPEmailRuleNewResponseConditionsSelector `json:"selector,required"`
243
+ Value DLPEmailRuleNewResponseConditionsValueUnion `json:"value,required"`
244
+ JSON dlpEmailRuleNewResponseConditionJSON `json:"-"`
243
245
}
244
246
245
247
// dlpEmailRuleNewResponseConditionJSON contains the JSON metadata for the struct
@@ -293,6 +295,32 @@ func (r DLPEmailRuleNewResponseConditionsSelector) IsKnown() bool {
293
295
return false
294
296
}
295
297
298
+ // Union satisfied by [zero_trust.DLPEmailRuleNewResponseConditionsValueArray] or
299
+ // [shared.UnionString].
300
+ type DLPEmailRuleNewResponseConditionsValueUnion interface {
301
+ ImplementsZeroTrustDLPEmailRuleNewResponseConditionsValueUnion ()
302
+ }
303
+
304
+ func init () {
305
+ apijson .RegisterUnion (
306
+ reflect .TypeOf ((* DLPEmailRuleNewResponseConditionsValueUnion )(nil )).Elem (),
307
+ "" ,
308
+ apijson.UnionVariant {
309
+ TypeFilter : gjson .JSON ,
310
+ Type : reflect .TypeOf (DLPEmailRuleNewResponseConditionsValueArray {}),
311
+ },
312
+ apijson.UnionVariant {
313
+ TypeFilter : gjson .String ,
314
+ Type : reflect .TypeOf (shared .UnionString ("" )),
315
+ },
316
+ )
317
+ }
318
+
319
+ type DLPEmailRuleNewResponseConditionsValueArray []string
320
+
321
+ func (r DLPEmailRuleNewResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleNewResponseConditionsValueUnion () {
322
+ }
323
+
296
324
type DLPEmailRuleUpdateResponse struct {
297
325
Action DLPEmailRuleUpdateResponseAction `json:"action,required"`
298
326
// Rule is triggered if all conditions match
@@ -369,10 +397,10 @@ func (r DLPEmailRuleUpdateResponseActionAction) IsKnown() bool {
369
397
}
370
398
371
399
type DLPEmailRuleUpdateResponseCondition struct {
372
- Operator DLPEmailRuleUpdateResponseConditionsOperator `json:"operator,required"`
373
- Selector DLPEmailRuleUpdateResponseConditionsSelector `json:"selector,required"`
374
- Value interface {} `json:"value,required"`
375
- JSON dlpEmailRuleUpdateResponseConditionJSON `json:"-"`
400
+ Operator DLPEmailRuleUpdateResponseConditionsOperator `json:"operator,required"`
401
+ Selector DLPEmailRuleUpdateResponseConditionsSelector `json:"selector,required"`
402
+ Value DLPEmailRuleUpdateResponseConditionsValueUnion `json:"value,required"`
403
+ JSON dlpEmailRuleUpdateResponseConditionJSON `json:"-"`
376
404
}
377
405
378
406
// dlpEmailRuleUpdateResponseConditionJSON contains the JSON metadata for the
@@ -426,6 +454,32 @@ func (r DLPEmailRuleUpdateResponseConditionsSelector) IsKnown() bool {
426
454
return false
427
455
}
428
456
457
+ // Union satisfied by [zero_trust.DLPEmailRuleUpdateResponseConditionsValueArray]
458
+ // or [shared.UnionString].
459
+ type DLPEmailRuleUpdateResponseConditionsValueUnion interface {
460
+ ImplementsZeroTrustDLPEmailRuleUpdateResponseConditionsValueUnion ()
461
+ }
462
+
463
+ func init () {
464
+ apijson .RegisterUnion (
465
+ reflect .TypeOf ((* DLPEmailRuleUpdateResponseConditionsValueUnion )(nil )).Elem (),
466
+ "" ,
467
+ apijson.UnionVariant {
468
+ TypeFilter : gjson .JSON ,
469
+ Type : reflect .TypeOf (DLPEmailRuleUpdateResponseConditionsValueArray {}),
470
+ },
471
+ apijson.UnionVariant {
472
+ TypeFilter : gjson .String ,
473
+ Type : reflect .TypeOf (shared .UnionString ("" )),
474
+ },
475
+ )
476
+ }
477
+
478
+ type DLPEmailRuleUpdateResponseConditionsValueArray []string
479
+
480
+ func (r DLPEmailRuleUpdateResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleUpdateResponseConditionsValueUnion () {
481
+ }
482
+
429
483
type DLPEmailRuleListResponse struct {
430
484
Action DLPEmailRuleListResponseAction `json:"action,required"`
431
485
// Rule is triggered if all conditions match
@@ -502,10 +556,10 @@ func (r DLPEmailRuleListResponseActionAction) IsKnown() bool {
502
556
}
503
557
504
558
type DLPEmailRuleListResponseCondition struct {
505
- Operator DLPEmailRuleListResponseConditionsOperator `json:"operator,required"`
506
- Selector DLPEmailRuleListResponseConditionsSelector `json:"selector,required"`
507
- Value interface {} `json:"value,required"`
508
- JSON dlpEmailRuleListResponseConditionJSON `json:"-"`
559
+ Operator DLPEmailRuleListResponseConditionsOperator `json:"operator,required"`
560
+ Selector DLPEmailRuleListResponseConditionsSelector `json:"selector,required"`
561
+ Value DLPEmailRuleListResponseConditionsValueUnion `json:"value,required"`
562
+ JSON dlpEmailRuleListResponseConditionJSON `json:"-"`
509
563
}
510
564
511
565
// dlpEmailRuleListResponseConditionJSON contains the JSON metadata for the struct
@@ -559,6 +613,32 @@ func (r DLPEmailRuleListResponseConditionsSelector) IsKnown() bool {
559
613
return false
560
614
}
561
615
616
+ // Union satisfied by [zero_trust.DLPEmailRuleListResponseConditionsValueArray] or
617
+ // [shared.UnionString].
618
+ type DLPEmailRuleListResponseConditionsValueUnion interface {
619
+ ImplementsZeroTrustDLPEmailRuleListResponseConditionsValueUnion ()
620
+ }
621
+
622
+ func init () {
623
+ apijson .RegisterUnion (
624
+ reflect .TypeOf ((* DLPEmailRuleListResponseConditionsValueUnion )(nil )).Elem (),
625
+ "" ,
626
+ apijson.UnionVariant {
627
+ TypeFilter : gjson .JSON ,
628
+ Type : reflect .TypeOf (DLPEmailRuleListResponseConditionsValueArray {}),
629
+ },
630
+ apijson.UnionVariant {
631
+ TypeFilter : gjson .String ,
632
+ Type : reflect .TypeOf (shared .UnionString ("" )),
633
+ },
634
+ )
635
+ }
636
+
637
+ type DLPEmailRuleListResponseConditionsValueArray []string
638
+
639
+ func (r DLPEmailRuleListResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleListResponseConditionsValueUnion () {
640
+ }
641
+
562
642
type DLPEmailRuleDeleteResponse struct {
563
643
Action DLPEmailRuleDeleteResponseAction `json:"action,required"`
564
644
// Rule is triggered if all conditions match
@@ -635,10 +715,10 @@ func (r DLPEmailRuleDeleteResponseActionAction) IsKnown() bool {
635
715
}
636
716
637
717
type DLPEmailRuleDeleteResponseCondition struct {
638
- Operator DLPEmailRuleDeleteResponseConditionsOperator `json:"operator,required"`
639
- Selector DLPEmailRuleDeleteResponseConditionsSelector `json:"selector,required"`
640
- Value interface {} `json:"value,required"`
641
- JSON dlpEmailRuleDeleteResponseConditionJSON `json:"-"`
718
+ Operator DLPEmailRuleDeleteResponseConditionsOperator `json:"operator,required"`
719
+ Selector DLPEmailRuleDeleteResponseConditionsSelector `json:"selector,required"`
720
+ Value DLPEmailRuleDeleteResponseConditionsValueUnion `json:"value,required"`
721
+ JSON dlpEmailRuleDeleteResponseConditionJSON `json:"-"`
642
722
}
643
723
644
724
// dlpEmailRuleDeleteResponseConditionJSON contains the JSON metadata for the
@@ -692,6 +772,32 @@ func (r DLPEmailRuleDeleteResponseConditionsSelector) IsKnown() bool {
692
772
return false
693
773
}
694
774
775
+ // Union satisfied by [zero_trust.DLPEmailRuleDeleteResponseConditionsValueArray]
776
+ // or [shared.UnionString].
777
+ type DLPEmailRuleDeleteResponseConditionsValueUnion interface {
778
+ ImplementsZeroTrustDLPEmailRuleDeleteResponseConditionsValueUnion ()
779
+ }
780
+
781
+ func init () {
782
+ apijson .RegisterUnion (
783
+ reflect .TypeOf ((* DLPEmailRuleDeleteResponseConditionsValueUnion )(nil )).Elem (),
784
+ "" ,
785
+ apijson.UnionVariant {
786
+ TypeFilter : gjson .JSON ,
787
+ Type : reflect .TypeOf (DLPEmailRuleDeleteResponseConditionsValueArray {}),
788
+ },
789
+ apijson.UnionVariant {
790
+ TypeFilter : gjson .String ,
791
+ Type : reflect .TypeOf (shared .UnionString ("" )),
792
+ },
793
+ )
794
+ }
795
+
796
+ type DLPEmailRuleDeleteResponseConditionsValueArray []string
797
+
798
+ func (r DLPEmailRuleDeleteResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleDeleteResponseConditionsValueUnion () {
799
+ }
800
+
695
801
type DLPEmailRuleBulkEditResponse struct {
696
802
Action DLPEmailRuleBulkEditResponseAction `json:"action,required"`
697
803
// Rule is triggered if all conditions match
@@ -768,10 +874,10 @@ func (r DLPEmailRuleBulkEditResponseActionAction) IsKnown() bool {
768
874
}
769
875
770
876
type DLPEmailRuleBulkEditResponseCondition struct {
771
- Operator DLPEmailRuleBulkEditResponseConditionsOperator `json:"operator,required"`
772
- Selector DLPEmailRuleBulkEditResponseConditionsSelector `json:"selector,required"`
773
- Value interface {} `json:"value,required"`
774
- JSON dlpEmailRuleBulkEditResponseConditionJSON `json:"-"`
877
+ Operator DLPEmailRuleBulkEditResponseConditionsOperator `json:"operator,required"`
878
+ Selector DLPEmailRuleBulkEditResponseConditionsSelector `json:"selector,required"`
879
+ Value DLPEmailRuleBulkEditResponseConditionsValueUnion `json:"value,required"`
880
+ JSON dlpEmailRuleBulkEditResponseConditionJSON `json:"-"`
775
881
}
776
882
777
883
// dlpEmailRuleBulkEditResponseConditionJSON contains the JSON metadata for the
@@ -825,6 +931,32 @@ func (r DLPEmailRuleBulkEditResponseConditionsSelector) IsKnown() bool {
825
931
return false
826
932
}
827
933
934
+ // Union satisfied by [zero_trust.DLPEmailRuleBulkEditResponseConditionsValueArray]
935
+ // or [shared.UnionString].
936
+ type DLPEmailRuleBulkEditResponseConditionsValueUnion interface {
937
+ ImplementsZeroTrustDLPEmailRuleBulkEditResponseConditionsValueUnion ()
938
+ }
939
+
940
+ func init () {
941
+ apijson .RegisterUnion (
942
+ reflect .TypeOf ((* DLPEmailRuleBulkEditResponseConditionsValueUnion )(nil )).Elem (),
943
+ "" ,
944
+ apijson.UnionVariant {
945
+ TypeFilter : gjson .JSON ,
946
+ Type : reflect .TypeOf (DLPEmailRuleBulkEditResponseConditionsValueArray {}),
947
+ },
948
+ apijson.UnionVariant {
949
+ TypeFilter : gjson .String ,
950
+ Type : reflect .TypeOf (shared .UnionString ("" )),
951
+ },
952
+ )
953
+ }
954
+
955
+ type DLPEmailRuleBulkEditResponseConditionsValueArray []string
956
+
957
+ func (r DLPEmailRuleBulkEditResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleBulkEditResponseConditionsValueUnion () {
958
+ }
959
+
828
960
type DLPEmailRuleGetResponse struct {
829
961
Action DLPEmailRuleGetResponseAction `json:"action,required"`
830
962
// Rule is triggered if all conditions match
@@ -901,10 +1033,10 @@ func (r DLPEmailRuleGetResponseActionAction) IsKnown() bool {
901
1033
}
902
1034
903
1035
type DLPEmailRuleGetResponseCondition struct {
904
- Operator DLPEmailRuleGetResponseConditionsOperator `json:"operator,required"`
905
- Selector DLPEmailRuleGetResponseConditionsSelector `json:"selector,required"`
906
- Value interface {} `json:"value,required"`
907
- JSON dlpEmailRuleGetResponseConditionJSON `json:"-"`
1036
+ Operator DLPEmailRuleGetResponseConditionsOperator `json:"operator,required"`
1037
+ Selector DLPEmailRuleGetResponseConditionsSelector `json:"selector,required"`
1038
+ Value DLPEmailRuleGetResponseConditionsValueUnion `json:"value,required"`
1039
+ JSON dlpEmailRuleGetResponseConditionJSON `json:"-"`
908
1040
}
909
1041
910
1042
// dlpEmailRuleGetResponseConditionJSON contains the JSON metadata for the struct
@@ -958,6 +1090,32 @@ func (r DLPEmailRuleGetResponseConditionsSelector) IsKnown() bool {
958
1090
return false
959
1091
}
960
1092
1093
+ // Union satisfied by [zero_trust.DLPEmailRuleGetResponseConditionsValueArray] or
1094
+ // [shared.UnionString].
1095
+ type DLPEmailRuleGetResponseConditionsValueUnion interface {
1096
+ ImplementsZeroTrustDLPEmailRuleGetResponseConditionsValueUnion ()
1097
+ }
1098
+
1099
+ func init () {
1100
+ apijson .RegisterUnion (
1101
+ reflect .TypeOf ((* DLPEmailRuleGetResponseConditionsValueUnion )(nil )).Elem (),
1102
+ "" ,
1103
+ apijson.UnionVariant {
1104
+ TypeFilter : gjson .JSON ,
1105
+ Type : reflect .TypeOf (DLPEmailRuleGetResponseConditionsValueArray {}),
1106
+ },
1107
+ apijson.UnionVariant {
1108
+ TypeFilter : gjson .String ,
1109
+ Type : reflect .TypeOf (shared .UnionString ("" )),
1110
+ },
1111
+ )
1112
+ }
1113
+
1114
+ type DLPEmailRuleGetResponseConditionsValueArray []string
1115
+
1116
+ func (r DLPEmailRuleGetResponseConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleGetResponseConditionsValueUnion () {
1117
+ }
1118
+
961
1119
type DLPEmailRuleNewParams struct {
962
1120
AccountID param.Field [string ] `path:"account_id,required"`
963
1121
Action param.Field [DLPEmailRuleNewParamsAction ] `json:"action,required"`
@@ -996,9 +1154,9 @@ func (r DLPEmailRuleNewParamsActionAction) IsKnown() bool {
996
1154
}
997
1155
998
1156
type DLPEmailRuleNewParamsCondition struct {
999
- Operator param.Field [DLPEmailRuleNewParamsConditionsOperator ] `json:"operator,required"`
1000
- Selector param.Field [DLPEmailRuleNewParamsConditionsSelector ] `json:"selector,required"`
1001
- Value param.Field [interface {}] `json:"value,required"`
1157
+ Operator param.Field [DLPEmailRuleNewParamsConditionsOperator ] `json:"operator,required"`
1158
+ Selector param.Field [DLPEmailRuleNewParamsConditionsSelector ] `json:"selector,required"`
1159
+ Value param.Field [DLPEmailRuleNewParamsConditionsValueUnion ] `json:"value,required"`
1002
1160
}
1003
1161
1004
1162
func (r DLPEmailRuleNewParamsCondition ) MarshalJSON () (data []byte , err error ) {
@@ -1038,6 +1196,17 @@ func (r DLPEmailRuleNewParamsConditionsSelector) IsKnown() bool {
1038
1196
return false
1039
1197
}
1040
1198
1199
+ // Satisfied by [zero_trust.DLPEmailRuleNewParamsConditionsValueArray],
1200
+ // [shared.UnionString].
1201
+ type DLPEmailRuleNewParamsConditionsValueUnion interface {
1202
+ ImplementsZeroTrustDLPEmailRuleNewParamsConditionsValueUnion ()
1203
+ }
1204
+
1205
+ type DLPEmailRuleNewParamsConditionsValueArray []string
1206
+
1207
+ func (r DLPEmailRuleNewParamsConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleNewParamsConditionsValueUnion () {
1208
+ }
1209
+
1041
1210
type DLPEmailRuleNewResponseEnvelope struct {
1042
1211
Errors []shared.ResponseInfo `json:"errors,required"`
1043
1212
Messages []shared.ResponseInfo `json:"messages,required"`
@@ -1119,9 +1288,9 @@ func (r DLPEmailRuleUpdateParamsActionAction) IsKnown() bool {
1119
1288
}
1120
1289
1121
1290
type DLPEmailRuleUpdateParamsCondition struct {
1122
- Operator param.Field [DLPEmailRuleUpdateParamsConditionsOperator ] `json:"operator,required"`
1123
- Selector param.Field [DLPEmailRuleUpdateParamsConditionsSelector ] `json:"selector,required"`
1124
- Value param.Field [interface {}] `json:"value,required"`
1291
+ Operator param.Field [DLPEmailRuleUpdateParamsConditionsOperator ] `json:"operator,required"`
1292
+ Selector param.Field [DLPEmailRuleUpdateParamsConditionsSelector ] `json:"selector,required"`
1293
+ Value param.Field [DLPEmailRuleUpdateParamsConditionsValueUnion ] `json:"value,required"`
1125
1294
}
1126
1295
1127
1296
func (r DLPEmailRuleUpdateParamsCondition ) MarshalJSON () (data []byte , err error ) {
@@ -1161,6 +1330,17 @@ func (r DLPEmailRuleUpdateParamsConditionsSelector) IsKnown() bool {
1161
1330
return false
1162
1331
}
1163
1332
1333
+ // Satisfied by [zero_trust.DLPEmailRuleUpdateParamsConditionsValueArray],
1334
+ // [shared.UnionString].
1335
+ type DLPEmailRuleUpdateParamsConditionsValueUnion interface {
1336
+ ImplementsZeroTrustDLPEmailRuleUpdateParamsConditionsValueUnion ()
1337
+ }
1338
+
1339
+ type DLPEmailRuleUpdateParamsConditionsValueArray []string
1340
+
1341
+ func (r DLPEmailRuleUpdateParamsConditionsValueArray ) ImplementsZeroTrustDLPEmailRuleUpdateParamsConditionsValueUnion () {
1342
+ }
1343
+
1164
1344
type DLPEmailRuleUpdateResponseEnvelope struct {
1165
1345
Errors []shared.ResponseInfo `json:"errors,required"`
1166
1346
Messages []shared.ResponseInfo `json:"messages,required"`
0 commit comments