Skip to content

Commit 7382e8a

Browse files
committedMar 14, 2025
feat(api): api update (#4034)
1 parent 4e1031f commit 7382e8a

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1611
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7119751984d8966c461abbc0c7826bde723d66c14eaa3516d0f7061ad49e9505.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bde1b5a6daa5f9827ec7e0f04cfb6d85a2fb6678aef7a2073a00f8225673a142.yml

‎cloudforce_one/scanconfig.go

+39-18
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,19 @@ func (r *ScanConfigService) Edit(ctx context.Context, configID string, params Sc
122122
}
123123

124124
type ScanConfigNewResponse struct {
125-
ID string `json:"id,required"`
126-
AccountID string `json:"account_id,required"`
127-
Frequency float64 `json:"frequency,required"`
128-
IPs []string `json:"ips,required"`
129-
Ports []string `json:"ports,required"`
130-
JSON scanConfigNewResponseJSON `json:"-"`
125+
// Config ID
126+
ID string `json:"id,required"`
127+
AccountID string `json:"account_id,required"`
128+
// The number of days between each scan (0 = no recurring scans).
129+
Frequency float64 `json:"frequency,required"`
130+
// A list of IP addresses or CIDR blocks to scan. The maximum number of total IP
131+
// addresses allowed is 5000.
132+
IPs []string `json:"ips,required"`
133+
// A list of ports to scan. Allowed values:"default", "all", or a comma-separated
134+
// list of ports or range of ports (e.g. ["1-80", "443"]). Default will scan the
135+
// 100 most commonly open ports.
136+
Ports []string `json:"ports,required"`
137+
JSON scanConfigNewResponseJSON `json:"-"`
131138
}
132139

133140
// scanConfigNewResponseJSON contains the JSON metadata for the struct
@@ -151,12 +158,19 @@ func (r scanConfigNewResponseJSON) RawJSON() string {
151158
}
152159

153160
type ScanConfigListResponse struct {
154-
ID string `json:"id,required"`
155-
AccountID string `json:"account_id,required"`
156-
Frequency float64 `json:"frequency,required"`
157-
IPs []string `json:"ips,required"`
158-
Ports []string `json:"ports,required"`
159-
JSON scanConfigListResponseJSON `json:"-"`
161+
// Config ID
162+
ID string `json:"id,required"`
163+
AccountID string `json:"account_id,required"`
164+
// The number of days between each scan (0 = no recurring scans).
165+
Frequency float64 `json:"frequency,required"`
166+
// A list of IP addresses or CIDR blocks to scan. The maximum number of total IP
167+
// addresses allowed is 5000.
168+
IPs []string `json:"ips,required"`
169+
// A list of ports to scan. Allowed values:"default", "all", or a comma-separated
170+
// list of ports or range of ports (e.g. ["1-80", "443"]). Default will scan the
171+
// 100 most commonly open ports.
172+
Ports []string `json:"ports,required"`
173+
JSON scanConfigListResponseJSON `json:"-"`
160174
}
161175

162176
// scanConfigListResponseJSON contains the JSON metadata for the struct
@@ -182,12 +196,19 @@ func (r scanConfigListResponseJSON) RawJSON() string {
182196
type ScanConfigDeleteResponse = interface{}
183197

184198
type ScanConfigEditResponse struct {
185-
ID string `json:"id,required"`
186-
AccountID string `json:"account_id,required"`
187-
Frequency float64 `json:"frequency,required"`
188-
IPs []string `json:"ips,required"`
189-
Ports []string `json:"ports,required"`
190-
JSON scanConfigEditResponseJSON `json:"-"`
199+
// Config ID
200+
ID string `json:"id,required"`
201+
AccountID string `json:"account_id,required"`
202+
// The number of days between each scan (0 = no recurring scans).
203+
Frequency float64 `json:"frequency,required"`
204+
// A list of IP addresses or CIDR blocks to scan. The maximum number of total IP
205+
// addresses allowed is 5000.
206+
IPs []string `json:"ips,required"`
207+
// A list of ports to scan. Allowed values:"default", "all", or a comma-separated
208+
// list of ports or range of ports (e.g. ["1-80", "443"]). Default will scan the
209+
// 100 most commonly open ports.
210+
Ports []string `json:"ports,required"`
211+
JSON scanConfigEditResponseJSON `json:"-"`
191212
}
192213

193214
// scanConfigEditResponseJSON contains the JSON metadata for the struct

‎cloudforce_one/scanconfig_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestScanConfigNewWithOptionalParams(t *testing.T) {
2929
)
3030
_, err := client.CloudforceOne.Scans.Config.New(context.TODO(), cloudforce_one.ScanConfigNewParams{
3131
AccountID: cloudflare.F("account_id"),
32-
IPs: cloudflare.F([]string{"1.1.1.1"}),
32+
IPs: cloudflare.F([]string{"1.1.1.1", "2606:4700:4700::1111"}),
3333
Frequency: cloudflare.F(7.000000),
3434
Ports: cloudflare.F([]string{"default"}),
3535
})
@@ -115,7 +115,7 @@ func TestScanConfigEditWithOptionalParams(t *testing.T) {
115115
cloudforce_one.ScanConfigEditParams{
116116
AccountID: cloudflare.F("account_id"),
117117
Frequency: cloudflare.F(7.000000),
118-
IPs: cloudflare.F([]string{"1.1.1.1"}),
118+
IPs: cloudflare.F([]string{"1.1.1.1", "2606:4700:4700::1111"}),
119119
Ports: cloudflare.F([]string{"default"}),
120120
},
121121
)

0 commit comments

Comments
 (0)
Please sign in to comment.