Skip to content

Commit 51c0cf8

Browse files
feat(api): api update
1 parent e0c5002 commit 51c0cf8

File tree

3 files changed

+248
-7
lines changed

3 files changed

+248
-7
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1809
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-934be1deaed159fe2090b7081ad3149e2b0505fdcde8d408dbca4a215da21b93.yml
3-
openapi_spec_hash: f3339d41b39951a23a5b3b5d6960abd4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25c5f75db599e7cb7e77f0184c0bb0702eb72d8f09188a24a0ee9e2c1ac13b84.yml
3+
openapi_spec_hash: 215abfe391fbcb874adba0fa692b0619
44
config_hash: 9f61e9f02b675e373b140471d52b670c

ai_gateway/aigateway.go

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ type AIGatewayNewResponse struct {
169169
RateLimitingLimit int64 `json:"rate_limiting_limit,required,nullable"`
170170
RateLimitingTechnique AIGatewayNewResponseRateLimitingTechnique `json:"rate_limiting_technique,required"`
171171
Authentication bool `json:"authentication"`
172+
DLP AIGatewayNewResponseDLP `json:"dlp"`
172173
LogManagement int64 `json:"log_management,nullable"`
173174
LogManagementStrategy AIGatewayNewResponseLogManagementStrategy `json:"log_management_strategy,nullable"`
174175
Logpush bool `json:"logpush"`
@@ -193,6 +194,7 @@ type aiGatewayNewResponseJSON struct {
193194
RateLimitingLimit apijson.Field
194195
RateLimitingTechnique apijson.Field
195196
Authentication apijson.Field
197+
DLP apijson.Field
196198
LogManagement apijson.Field
197199
LogManagementStrategy apijson.Field
198200
Logpush apijson.Field
@@ -225,6 +227,46 @@ func (r AIGatewayNewResponseRateLimitingTechnique) IsKnown() bool {
225227
return false
226228
}
227229

230+
type AIGatewayNewResponseDLP struct {
231+
Action AIGatewayNewResponseDLPAction `json:"action,required"`
232+
Enabled bool `json:"enabled,required"`
233+
Profiles []string `json:"profiles,required"`
234+
JSON aiGatewayNewResponseDLPJSON `json:"-"`
235+
}
236+
237+
// aiGatewayNewResponseDLPJSON contains the JSON metadata for the struct
238+
// [AIGatewayNewResponseDLP]
239+
type aiGatewayNewResponseDLPJSON struct {
240+
Action apijson.Field
241+
Enabled apijson.Field
242+
Profiles apijson.Field
243+
raw string
244+
ExtraFields map[string]apijson.Field
245+
}
246+
247+
func (r *AIGatewayNewResponseDLP) UnmarshalJSON(data []byte) (err error) {
248+
return apijson.UnmarshalRoot(data, r)
249+
}
250+
251+
func (r aiGatewayNewResponseDLPJSON) RawJSON() string {
252+
return r.raw
253+
}
254+
255+
type AIGatewayNewResponseDLPAction string
256+
257+
const (
258+
AIGatewayNewResponseDLPActionBlock AIGatewayNewResponseDLPAction = "BLOCK"
259+
AIGatewayNewResponseDLPActionFlag AIGatewayNewResponseDLPAction = "FLAG"
260+
)
261+
262+
func (r AIGatewayNewResponseDLPAction) IsKnown() bool {
263+
switch r {
264+
case AIGatewayNewResponseDLPActionBlock, AIGatewayNewResponseDLPActionFlag:
265+
return true
266+
}
267+
return false
268+
}
269+
228270
type AIGatewayNewResponseLogManagementStrategy string
229271

230272
const (
@@ -255,6 +297,7 @@ type AIGatewayUpdateResponse struct {
255297
RateLimitingLimit int64 `json:"rate_limiting_limit,required,nullable"`
256298
RateLimitingTechnique AIGatewayUpdateResponseRateLimitingTechnique `json:"rate_limiting_technique,required"`
257299
Authentication bool `json:"authentication"`
300+
DLP AIGatewayUpdateResponseDLP `json:"dlp"`
258301
LogManagement int64 `json:"log_management,nullable"`
259302
LogManagementStrategy AIGatewayUpdateResponseLogManagementStrategy `json:"log_management_strategy,nullable"`
260303
Logpush bool `json:"logpush"`
@@ -279,6 +322,7 @@ type aiGatewayUpdateResponseJSON struct {
279322
RateLimitingLimit apijson.Field
280323
RateLimitingTechnique apijson.Field
281324
Authentication apijson.Field
325+
DLP apijson.Field
282326
LogManagement apijson.Field
283327
LogManagementStrategy apijson.Field
284328
Logpush apijson.Field
@@ -311,6 +355,46 @@ func (r AIGatewayUpdateResponseRateLimitingTechnique) IsKnown() bool {
311355
return false
312356
}
313357

358+
type AIGatewayUpdateResponseDLP struct {
359+
Action AIGatewayUpdateResponseDLPAction `json:"action,required"`
360+
Enabled bool `json:"enabled,required"`
361+
Profiles []string `json:"profiles,required"`
362+
JSON aiGatewayUpdateResponseDLPJSON `json:"-"`
363+
}
364+
365+
// aiGatewayUpdateResponseDLPJSON contains the JSON metadata for the struct
366+
// [AIGatewayUpdateResponseDLP]
367+
type aiGatewayUpdateResponseDLPJSON struct {
368+
Action apijson.Field
369+
Enabled apijson.Field
370+
Profiles apijson.Field
371+
raw string
372+
ExtraFields map[string]apijson.Field
373+
}
374+
375+
func (r *AIGatewayUpdateResponseDLP) UnmarshalJSON(data []byte) (err error) {
376+
return apijson.UnmarshalRoot(data, r)
377+
}
378+
379+
func (r aiGatewayUpdateResponseDLPJSON) RawJSON() string {
380+
return r.raw
381+
}
382+
383+
type AIGatewayUpdateResponseDLPAction string
384+
385+
const (
386+
AIGatewayUpdateResponseDLPActionBlock AIGatewayUpdateResponseDLPAction = "BLOCK"
387+
AIGatewayUpdateResponseDLPActionFlag AIGatewayUpdateResponseDLPAction = "FLAG"
388+
)
389+
390+
func (r AIGatewayUpdateResponseDLPAction) IsKnown() bool {
391+
switch r {
392+
case AIGatewayUpdateResponseDLPActionBlock, AIGatewayUpdateResponseDLPActionFlag:
393+
return true
394+
}
395+
return false
396+
}
397+
314398
type AIGatewayUpdateResponseLogManagementStrategy string
315399

316400
const (
@@ -341,6 +425,7 @@ type AIGatewayListResponse struct {
341425
RateLimitingLimit int64 `json:"rate_limiting_limit,required,nullable"`
342426
RateLimitingTechnique AIGatewayListResponseRateLimitingTechnique `json:"rate_limiting_technique,required"`
343427
Authentication bool `json:"authentication"`
428+
DLP AIGatewayListResponseDLP `json:"dlp"`
344429
LogManagement int64 `json:"log_management,nullable"`
345430
LogManagementStrategy AIGatewayListResponseLogManagementStrategy `json:"log_management_strategy,nullable"`
346431
Logpush bool `json:"logpush"`
@@ -365,6 +450,7 @@ type aiGatewayListResponseJSON struct {
365450
RateLimitingLimit apijson.Field
366451
RateLimitingTechnique apijson.Field
367452
Authentication apijson.Field
453+
DLP apijson.Field
368454
LogManagement apijson.Field
369455
LogManagementStrategy apijson.Field
370456
Logpush apijson.Field
@@ -397,6 +483,46 @@ func (r AIGatewayListResponseRateLimitingTechnique) IsKnown() bool {
397483
return false
398484
}
399485

486+
type AIGatewayListResponseDLP struct {
487+
Action AIGatewayListResponseDLPAction `json:"action,required"`
488+
Enabled bool `json:"enabled,required"`
489+
Profiles []string `json:"profiles,required"`
490+
JSON aiGatewayListResponseDLPJSON `json:"-"`
491+
}
492+
493+
// aiGatewayListResponseDLPJSON contains the JSON metadata for the struct
494+
// [AIGatewayListResponseDLP]
495+
type aiGatewayListResponseDLPJSON struct {
496+
Action apijson.Field
497+
Enabled apijson.Field
498+
Profiles apijson.Field
499+
raw string
500+
ExtraFields map[string]apijson.Field
501+
}
502+
503+
func (r *AIGatewayListResponseDLP) UnmarshalJSON(data []byte) (err error) {
504+
return apijson.UnmarshalRoot(data, r)
505+
}
506+
507+
func (r aiGatewayListResponseDLPJSON) RawJSON() string {
508+
return r.raw
509+
}
510+
511+
type AIGatewayListResponseDLPAction string
512+
513+
const (
514+
AIGatewayListResponseDLPActionBlock AIGatewayListResponseDLPAction = "BLOCK"
515+
AIGatewayListResponseDLPActionFlag AIGatewayListResponseDLPAction = "FLAG"
516+
)
517+
518+
func (r AIGatewayListResponseDLPAction) IsKnown() bool {
519+
switch r {
520+
case AIGatewayListResponseDLPActionBlock, AIGatewayListResponseDLPActionFlag:
521+
return true
522+
}
523+
return false
524+
}
525+
400526
type AIGatewayListResponseLogManagementStrategy string
401527

402528
const (
@@ -427,6 +553,7 @@ type AIGatewayDeleteResponse struct {
427553
RateLimitingLimit int64 `json:"rate_limiting_limit,required,nullable"`
428554
RateLimitingTechnique AIGatewayDeleteResponseRateLimitingTechnique `json:"rate_limiting_technique,required"`
429555
Authentication bool `json:"authentication"`
556+
DLP AIGatewayDeleteResponseDLP `json:"dlp"`
430557
LogManagement int64 `json:"log_management,nullable"`
431558
LogManagementStrategy AIGatewayDeleteResponseLogManagementStrategy `json:"log_management_strategy,nullable"`
432559
Logpush bool `json:"logpush"`
@@ -451,6 +578,7 @@ type aiGatewayDeleteResponseJSON struct {
451578
RateLimitingLimit apijson.Field
452579
RateLimitingTechnique apijson.Field
453580
Authentication apijson.Field
581+
DLP apijson.Field
454582
LogManagement apijson.Field
455583
LogManagementStrategy apijson.Field
456584
Logpush apijson.Field
@@ -483,6 +611,46 @@ func (r AIGatewayDeleteResponseRateLimitingTechnique) IsKnown() bool {
483611
return false
484612
}
485613

614+
type AIGatewayDeleteResponseDLP struct {
615+
Action AIGatewayDeleteResponseDLPAction `json:"action,required"`
616+
Enabled bool `json:"enabled,required"`
617+
Profiles []string `json:"profiles,required"`
618+
JSON aiGatewayDeleteResponseDLPJSON `json:"-"`
619+
}
620+
621+
// aiGatewayDeleteResponseDLPJSON contains the JSON metadata for the struct
622+
// [AIGatewayDeleteResponseDLP]
623+
type aiGatewayDeleteResponseDLPJSON struct {
624+
Action apijson.Field
625+
Enabled apijson.Field
626+
Profiles apijson.Field
627+
raw string
628+
ExtraFields map[string]apijson.Field
629+
}
630+
631+
func (r *AIGatewayDeleteResponseDLP) UnmarshalJSON(data []byte) (err error) {
632+
return apijson.UnmarshalRoot(data, r)
633+
}
634+
635+
func (r aiGatewayDeleteResponseDLPJSON) RawJSON() string {
636+
return r.raw
637+
}
638+
639+
type AIGatewayDeleteResponseDLPAction string
640+
641+
const (
642+
AIGatewayDeleteResponseDLPActionBlock AIGatewayDeleteResponseDLPAction = "BLOCK"
643+
AIGatewayDeleteResponseDLPActionFlag AIGatewayDeleteResponseDLPAction = "FLAG"
644+
)
645+
646+
func (r AIGatewayDeleteResponseDLPAction) IsKnown() bool {
647+
switch r {
648+
case AIGatewayDeleteResponseDLPActionBlock, AIGatewayDeleteResponseDLPActionFlag:
649+
return true
650+
}
651+
return false
652+
}
653+
486654
type AIGatewayDeleteResponseLogManagementStrategy string
487655

488656
const (
@@ -513,6 +681,7 @@ type AIGatewayGetResponse struct {
513681
RateLimitingLimit int64 `json:"rate_limiting_limit,required,nullable"`
514682
RateLimitingTechnique AIGatewayGetResponseRateLimitingTechnique `json:"rate_limiting_technique,required"`
515683
Authentication bool `json:"authentication"`
684+
DLP AIGatewayGetResponseDLP `json:"dlp"`
516685
LogManagement int64 `json:"log_management,nullable"`
517686
LogManagementStrategy AIGatewayGetResponseLogManagementStrategy `json:"log_management_strategy,nullable"`
518687
Logpush bool `json:"logpush"`
@@ -537,6 +706,7 @@ type aiGatewayGetResponseJSON struct {
537706
RateLimitingLimit apijson.Field
538707
RateLimitingTechnique apijson.Field
539708
Authentication apijson.Field
709+
DLP apijson.Field
540710
LogManagement apijson.Field
541711
LogManagementStrategy apijson.Field
542712
Logpush apijson.Field
@@ -569,6 +739,46 @@ func (r AIGatewayGetResponseRateLimitingTechnique) IsKnown() bool {
569739
return false
570740
}
571741

742+
type AIGatewayGetResponseDLP struct {
743+
Action AIGatewayGetResponseDLPAction `json:"action,required"`
744+
Enabled bool `json:"enabled,required"`
745+
Profiles []string `json:"profiles,required"`
746+
JSON aiGatewayGetResponseDLPJSON `json:"-"`
747+
}
748+
749+
// aiGatewayGetResponseDLPJSON contains the JSON metadata for the struct
750+
// [AIGatewayGetResponseDLP]
751+
type aiGatewayGetResponseDLPJSON struct {
752+
Action apijson.Field
753+
Enabled apijson.Field
754+
Profiles apijson.Field
755+
raw string
756+
ExtraFields map[string]apijson.Field
757+
}
758+
759+
func (r *AIGatewayGetResponseDLP) UnmarshalJSON(data []byte) (err error) {
760+
return apijson.UnmarshalRoot(data, r)
761+
}
762+
763+
func (r aiGatewayGetResponseDLPJSON) RawJSON() string {
764+
return r.raw
765+
}
766+
767+
type AIGatewayGetResponseDLPAction string
768+
769+
const (
770+
AIGatewayGetResponseDLPActionBlock AIGatewayGetResponseDLPAction = "BLOCK"
771+
AIGatewayGetResponseDLPActionFlag AIGatewayGetResponseDLPAction = "FLAG"
772+
)
773+
774+
func (r AIGatewayGetResponseDLPAction) IsKnown() bool {
775+
switch r {
776+
case AIGatewayGetResponseDLPActionBlock, AIGatewayGetResponseDLPActionFlag:
777+
return true
778+
}
779+
return false
780+
}
781+
572782
type AIGatewayGetResponseLogManagementStrategy string
573783

574784
const (
@@ -667,6 +877,7 @@ type AIGatewayUpdateParams struct {
667877
RateLimitingLimit param.Field[int64] `json:"rate_limiting_limit,required"`
668878
RateLimitingTechnique param.Field[AIGatewayUpdateParamsRateLimitingTechnique] `json:"rate_limiting_technique,required"`
669879
Authentication param.Field[bool] `json:"authentication"`
880+
DLP param.Field[AIGatewayUpdateParamsDLP] `json:"dlp"`
670881
LogManagement param.Field[int64] `json:"log_management"`
671882
LogManagementStrategy param.Field[AIGatewayUpdateParamsLogManagementStrategy] `json:"log_management_strategy"`
672883
Logpush param.Field[bool] `json:"logpush"`
@@ -693,6 +904,31 @@ func (r AIGatewayUpdateParamsRateLimitingTechnique) IsKnown() bool {
693904
return false
694905
}
695906

907+
type AIGatewayUpdateParamsDLP struct {
908+
Action param.Field[AIGatewayUpdateParamsDLPAction] `json:"action,required"`
909+
Enabled param.Field[bool] `json:"enabled,required"`
910+
Profiles param.Field[[]string] `json:"profiles,required"`
911+
}
912+
913+
func (r AIGatewayUpdateParamsDLP) MarshalJSON() (data []byte, err error) {
914+
return apijson.MarshalRoot(r)
915+
}
916+
917+
type AIGatewayUpdateParamsDLPAction string
918+
919+
const (
920+
AIGatewayUpdateParamsDLPActionBlock AIGatewayUpdateParamsDLPAction = "BLOCK"
921+
AIGatewayUpdateParamsDLPActionFlag AIGatewayUpdateParamsDLPAction = "FLAG"
922+
)
923+
924+
func (r AIGatewayUpdateParamsDLPAction) IsKnown() bool {
925+
switch r {
926+
case AIGatewayUpdateParamsDLPActionBlock, AIGatewayUpdateParamsDLPActionFlag:
927+
return true
928+
}
929+
return false
930+
}
931+
696932
type AIGatewayUpdateParamsLogManagementStrategy string
697933

698934
const (

ai_gateway/aigateway_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,16 @@ func TestAIGatewayUpdateWithOptionalParams(t *testing.T) {
7676
RateLimitingLimit: cloudflare.F(int64(0)),
7777
RateLimitingTechnique: cloudflare.F(ai_gateway.AIGatewayUpdateParamsRateLimitingTechniqueFixed),
7878
Authentication: cloudflare.F(true),
79-
LogManagement: cloudflare.F(int64(10000)),
80-
LogManagementStrategy: cloudflare.F(ai_gateway.AIGatewayUpdateParamsLogManagementStrategyStopInserting),
81-
Logpush: cloudflare.F(true),
82-
LogpushPublicKey: cloudflare.F("xxxxxxxxxxxxxxxx"),
83-
StoreID: cloudflare.F("store_id"),
79+
DLP: cloudflare.F(ai_gateway.AIGatewayUpdateParamsDLP{
80+
Action: cloudflare.F(ai_gateway.AIGatewayUpdateParamsDLPActionBlock),
81+
Enabled: cloudflare.F(true),
82+
Profiles: cloudflare.F([]string{"string"}),
83+
}),
84+
LogManagement: cloudflare.F(int64(10000)),
85+
LogManagementStrategy: cloudflare.F(ai_gateway.AIGatewayUpdateParamsLogManagementStrategyStopInserting),
86+
Logpush: cloudflare.F(true),
87+
LogpushPublicKey: cloudflare.F("xxxxxxxxxxxxxxxx"),
88+
StoreID: cloudflare.F("store_id"),
8489
},
8590
)
8691
if err != nil {

0 commit comments

Comments
 (0)