Skip to content

Commit 8b1203b

Browse files
chore(api): update composite API spec
1 parent 68eb7ee commit 8b1203b

File tree

8 files changed

+255
-3
lines changed

8 files changed

+255
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1865
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25948e3293c7ca8798d7722f962cf2fc566faa8880489e0746d3a16f1e02e523.yml
3-
openapi_spec_hash: 97e3f177c34640dd60815a578f1ed7bd
1+
configured_endpoints: 1867
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff0a3f42ea21b040e9bbddbe548b9ce8ada7133f171cfec847b1757b84e6c2cd.yml
3+
openapi_spec_hash: d0ce24cbb42173ac9a438105e88a292b
44
config_hash: e16fca6aff930b2279d586d92022f7d1

api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8585,6 +8585,7 @@ Response Types:
85858585
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventListResponse">ThreatEventListResponse</a>
85868586
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventDeleteResponse">ThreatEventDeleteResponse</a>
85878587
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventEditResponse">ThreatEventEditResponse</a>
8588+
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventGetResponse">ThreatEventGetResponse</a>
85888589

85898590
Methods:
85908591

@@ -8593,6 +8594,7 @@ Methods:
85938594
- <code title="delete /accounts/{account_id}/cloudforce-one/events/{event_id}">client.CloudforceOne.ThreatEvents.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, eventID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventDeleteParams">ThreatEventDeleteParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventDeleteResponse">ThreatEventDeleteResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
85948595
- <code title="post /accounts/{account_id}/cloudforce-one/events/create/bulk">client.CloudforceOne.ThreatEvents.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventService.BulkNew">BulkNew</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventBulkNewParams">ThreatEventBulkNewParams</a>) (<a href="https://pkg.go.dev/builtin#float64">float64</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
85958596
- <code title="patch /accounts/{account_id}/cloudforce-one/events/{event_id}">client.CloudforceOne.ThreatEvents.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventService.Edit">Edit</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, eventID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventEditParams">ThreatEventEditParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventEditResponse">ThreatEventEditResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
8597+
- <code title="get /accounts/{account_id}/cloudforce-one/events/{event_id}">client.CloudforceOne.ThreatEvents.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, eventID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventGetParams">ThreatEventGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventGetResponse">ThreatEventGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
85968598

85978599
### Attackers
85988600

@@ -8656,6 +8658,14 @@ Methods:
86568658

86578659
### IndicatorTypes
86588660

8661+
Response Types:
8662+
8663+
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventIndicatorTypeListResponse">ThreatEventIndicatorTypeListResponse</a>
8664+
8665+
Methods:
8666+
8667+
- <code title="get /accounts/{account_id}/cloudforce-one/events/indicatorTypes">client.CloudforceOne.ThreatEvents.IndicatorTypes.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventIndicatorTypeService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventIndicatorTypeListParams">ThreatEventIndicatorTypeListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one">cloudforce_one</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v6/cloudforce_one#ThreatEventIndicatorTypeListResponse">ThreatEventIndicatorTypeListResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
8668+
86598669
### Raw
86608670

86618671
Response Types:

cloudforce_one/threatevent.go

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,25 @@ func (r *ThreatEventService) Edit(ctx context.Context, eventID string, params Th
142142
return
143143
}
144144

145+
// This Method is deprecated. Please use
146+
// /events/dataset/:dataset_id/events/:event_id instead.
147+
//
148+
// Deprecated: deprecated
149+
func (r *ThreatEventService) Get(ctx context.Context, eventID string, query ThreatEventGetParams, opts ...option.RequestOption) (res *ThreatEventGetResponse, err error) {
150+
opts = slices.Concat(r.Options, opts)
151+
if query.AccountID.Value == "" {
152+
err = errors.New("missing required account_id parameter")
153+
return
154+
}
155+
if eventID == "" {
156+
err = errors.New("missing required event_id parameter")
157+
return
158+
}
159+
path := fmt.Sprintf("accounts/%s/cloudforce-one/events/%s", query.AccountID, eventID)
160+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
161+
return
162+
}
163+
145164
type ThreatEventNewResponse struct {
146165
Attacker string `json:"attacker,required"`
147166
AttackerCountry string `json:"attackerCountry,required"`
@@ -364,6 +383,73 @@ func (r threatEventEditResponseJSON) RawJSON() string {
364383
return r.raw
365384
}
366385

386+
type ThreatEventGetResponse struct {
387+
Attacker string `json:"attacker,required"`
388+
AttackerCountry string `json:"attackerCountry,required"`
389+
Category string `json:"category,required"`
390+
Date string `json:"date,required"`
391+
Event string `json:"event,required"`
392+
Indicator string `json:"indicator,required"`
393+
IndicatorType string `json:"indicatorType,required"`
394+
IndicatorTypeID float64 `json:"indicatorTypeId,required"`
395+
KillChain float64 `json:"killChain,required"`
396+
MitreAttack []string `json:"mitreAttack,required"`
397+
NumReferenced float64 `json:"numReferenced,required"`
398+
NumReferences float64 `json:"numReferences,required"`
399+
RawID string `json:"rawId,required"`
400+
Referenced []string `json:"referenced,required"`
401+
ReferencedIDs []float64 `json:"referencedIds,required"`
402+
References []string `json:"references,required"`
403+
ReferencesIDs []float64 `json:"referencesIds,required"`
404+
Tags []string `json:"tags,required"`
405+
TargetCountry string `json:"targetCountry,required"`
406+
TargetIndustry string `json:"targetIndustry,required"`
407+
TLP string `json:"tlp,required"`
408+
UUID string `json:"uuid,required"`
409+
Insight string `json:"insight"`
410+
ReleasabilityID string `json:"releasabilityId"`
411+
JSON threatEventGetResponseJSON `json:"-"`
412+
}
413+
414+
// threatEventGetResponseJSON contains the JSON metadata for the struct
415+
// [ThreatEventGetResponse]
416+
type threatEventGetResponseJSON struct {
417+
Attacker apijson.Field
418+
AttackerCountry apijson.Field
419+
Category apijson.Field
420+
Date apijson.Field
421+
Event apijson.Field
422+
Indicator apijson.Field
423+
IndicatorType apijson.Field
424+
IndicatorTypeID apijson.Field
425+
KillChain apijson.Field
426+
MitreAttack apijson.Field
427+
NumReferenced apijson.Field
428+
NumReferences apijson.Field
429+
RawID apijson.Field
430+
Referenced apijson.Field
431+
ReferencedIDs apijson.Field
432+
References apijson.Field
433+
ReferencesIDs apijson.Field
434+
Tags apijson.Field
435+
TargetCountry apijson.Field
436+
TargetIndustry apijson.Field
437+
TLP apijson.Field
438+
UUID apijson.Field
439+
Insight apijson.Field
440+
ReleasabilityID apijson.Field
441+
raw string
442+
ExtraFields map[string]apijson.Field
443+
}
444+
445+
func (r *ThreatEventGetResponse) UnmarshalJSON(data []byte) (err error) {
446+
return apijson.UnmarshalRoot(data, r)
447+
}
448+
449+
func (r threatEventGetResponseJSON) RawJSON() string {
450+
return r.raw
451+
}
452+
367453
type ThreatEventNewParams struct {
368454
// Account ID.
369455
PathAccountID param.Field[string] `path:"account_id,required"`
@@ -566,3 +652,8 @@ type ThreatEventEditParamsRaw struct {
566652
func (r ThreatEventEditParamsRaw) MarshalJSON() (data []byte, err error) {
567653
return apijson.MarshalRoot(r)
568654
}
655+
656+
type ThreatEventGetParams struct {
657+
// Account ID.
658+
AccountID param.Field[string] `path:"account_id,required"`
659+
}

cloudforce_one/threatevent_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,33 @@ func TestThreatEventEditWithOptionalParams(t *testing.T) {
227227
t.Fatalf("err should be nil: %s", err.Error())
228228
}
229229
}
230+
231+
func TestThreatEventGet(t *testing.T) {
232+
t.Skip("TODO: HTTP 401 from prism")
233+
baseURL := "http://localhost:4010"
234+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
235+
baseURL = envURL
236+
}
237+
if !testutil.CheckTestServer(t, baseURL) {
238+
return
239+
}
240+
client := cloudflare.NewClient(
241+
option.WithBaseURL(baseURL),
242+
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
243+
option.WithAPIEmail("user@example.com"),
244+
)
245+
_, err := client.CloudforceOne.ThreatEvents.Get(
246+
context.TODO(),
247+
"event_id",
248+
cloudforce_one.ThreatEventGetParams{
249+
AccountID: cloudflare.F("account_id"),
250+
},
251+
)
252+
if err != nil {
253+
var apierr *cloudflare.Error
254+
if errors.As(err, &apierr) {
255+
t.Log(string(apierr.DumpRequest(true)))
256+
}
257+
t.Fatalf("err should be nil: %s", err.Error())
258+
}
259+
}

cloudforce_one/threateventindicatortype.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
package cloudforce_one
44

55
import (
6+
"context"
7+
"errors"
8+
"fmt"
9+
"net/http"
10+
"slices"
11+
12+
"github.com/cloudflare/cloudflare-go/v6/internal/apijson"
13+
"github.com/cloudflare/cloudflare-go/v6/internal/param"
14+
"github.com/cloudflare/cloudflare-go/v6/internal/requestconfig"
615
"github.com/cloudflare/cloudflare-go/v6/option"
716
)
817

@@ -24,3 +33,67 @@ func NewThreatEventIndicatorTypeService(opts ...option.RequestOption) (r *Threat
2433
r.Options = opts
2534
return
2635
}
36+
37+
// This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes
38+
// instead.
39+
//
40+
// Deprecated: deprecated
41+
func (r *ThreatEventIndicatorTypeService) List(ctx context.Context, query ThreatEventIndicatorTypeListParams, opts ...option.RequestOption) (res *ThreatEventIndicatorTypeListResponse, err error) {
42+
opts = slices.Concat(r.Options, opts)
43+
if query.AccountID.Value == "" {
44+
err = errors.New("missing required account_id parameter")
45+
return
46+
}
47+
path := fmt.Sprintf("accounts/%s/cloudforce-one/events/indicatorTypes", query.AccountID)
48+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
49+
return
50+
}
51+
52+
type ThreatEventIndicatorTypeListResponse struct {
53+
Items ThreatEventIndicatorTypeListResponseItems `json:"items,required"`
54+
Type string `json:"type,required"`
55+
JSON threatEventIndicatorTypeListResponseJSON `json:"-"`
56+
}
57+
58+
// threatEventIndicatorTypeListResponseJSON contains the JSON metadata for the
59+
// struct [ThreatEventIndicatorTypeListResponse]
60+
type threatEventIndicatorTypeListResponseJSON struct {
61+
Items apijson.Field
62+
Type apijson.Field
63+
raw string
64+
ExtraFields map[string]apijson.Field
65+
}
66+
67+
func (r *ThreatEventIndicatorTypeListResponse) UnmarshalJSON(data []byte) (err error) {
68+
return apijson.UnmarshalRoot(data, r)
69+
}
70+
71+
func (r threatEventIndicatorTypeListResponseJSON) RawJSON() string {
72+
return r.raw
73+
}
74+
75+
type ThreatEventIndicatorTypeListResponseItems struct {
76+
Type string `json:"type,required"`
77+
JSON threatEventIndicatorTypeListResponseItemsJSON `json:"-"`
78+
}
79+
80+
// threatEventIndicatorTypeListResponseItemsJSON contains the JSON metadata for the
81+
// struct [ThreatEventIndicatorTypeListResponseItems]
82+
type threatEventIndicatorTypeListResponseItemsJSON struct {
83+
Type apijson.Field
84+
raw string
85+
ExtraFields map[string]apijson.Field
86+
}
87+
88+
func (r *ThreatEventIndicatorTypeListResponseItems) UnmarshalJSON(data []byte) (err error) {
89+
return apijson.UnmarshalRoot(data, r)
90+
}
91+
92+
func (r threatEventIndicatorTypeListResponseItemsJSON) RawJSON() string {
93+
return r.raw
94+
}
95+
96+
type ThreatEventIndicatorTypeListParams struct {
97+
// Account ID.
98+
AccountID param.Field[string] `path:"account_id,required"`
99+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
package cloudforce_one_test
4+
5+
import (
6+
"context"
7+
"errors"
8+
"os"
9+
"testing"
10+
11+
"github.com/cloudflare/cloudflare-go/v6"
12+
"github.com/cloudflare/cloudflare-go/v6/cloudforce_one"
13+
"github.com/cloudflare/cloudflare-go/v6/internal/testutil"
14+
"github.com/cloudflare/cloudflare-go/v6/option"
15+
)
16+
17+
func TestThreatEventIndicatorTypeList(t *testing.T) {
18+
t.Skip("TODO: HTTP 401 from prism")
19+
baseURL := "http://localhost:4010"
20+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
21+
baseURL = envURL
22+
}
23+
if !testutil.CheckTestServer(t, baseURL) {
24+
return
25+
}
26+
client := cloudflare.NewClient(
27+
option.WithBaseURL(baseURL),
28+
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
29+
option.WithAPIEmail("user@example.com"),
30+
)
31+
_, err := client.CloudforceOne.ThreatEvents.IndicatorTypes.List(context.TODO(), cloudforce_one.ThreatEventIndicatorTypeListParams{
32+
AccountID: cloudflare.F("account_id"),
33+
})
34+
if err != nil {
35+
var apierr *cloudflare.Error
36+
if errors.As(err, &apierr) {
37+
t.Log(string(apierr.DumpRequest(true)))
38+
}
39+
t.Fatalf("err should be nil: %s", err.Error())
40+
}
41+
}

rulesets/rule.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6490,6 +6490,9 @@ type SetConfigRuleActionParameters struct {
64906490
// Whether to enable Hotlink Protection.
64916491
HotlinkProtection bool `json:"hotlink_protection"`
64926492
// Whether to enable Mirage.
6493+
//
6494+
// Deprecated: Mirage is deprecated. More information at
6495+
// https://developers.cloudflare.com/speed/optimization/images/mirage/.
64936496
Mirage bool `json:"mirage"`
64946497
// Whether to enable Opportunistic Encryption.
64956498
OpportunisticEncryption bool `json:"opportunistic_encryption"`
@@ -6821,6 +6824,9 @@ type SetConfigRuleActionParametersParam struct {
68216824
// Whether to enable Hotlink Protection.
68226825
HotlinkProtection param.Field[bool] `json:"hotlink_protection"`
68236826
// Whether to enable Mirage.
6827+
//
6828+
// Deprecated: Mirage is deprecated. More information at
6829+
// https://developers.cloudflare.com/speed/optimization/images/mirage/.
68246830
Mirage param.Field[bool] `json:"mirage"`
68256831
// Whether to enable Opportunistic Encryption.
68266832
OpportunisticEncryption param.Field[bool] `json:"opportunistic_encryption"`

scripts/detect-breaking-changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ TEST_PATHS=(
596596
cloudforce_one/threateventcategory_test.go
597597
cloudforce_one/threateventcountry_test.go
598598
cloudforce_one/threateventdataset_test.go
599+
cloudforce_one/threateventindicatortype_test.go
599600
cloudforce_one/threateventraw_test.go
600601
cloudforce_one/threateventrelate_test.go
601602
cloudforce_one/threateventtag_test.go

0 commit comments

Comments
 (0)