@@ -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.
276464type 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.
374652type WorkerSubdomainParam struct {
375653 // Whether the \*.workers.dev subdomain is enabled for the Worker.
0 commit comments