Skip to content

Commit 5fc3d87

Browse files
chore(api): update composite API spec
1 parent 9d45c6d commit 5fc3d87

File tree

9 files changed

+308
-30
lines changed

9 files changed

+308
-30
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: 1837
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-018fa28df9d660403fe5e2114dfd2ad4ce4a5f33834c7735c14061e4886c55b2.yml
3-
openapi_spec_hash: 788fc8f4283e7484ee3e24e01c1414bf
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da898c50e812b8d004199a66cbadb1ce43450928a6700f9fa0d7ae26d61df08b.yml
3+
openapi_spec_hash: bd9a337e74a90fd0e886dbea5631766e
44
config_hash: 107e0f1f8a98b007260b319226b88b3c

workers/betaworker.go

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ type Worker struct {
178178
Name string `json:"name,required"`
179179
// Observability settings for the Worker.
180180
Observability WorkerObservability `json:"observability,required"`
181+
// Other resources that reference the Worker and depend on it existing.
182+
References WorkerReferences `json:"references,required"`
181183
// Subdomain settings for the Worker.
182184
Subdomain WorkerSubdomain `json:"subdomain,required"`
183185
// Tags associated with the Worker.
@@ -196,6 +198,7 @@ type workerJSON struct {
196198
Logpush apijson.Field
197199
Name apijson.Field
198200
Observability apijson.Field
201+
References apijson.Field
199202
Subdomain apijson.Field
200203
Tags apijson.Field
201204
TailConsumers apijson.Field
@@ -272,6 +275,191 @@ func (r workerObservabilityLogsJSON) RawJSON() string {
272275
return r.raw
273276
}
274277

278+
// Other resources that reference the Worker and depend on it existing.
279+
type WorkerReferences struct {
280+
// Other Workers that reference the Worker as an outbound for a dispatch namespace.
281+
DispatchNamespaceOutbounds []WorkerReferencesDispatchNamespaceOutbound `json:"dispatch_namespace_outbounds,required"`
282+
// Custom domains connected to the Worker.
283+
Domains []WorkerReferencesDomain `json:"domains,required"`
284+
// Other Workers that reference Durable Object classes implemented by the Worker.
285+
DurableObjects []WorkerReferencesDurableObject `json:"durable_objects,required"`
286+
// Queues that send messages to the Worker.
287+
Queues []WorkerReferencesQueue `json:"queues,required"`
288+
// Other Workers that reference the Worker using
289+
// [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/).
290+
Workers []WorkerReferencesWorker `json:"workers,required"`
291+
JSON workerReferencesJSON `json:"-"`
292+
}
293+
294+
// workerReferencesJSON contains the JSON metadata for the struct
295+
// [WorkerReferences]
296+
type workerReferencesJSON struct {
297+
DispatchNamespaceOutbounds apijson.Field
298+
Domains apijson.Field
299+
DurableObjects apijson.Field
300+
Queues apijson.Field
301+
Workers apijson.Field
302+
raw string
303+
ExtraFields map[string]apijson.Field
304+
}
305+
306+
func (r *WorkerReferences) UnmarshalJSON(data []byte) (err error) {
307+
return apijson.UnmarshalRoot(data, r)
308+
}
309+
310+
func (r workerReferencesJSON) RawJSON() string {
311+
return r.raw
312+
}
313+
314+
type WorkerReferencesDispatchNamespaceOutbound struct {
315+
// ID of the dispatch namespace.
316+
NamespaceID string `json:"namespace_id,required"`
317+
// Name of the dispatch namespace.
318+
NamespaceName string `json:"namespace_name,required"`
319+
// ID of the Worker using the dispatch namespace.
320+
WorkerID string `json:"worker_id,required"`
321+
// Name of the Worker using the dispatch namespace.
322+
WorkerName string `json:"worker_name,required"`
323+
JSON workerReferencesDispatchNamespaceOutboundJSON `json:"-"`
324+
}
325+
326+
// workerReferencesDispatchNamespaceOutboundJSON contains the JSON metadata for the
327+
// struct [WorkerReferencesDispatchNamespaceOutbound]
328+
type workerReferencesDispatchNamespaceOutboundJSON struct {
329+
NamespaceID apijson.Field
330+
NamespaceName apijson.Field
331+
WorkerID apijson.Field
332+
WorkerName apijson.Field
333+
raw string
334+
ExtraFields map[string]apijson.Field
335+
}
336+
337+
func (r *WorkerReferencesDispatchNamespaceOutbound) UnmarshalJSON(data []byte) (err error) {
338+
return apijson.UnmarshalRoot(data, r)
339+
}
340+
341+
func (r workerReferencesDispatchNamespaceOutboundJSON) RawJSON() string {
342+
return r.raw
343+
}
344+
345+
type WorkerReferencesDomain struct {
346+
// ID of the custom domain.
347+
ID string `json:"id,required"`
348+
// ID of the TLS certificate issued for the custom domain.
349+
CertificateID string `json:"certificate_id,required"`
350+
// Full hostname of the custom domain, including the zone name.
351+
Hostname string `json:"hostname,required"`
352+
// ID of the zone.
353+
ZoneID string `json:"zone_id,required"`
354+
// Name of the zone.
355+
ZoneName string `json:"zone_name,required"`
356+
JSON workerReferencesDomainJSON `json:"-"`
357+
}
358+
359+
// workerReferencesDomainJSON contains the JSON metadata for the struct
360+
// [WorkerReferencesDomain]
361+
type workerReferencesDomainJSON struct {
362+
ID apijson.Field
363+
CertificateID apijson.Field
364+
Hostname apijson.Field
365+
ZoneID apijson.Field
366+
ZoneName apijson.Field
367+
raw string
368+
ExtraFields map[string]apijson.Field
369+
}
370+
371+
func (r *WorkerReferencesDomain) UnmarshalJSON(data []byte) (err error) {
372+
return apijson.UnmarshalRoot(data, r)
373+
}
374+
375+
func (r workerReferencesDomainJSON) RawJSON() string {
376+
return r.raw
377+
}
378+
379+
type WorkerReferencesDurableObject struct {
380+
// ID of the Durable Object namespace being used.
381+
NamespaceID string `json:"namespace_id,required"`
382+
// Name of the Durable Object namespace being used.
383+
NamespaceName string `json:"namespace_name,required"`
384+
// ID of the Worker using the Durable Object implementation.
385+
WorkerID string `json:"worker_id,required"`
386+
// Name of the Worker using the Durable Object implementation.
387+
WorkerName string `json:"worker_name,required"`
388+
JSON workerReferencesDurableObjectJSON `json:"-"`
389+
}
390+
391+
// workerReferencesDurableObjectJSON contains the JSON metadata for the struct
392+
// [WorkerReferencesDurableObject]
393+
type workerReferencesDurableObjectJSON struct {
394+
NamespaceID apijson.Field
395+
NamespaceName apijson.Field
396+
WorkerID apijson.Field
397+
WorkerName apijson.Field
398+
raw string
399+
ExtraFields map[string]apijson.Field
400+
}
401+
402+
func (r *WorkerReferencesDurableObject) UnmarshalJSON(data []byte) (err error) {
403+
return apijson.UnmarshalRoot(data, r)
404+
}
405+
406+
func (r workerReferencesDurableObjectJSON) RawJSON() string {
407+
return r.raw
408+
}
409+
410+
type WorkerReferencesQueue struct {
411+
// ID of the queue consumer configuration.
412+
QueueConsumerID string `json:"queue_consumer_id,required"`
413+
// ID of the queue.
414+
QueueID string `json:"queue_id,required"`
415+
// Name of the queue.
416+
QueueName string `json:"queue_name,required"`
417+
JSON workerReferencesQueueJSON `json:"-"`
418+
}
419+
420+
// workerReferencesQueueJSON contains the JSON metadata for the struct
421+
// [WorkerReferencesQueue]
422+
type workerReferencesQueueJSON struct {
423+
QueueConsumerID apijson.Field
424+
QueueID apijson.Field
425+
QueueName apijson.Field
426+
raw string
427+
ExtraFields map[string]apijson.Field
428+
}
429+
430+
func (r *WorkerReferencesQueue) UnmarshalJSON(data []byte) (err error) {
431+
return apijson.UnmarshalRoot(data, r)
432+
}
433+
434+
func (r workerReferencesQueueJSON) RawJSON() string {
435+
return r.raw
436+
}
437+
438+
type WorkerReferencesWorker struct {
439+
// ID of the referencing Worker.
440+
ID string `json:"id,required"`
441+
// Name of the referencing Worker.
442+
Name string `json:"name,required"`
443+
JSON workerReferencesWorkerJSON `json:"-"`
444+
}
445+
446+
// workerReferencesWorkerJSON contains the JSON metadata for the struct
447+
// [WorkerReferencesWorker]
448+
type workerReferencesWorkerJSON struct {
449+
ID apijson.Field
450+
Name apijson.Field
451+
raw string
452+
ExtraFields map[string]apijson.Field
453+
}
454+
455+
func (r *WorkerReferencesWorker) UnmarshalJSON(data []byte) (err error) {
456+
return apijson.UnmarshalRoot(data, r)
457+
}
458+
459+
func (r workerReferencesWorkerJSON) RawJSON() string {
460+
return r.raw
461+
}
462+
275463
// Subdomain settings for the Worker.
276464
type WorkerSubdomain struct {
277465
// Whether the \*.workers.dev subdomain is enabled for the Worker.
@@ -370,6 +558,96 @@ func (r WorkerObservabilityLogsParam) MarshalJSON() (data []byte, err error) {
370558
return apijson.MarshalRoot(r)
371559
}
372560

561+
// Other resources that reference the Worker and depend on it existing.
562+
type WorkerReferencesParam struct {
563+
// Other Workers that reference the Worker as an outbound for a dispatch namespace.
564+
DispatchNamespaceOutbounds param.Field[[]WorkerReferencesDispatchNamespaceOutboundParam] `json:"dispatch_namespace_outbounds,required"`
565+
// Custom domains connected to the Worker.
566+
Domains param.Field[[]WorkerReferencesDomainParam] `json:"domains,required"`
567+
// Other Workers that reference Durable Object classes implemented by the Worker.
568+
DurableObjects param.Field[[]WorkerReferencesDurableObjectParam] `json:"durable_objects,required"`
569+
// Queues that send messages to the Worker.
570+
Queues param.Field[[]WorkerReferencesQueueParam] `json:"queues,required"`
571+
// Other Workers that reference the Worker using
572+
// [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/).
573+
Workers param.Field[[]WorkerReferencesWorkerParam] `json:"workers,required"`
574+
}
575+
576+
func (r WorkerReferencesParam) MarshalJSON() (data []byte, err error) {
577+
return apijson.MarshalRoot(r)
578+
}
579+
580+
type WorkerReferencesDispatchNamespaceOutboundParam struct {
581+
// ID of the dispatch namespace.
582+
NamespaceID param.Field[string] `json:"namespace_id,required"`
583+
// Name of the dispatch namespace.
584+
NamespaceName param.Field[string] `json:"namespace_name,required"`
585+
// ID of the Worker using the dispatch namespace.
586+
WorkerID param.Field[string] `json:"worker_id,required"`
587+
// Name of the Worker using the dispatch namespace.
588+
WorkerName param.Field[string] `json:"worker_name,required"`
589+
}
590+
591+
func (r WorkerReferencesDispatchNamespaceOutboundParam) MarshalJSON() (data []byte, err error) {
592+
return apijson.MarshalRoot(r)
593+
}
594+
595+
type WorkerReferencesDomainParam struct {
596+
// ID of the custom domain.
597+
ID param.Field[string] `json:"id,required"`
598+
// ID of the TLS certificate issued for the custom domain.
599+
CertificateID param.Field[string] `json:"certificate_id,required"`
600+
// Full hostname of the custom domain, including the zone name.
601+
Hostname param.Field[string] `json:"hostname,required"`
602+
// ID of the zone.
603+
ZoneID param.Field[string] `json:"zone_id,required"`
604+
// Name of the zone.
605+
ZoneName param.Field[string] `json:"zone_name,required"`
606+
}
607+
608+
func (r WorkerReferencesDomainParam) MarshalJSON() (data []byte, err error) {
609+
return apijson.MarshalRoot(r)
610+
}
611+
612+
type WorkerReferencesDurableObjectParam struct {
613+
// ID of the Durable Object namespace being used.
614+
NamespaceID param.Field[string] `json:"namespace_id,required"`
615+
// Name of the Durable Object namespace being used.
616+
NamespaceName param.Field[string] `json:"namespace_name,required"`
617+
// ID of the Worker using the Durable Object implementation.
618+
WorkerID param.Field[string] `json:"worker_id,required"`
619+
// Name of the Worker using the Durable Object implementation.
620+
WorkerName param.Field[string] `json:"worker_name,required"`
621+
}
622+
623+
func (r WorkerReferencesDurableObjectParam) MarshalJSON() (data []byte, err error) {
624+
return apijson.MarshalRoot(r)
625+
}
626+
627+
type WorkerReferencesQueueParam struct {
628+
// ID of the queue consumer configuration.
629+
QueueConsumerID param.Field[string] `json:"queue_consumer_id,required"`
630+
// ID of the queue.
631+
QueueID param.Field[string] `json:"queue_id,required"`
632+
// Name of the queue.
633+
QueueName param.Field[string] `json:"queue_name,required"`
634+
}
635+
636+
func (r WorkerReferencesQueueParam) MarshalJSON() (data []byte, err error) {
637+
return apijson.MarshalRoot(r)
638+
}
639+
640+
type WorkerReferencesWorkerParam struct {
641+
// ID of the referencing Worker.
642+
ID param.Field[string] `json:"id,required"`
643+
// Name of the referencing Worker.
644+
Name param.Field[string] `json:"name,required"`
645+
}
646+
647+
func (r WorkerReferencesWorkerParam) MarshalJSON() (data []byte, err error) {
648+
return apijson.MarshalRoot(r)
649+
}
650+
373651
// Subdomain settings for the Worker.
374652
type WorkerSubdomainParam struct {
375653
// Whether the \*.workers.dev subdomain is enabled for the Worker.

workers/betaworkerversion.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ type VersionBinding struct {
427427
Jurisdiction VersionBindingsJurisdiction `json:"jurisdiction"`
428428
// This field can have the runtime type of [interface{}].
429429
KeyJwk interface{} `json:"key_jwk"`
430-
// Namespace to bind to.
430+
// The name of the dispatch namespace.
431431
Namespace string `json:"namespace"`
432432
// Namespace identifier tag.
433433
NamespaceID string `json:"namespace_id"`
@@ -1010,7 +1010,7 @@ func (r VersionBindingsWorkersBindingKindDataBlobType) IsKnown() bool {
10101010
type VersionBindingsWorkersBindingKindDispatchNamespace struct {
10111011
// A JavaScript variable name for the binding.
10121012
Name string `json:"name,required"`
1013-
// Namespace to bind to.
1013+
// The name of the dispatch namespace.
10141014
Namespace string `json:"namespace,required"`
10151015
// The kind of resource that the binding provides.
10161016
Type VersionBindingsWorkersBindingKindDispatchNamespaceType `json:"type,required"`
@@ -2644,7 +2644,7 @@ type VersionBindingParam struct {
26442644
// Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".
26452645
KeyBase64 param.Field[string] `json:"key_base64"`
26462646
KeyJwk param.Field[interface{}] `json:"key_jwk"`
2647-
// Namespace to bind to.
2647+
// The name of the dispatch namespace.
26482648
Namespace param.Field[string] `json:"namespace"`
26492649
// Namespace identifier tag.
26502650
NamespaceID param.Field[string] `json:"namespace_id"`
@@ -2813,7 +2813,7 @@ func (r VersionBindingsWorkersBindingKindDataBlobParam) implementsVersionBinding
28132813
type VersionBindingsWorkersBindingKindDispatchNamespaceParam struct {
28142814
// A JavaScript variable name for the binding.
28152815
Name param.Field[string] `json:"name,required"`
2816-
// Namespace to bind to.
2816+
// The name of the dispatch namespace.
28172817
Namespace param.Field[string] `json:"namespace,required"`
28182818
// The kind of resource that the binding provides.
28192819
Type param.Field[VersionBindingsWorkersBindingKindDispatchNamespaceType] `json:"type,required"`

workers/script.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ type ScriptUpdateParamsMetadataBinding struct {
950950
// Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".
951951
KeyBase64 param.Field[string] `json:"key_base64"`
952952
KeyJwk param.Field[interface{}] `json:"key_jwk"`
953-
// Namespace to bind to.
953+
// The name of the dispatch namespace.
954954
Namespace param.Field[string] `json:"namespace"`
955955
// Namespace identifier tag.
956956
NamespaceID param.Field[string] `json:"namespace_id"`
@@ -1214,7 +1214,7 @@ func (r ScriptUpdateParamsMetadataBindingsWorkersBindingKindDataBlobType) IsKnow
12141214
type ScriptUpdateParamsMetadataBindingsWorkersBindingKindDispatchNamespace struct {
12151215
// A JavaScript variable name for the binding.
12161216
Name param.Field[string] `json:"name,required"`
1217-
// Namespace to bind to.
1217+
// The name of the dispatch namespace.
12181218
Namespace param.Field[string] `json:"namespace,required"`
12191219
// The kind of resource that the binding provides.
12201220
Type param.Field[ScriptUpdateParamsMetadataBindingsWorkersBindingKindDispatchNamespaceType] `json:"type,required"`

0 commit comments

Comments
 (0)