Skip to content

Commit e54b6c1

Browse files
feat(api): api update
1 parent ba60e13 commit e54b6c1

23 files changed

+525
-559
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: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29174d64a61919dbdebbd0c8d4ab3cb5eec6f9aacff888bdd0469ba2b8d08019.yml
3-
openapi_spec_hash: b5909bd6882171a6ff0158b9f68b47cc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d0950b4d6565ebd937ab7f58c20ec77ed448ada47e892675290ed602d1f1e5d.yml
3+
openapi_spec_hash: 3471c05655ab2e06b07d7bab145428fa
44
config_hash: cce40d4d65a4d67d5df957a75a15b567

api.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6136,10 +6136,6 @@ Methods:
61366136

61376137
### Lists
61386138

6139-
Params Types:
6140-
6141-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#GatewayItemParam">GatewayItemParam</a>
6142-
61436139
Response Types:
61446140

61456141
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#GatewayItem">GatewayItem</a>

cloudforce_one/threatevent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,15 +545,15 @@ func (r threatEventGetResponseJSON) RawJSON() string {
545545
type ThreatEventNewParams struct {
546546
// Account ID.
547547
PathAccountID param.Field[string] `path:"account_id,required"`
548-
Attacker param.Field[string] `json:"attacker,required"`
549-
AttackerCountry param.Field[string] `json:"attackerCountry,required"`
550548
Category param.Field[string] `json:"category,required"`
551549
Date param.Field[time.Time] `json:"date,required" format:"date-time"`
552550
Event param.Field[string] `json:"event,required"`
553551
IndicatorType param.Field[string] `json:"indicatorType,required"`
554552
Raw param.Field[ThreatEventNewParamsRaw] `json:"raw,required"`
555553
TLP param.Field[string] `json:"tlp,required"`
556554
BodyAccountID param.Field[float64] `json:"accountId"`
555+
Attacker param.Field[string] `json:"attacker"`
556+
AttackerCountry param.Field[string] `json:"attackerCountry"`
557557
DatasetID param.Field[string] `json:"datasetId"`
558558
Indicator param.Field[string] `json:"indicator"`
559559
Tags param.Field[[]string] `json:"tags"`
@@ -682,15 +682,15 @@ func (r ThreatEventBulkNewParams) MarshalJSON() (data []byte, err error) {
682682
}
683683

684684
type ThreatEventBulkNewParamsData struct {
685-
Attacker param.Field[string] `json:"attacker,required"`
686-
AttackerCountry param.Field[string] `json:"attackerCountry,required"`
687685
Category param.Field[string] `json:"category,required"`
688686
Date param.Field[time.Time] `json:"date,required" format:"date-time"`
689687
Event param.Field[string] `json:"event,required"`
690688
IndicatorType param.Field[string] `json:"indicatorType,required"`
691689
Raw param.Field[ThreatEventBulkNewParamsDataRaw] `json:"raw,required"`
692690
TLP param.Field[string] `json:"tlp,required"`
693691
AccountID param.Field[float64] `json:"accountId"`
692+
Attacker param.Field[string] `json:"attacker"`
693+
AttackerCountry param.Field[string] `json:"attackerCountry"`
694694
DatasetID param.Field[string] `json:"datasetId"`
695695
Indicator param.Field[string] `json:"indicator"`
696696
Tags param.Field[[]string] `json:"tags"`

cloudforce_one/threatevent_test.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ func TestThreatEventNewWithOptionalParams(t *testing.T) {
3131
option.WithAPIEmail("[email protected]"),
3232
)
3333
_, err := client.CloudforceOne.ThreatEvents.New(context.TODO(), cloudforce_one.ThreatEventNewParams{
34-
PathAccountID: cloudflare.F("account_id"),
35-
Attacker: cloudflare.F("Flying Yeti"),
36-
AttackerCountry: cloudflare.F("CN"),
37-
Category: cloudflare.F("Domain Resolution"),
38-
Date: cloudflare.F(time.Now()),
39-
Event: cloudflare.F("An attacker registered the domain domain.com"),
40-
IndicatorType: cloudflare.F("domain"),
34+
PathAccountID: cloudflare.F("account_id"),
35+
Category: cloudflare.F("Domain Resolution"),
36+
Date: cloudflare.F(time.Now()),
37+
Event: cloudflare.F("An attacker registered the domain domain.com"),
38+
IndicatorType: cloudflare.F("domain"),
4139
Raw: cloudflare.F(cloudforce_one.ThreatEventNewParamsRaw{
4240
Data: cloudflare.F(map[string]interface{}{
4341
"foo": "bar",
4442
}),
4543
Source: cloudflare.F("example.com"),
4644
TLP: cloudflare.F("amber"),
4745
}),
48-
TLP: cloudflare.F("amber"),
49-
BodyAccountID: cloudflare.F(123456.000000),
50-
DatasetID: cloudflare.F("durableObjectName"),
51-
Indicator: cloudflare.F("domain.com"),
52-
Tags: cloudflare.F([]string{"malware"}),
53-
TargetCountry: cloudflare.F("US"),
54-
TargetIndustry: cloudflare.F("Agriculture"),
46+
TLP: cloudflare.F("amber"),
47+
BodyAccountID: cloudflare.F(123456.000000),
48+
Attacker: cloudflare.F("Flying Yeti"),
49+
AttackerCountry: cloudflare.F("CN"),
50+
DatasetID: cloudflare.F("durableObjectName"),
51+
Indicator: cloudflare.F("domain.com"),
52+
Tags: cloudflare.F([]string{"malware"}),
53+
TargetCountry: cloudflare.F("US"),
54+
TargetIndustry: cloudflare.F("Agriculture"),
5555
})
5656
if err != nil {
5757
var apierr *cloudflare.Error
@@ -146,26 +146,26 @@ func TestThreatEventBulkNew(t *testing.T) {
146146
_, err := client.CloudforceOne.ThreatEvents.BulkNew(context.TODO(), cloudforce_one.ThreatEventBulkNewParams{
147147
AccountID: cloudflare.F("account_id"),
148148
Data: cloudflare.F([]cloudforce_one.ThreatEventBulkNewParamsData{{
149-
Attacker: cloudflare.F("Flying Yeti"),
150-
AttackerCountry: cloudflare.F("CN"),
151-
Category: cloudflare.F("Domain Resolution"),
152-
Date: cloudflare.F(time.Now()),
153-
Event: cloudflare.F("An attacker registered the domain domain.com"),
154-
IndicatorType: cloudflare.F("domain"),
149+
Category: cloudflare.F("Domain Resolution"),
150+
Date: cloudflare.F(time.Now()),
151+
Event: cloudflare.F("An attacker registered the domain domain.com"),
152+
IndicatorType: cloudflare.F("domain"),
155153
Raw: cloudflare.F(cloudforce_one.ThreatEventBulkNewParamsDataRaw{
156154
Data: cloudflare.F(map[string]interface{}{
157155
"foo": "bar",
158156
}),
159157
Source: cloudflare.F("example.com"),
160158
TLP: cloudflare.F("amber"),
161159
}),
162-
TLP: cloudflare.F("amber"),
163-
AccountID: cloudflare.F(123456.000000),
164-
DatasetID: cloudflare.F("durableObjectName"),
165-
Indicator: cloudflare.F("domain.com"),
166-
Tags: cloudflare.F([]string{"malware"}),
167-
TargetCountry: cloudflare.F("US"),
168-
TargetIndustry: cloudflare.F("Agriculture"),
160+
TLP: cloudflare.F("amber"),
161+
AccountID: cloudflare.F(123456.000000),
162+
Attacker: cloudflare.F("Flying Yeti"),
163+
AttackerCountry: cloudflare.F("CN"),
164+
DatasetID: cloudflare.F("durableObjectName"),
165+
Indicator: cloudflare.F("domain.com"),
166+
Tags: cloudflare.F([]string{"malware"}),
167+
TargetCountry: cloudflare.F("US"),
168+
TargetIndustry: cloudflare.F("Agriculture"),
169169
}}),
170170
DatasetID: cloudflare.F("durableObjectName"),
171171
})

email_security/investigate.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,16 @@ func (r investigateListResponseJSON) RawJSON() string {
165165
}
166166

167167
type InvestigateListResponseProperties struct {
168+
AllowlistedPatternType string `json:"allowlisted_pattern_type"`
169+
// Deprecated: deprecated
168170
WhitelistedPatternType string `json:"whitelisted_pattern_type"`
169171
JSON investigateListResponsePropertiesJSON `json:"-"`
170172
}
171173

172174
// investigateListResponsePropertiesJSON contains the JSON metadata for the struct
173175
// [InvestigateListResponseProperties]
174176
type investigateListResponsePropertiesJSON struct {
177+
AllowlistedPatternType apijson.Field
175178
WhitelistedPatternType apijson.Field
176179
raw string
177180
ExtraFields map[string]apijson.Field
@@ -378,13 +381,16 @@ func (r investigateGetResponseJSON) RawJSON() string {
378381
}
379382

380383
type InvestigateGetResponseProperties struct {
384+
AllowlistedPatternType string `json:"allowlisted_pattern_type"`
385+
// Deprecated: deprecated
381386
WhitelistedPatternType string `json:"whitelisted_pattern_type"`
382387
JSON investigateGetResponsePropertiesJSON `json:"-"`
383388
}
384389

385390
// investigateGetResponsePropertiesJSON contains the JSON metadata for the struct
386391
// [InvestigateGetResponseProperties]
387392
type investigateGetResponsePropertiesJSON struct {
393+
AllowlistedPatternType apijson.Field
388394
WhitelistedPatternType apijson.Field
389395
raw string
390396
ExtraFields map[string]apijson.Field

images/v1.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ func (r v1ListResponseJSON) RawJSON() string {
227227
type V1NewParams struct {
228228
// Account identifier tag.
229229
AccountID param.Field[string] `path:"account_id,required"`
230+
// An optional custom unique identifier for your image.
231+
ID param.Field[interface{}] `json:"id"`
230232
// An image binary data. Only needed when type is uploading a file.
231233
File param.Field[interface{}] `json:"file"`
232234
// User modifiable key-value store. Can use used for keeping references to another

images/v1_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestV1NewWithOptionalParams(t *testing.T) {
3030
)
3131
_, err := client.Images.V1.New(context.TODO(), images.V1NewParams{
3232
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
33+
ID: cloudflare.F[any](map[string]interface{}{}),
3334
File: cloudflare.F[any](map[string]interface{}{}),
3435
Metadata: cloudflare.F[any](map[string]interface{}{}),
3536
RequireSignedURLs: cloudflare.F(true),

0 commit comments

Comments
 (0)