Skip to content

Commit fc712b2

Browse files
chore(api): update composite API spec
1 parent b9575e3 commit fc712b2

File tree

6 files changed

+228
-47
lines changed

6 files changed

+228
-47
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: 2033
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa90536a3aa68340d37a3389461eed6b13c9f5561ca9ad8aa46d2ca4cbb1701.yml
3-
openapi_spec_hash: 95c0ec155c861dacf17154c43cba13f8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbaa54a8cdf9c7f13d7322e3cbe42364b41ff8d08b5d616bab9dcfd1fbda5dc6.yml
3+
openapi_spec_hash: 6a04699dd9c5ed4e5deb8e11b534968c
44
config_hash: 7a70007089f586cc7b1ebd1808030dd1

ai_search/instance.go

Lines changed: 180 additions & 27 deletions
Large diffs are not rendered by default.

ai_search/instance_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func TestInstanceNewWithOptionalParams(t *testing.T) {
4343
FieldName: cloudflare.F("x"),
4444
}}),
4545
EmbeddingModel: cloudflare.F(ai_search.InstanceNewParamsEmbeddingModelCfQwenQwen3Embedding0_6b),
46+
FusionMethod: cloudflare.F(ai_search.InstanceNewParamsFusionMethodMax),
4647
HybridSearchEnabled: cloudflare.F(true),
4748
MaxNumResults: cloudflare.F(int64(1)),
4849
Metadata: cloudflare.F(ai_search.InstanceNewParamsMetadata{
@@ -136,6 +137,7 @@ func TestInstanceUpdateWithOptionalParams(t *testing.T) {
136137
FieldName: cloudflare.F("x"),
137138
}}),
138139
EmbeddingModel: cloudflare.F(ai_search.InstanceUpdateParamsEmbeddingModelCfQwenQwen3Embedding0_6b),
140+
FusionMethod: cloudflare.F(ai_search.InstanceUpdateParamsFusionMethodMax),
139141
HybridSearchEnabled: cloudflare.F(true),
140142
MaxNumResults: cloudflare.F(int64(1)),
141143
Metadata: cloudflare.F(ai_search.InstanceUpdateParamsMetadata{
@@ -301,6 +303,7 @@ func TestInstanceChatCompletionsWithOptionalParams(t *testing.T) {
301303
Filters: cloudflare.F(map[string]interface{}{
302304
"foo": "bar",
303305
}),
306+
FusionMethod: cloudflare.F(ai_search.InstanceChatCompletionsParamsAISearchOptionsRetrievalFusionMethodMax),
304307
MatchThreshold: cloudflare.F(0.000000),
305308
MaxNumResults: cloudflare.F(int64(1)),
306309
RetrievalType: cloudflare.F(ai_search.InstanceChatCompletionsParamsAISearchOptionsRetrievalRetrievalTypeVector),
@@ -387,6 +390,7 @@ func TestInstanceSearchWithOptionalParams(t *testing.T) {
387390
Filters: cloudflare.F(map[string]interface{}{
388391
"foo": "bar",
389392
}),
393+
FusionMethod: cloudflare.F(ai_search.InstanceSearchParamsAISearchOptionsRetrievalFusionMethodMax),
390394
MatchThreshold: cloudflare.F(0.000000),
391395
MaxNumResults: cloudflare.F(int64(1)),
392396
RetrievalType: cloudflare.F(ai_search.InstanceSearchParamsAISearchOptionsRetrievalRetrievalTypeVector),

page_shield/policy.go

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,14 @@ func (r PolicyParam) MarshalJSON() (data []byte, err error) {
161161
type PolicyAction string
162162

163163
const (
164-
PolicyActionAllow PolicyAction = "allow"
165-
PolicyActionLog PolicyAction = "log"
164+
PolicyActionAllow PolicyAction = "allow"
165+
PolicyActionLog PolicyAction = "log"
166+
PolicyActionAddReportingDirectives PolicyAction = "add_reporting_directives"
166167
)
167168

168169
func (r PolicyAction) IsKnown() bool {
169170
switch r {
170-
case PolicyActionAllow, PolicyActionLog:
171+
case PolicyActionAllow, PolicyActionLog, PolicyActionAddReportingDirectives:
171172
return true
172173
}
173174
return false
@@ -215,13 +216,14 @@ func (r policyNewResponseJSON) RawJSON() string {
215216
type PolicyNewResponseAction string
216217

217218
const (
218-
PolicyNewResponseActionAllow PolicyNewResponseAction = "allow"
219-
PolicyNewResponseActionLog PolicyNewResponseAction = "log"
219+
PolicyNewResponseActionAllow PolicyNewResponseAction = "allow"
220+
PolicyNewResponseActionLog PolicyNewResponseAction = "log"
221+
PolicyNewResponseActionAddReportingDirectives PolicyNewResponseAction = "add_reporting_directives"
220222
)
221223

222224
func (r PolicyNewResponseAction) IsKnown() bool {
223225
switch r {
224-
case PolicyNewResponseActionAllow, PolicyNewResponseActionLog:
226+
case PolicyNewResponseActionAllow, PolicyNewResponseActionLog, PolicyNewResponseActionAddReportingDirectives:
225227
return true
226228
}
227229
return false
@@ -269,13 +271,14 @@ func (r policyUpdateResponseJSON) RawJSON() string {
269271
type PolicyUpdateResponseAction string
270272

271273
const (
272-
PolicyUpdateResponseActionAllow PolicyUpdateResponseAction = "allow"
273-
PolicyUpdateResponseActionLog PolicyUpdateResponseAction = "log"
274+
PolicyUpdateResponseActionAllow PolicyUpdateResponseAction = "allow"
275+
PolicyUpdateResponseActionLog PolicyUpdateResponseAction = "log"
276+
PolicyUpdateResponseActionAddReportingDirectives PolicyUpdateResponseAction = "add_reporting_directives"
274277
)
275278

276279
func (r PolicyUpdateResponseAction) IsKnown() bool {
277280
switch r {
278-
case PolicyUpdateResponseActionAllow, PolicyUpdateResponseActionLog:
281+
case PolicyUpdateResponseActionAllow, PolicyUpdateResponseActionLog, PolicyUpdateResponseActionAddReportingDirectives:
279282
return true
280283
}
281284
return false
@@ -323,13 +326,14 @@ func (r policyListResponseJSON) RawJSON() string {
323326
type PolicyListResponseAction string
324327

325328
const (
326-
PolicyListResponseActionAllow PolicyListResponseAction = "allow"
327-
PolicyListResponseActionLog PolicyListResponseAction = "log"
329+
PolicyListResponseActionAllow PolicyListResponseAction = "allow"
330+
PolicyListResponseActionLog PolicyListResponseAction = "log"
331+
PolicyListResponseActionAddReportingDirectives PolicyListResponseAction = "add_reporting_directives"
328332
)
329333

330334
func (r PolicyListResponseAction) IsKnown() bool {
331335
switch r {
332-
case PolicyListResponseActionAllow, PolicyListResponseActionLog:
336+
case PolicyListResponseActionAllow, PolicyListResponseActionLog, PolicyListResponseActionAddReportingDirectives:
333337
return true
334338
}
335339
return false
@@ -377,13 +381,14 @@ func (r policyGetResponseJSON) RawJSON() string {
377381
type PolicyGetResponseAction string
378382

379383
const (
380-
PolicyGetResponseActionAllow PolicyGetResponseAction = "allow"
381-
PolicyGetResponseActionLog PolicyGetResponseAction = "log"
384+
PolicyGetResponseActionAllow PolicyGetResponseAction = "allow"
385+
PolicyGetResponseActionLog PolicyGetResponseAction = "log"
386+
PolicyGetResponseActionAddReportingDirectives PolicyGetResponseAction = "add_reporting_directives"
382387
)
383388

384389
func (r PolicyGetResponseAction) IsKnown() bool {
385390
switch r {
386-
case PolicyGetResponseActionAllow, PolicyGetResponseActionLog:
391+
case PolicyGetResponseActionAllow, PolicyGetResponseActionLog, PolicyGetResponseActionAddReportingDirectives:
387392
return true
388393
}
389394
return false
@@ -466,13 +471,14 @@ func (r PolicyUpdateParams) MarshalJSON() (data []byte, err error) {
466471
type PolicyUpdateParamsAction string
467472

468473
const (
469-
PolicyUpdateParamsActionAllow PolicyUpdateParamsAction = "allow"
470-
PolicyUpdateParamsActionLog PolicyUpdateParamsAction = "log"
474+
PolicyUpdateParamsActionAllow PolicyUpdateParamsAction = "allow"
475+
PolicyUpdateParamsActionLog PolicyUpdateParamsAction = "log"
476+
PolicyUpdateParamsActionAddReportingDirectives PolicyUpdateParamsAction = "add_reporting_directives"
471477
)
472478

473479
func (r PolicyUpdateParamsAction) IsKnown() bool {
474480
switch r {
475-
case PolicyUpdateParamsActionAllow, PolicyUpdateParamsActionLog:
481+
case PolicyUpdateParamsActionAllow, PolicyUpdateParamsActionLog, PolicyUpdateParamsActionAddReportingDirectives:
476482
return true
477483
}
478484
return false

workers/script.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,8 @@ func (r ScriptUpdateParams) MarshalMultipart() (data []byte, contentType string,
16801680

16811681
// JSON-encoded metadata about the uploaded parts and Worker configuration.
16821682
type ScriptUpdateParamsMetadata struct {
1683+
// Annotations for the version created by this upload.
1684+
Annotations param.Field[ScriptUpdateParamsMetadataAnnotations] `json:"annotations"`
16831685
// Configuration for assets within a Worker.
16841686
Assets param.Field[ScriptUpdateParamsMetadataAssets] `json:"assets"`
16851687
// List of bindings attached to a Worker. You can find more about bindings on our
@@ -1728,6 +1730,18 @@ func (r ScriptUpdateParamsMetadata) MarshalJSON() (data []byte, err error) {
17281730
return apijson.MarshalRoot(r)
17291731
}
17301732

1733+
// Annotations for the version created by this upload.
1734+
type ScriptUpdateParamsMetadataAnnotations struct {
1735+
// Human-readable message about the version.
1736+
WorkersMessage param.Field[string] `json:"workers/message"`
1737+
// User-provided identifier for the version.
1738+
WorkersTag param.Field[string] `json:"workers/tag"`
1739+
}
1740+
1741+
func (r ScriptUpdateParamsMetadataAnnotations) MarshalJSON() (data []byte, err error) {
1742+
return apijson.MarshalRoot(r)
1743+
}
1744+
17311745
// Configuration for assets within a Worker.
17321746
type ScriptUpdateParamsMetadataAssets struct {
17331747
// Configuration for assets within a Worker.

workers/script_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func TestScriptUpdateWithOptionalParams(t *testing.T) {
3636
workers.ScriptUpdateParams{
3737
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3838
Metadata: cloudflare.F(workers.ScriptUpdateParamsMetadata{
39+
Annotations: cloudflare.F(workers.ScriptUpdateParamsMetadataAnnotations{
40+
WorkersMessage: cloudflare.F("Fixed bug."),
41+
WorkersTag: cloudflare.F("v1.0.1"),
42+
}),
3943
Assets: cloudflare.F(workers.ScriptUpdateParamsMetadataAssets{
4044
Config: cloudflare.F(workers.ScriptUpdateParamsMetadataAssetsConfig{
4145
Headers: cloudflare.F("/dashboard/*\nX-Frame-Options: DENY\n\n/static/*\nAccess-Control-Allow-Origin: *"),

0 commit comments

Comments
 (0)