Repository: cloudflare/cloudflare-go
Pull request #3087 (2024-09-11 20:44:26)

chore(api): Rename 'device_experience_monitor' model


Patch:
diff --git a/.stats.yml b/.stats.yml
index eab250bc4..af95ebe66 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 1331
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-87abe32cd6de1ae2b0749914226952c5101ebe9e1b6b7ae24d01a8c84185451e.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b66f9c716c52e338c34307ec2b389fc96aaac82ce7ad739bbca3a664a2455ad0.yml
diff --git a/api.md b/api.md
index 449f286e1..c205ec77a 100644
--- a/api.md
+++ b/api.md
@@ -4957,7 +4957,7 @@ Methods:
 
 Response Types:
 
-- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#DeviceExperienceMonitor">DeviceExperienceMonitor</a>
+- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#DigitalExperienceMonitor">DigitalExperienceMonitor</a>
 - <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#NetworkPath">NetworkPath</a>
 - <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#NetworkPathResponse">NetworkPathResponse</a>
 - <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#Percentiles">Percentiles</a>
diff --git a/zero_trust/dex.go b/zero_trust/dex.go
index f0196aa75..bb54f7d0a 100644
--- a/zero_trust/dex.go
+++ b/zero_trust/dex.go
@@ -38,17 +38,17 @@ func NewDEXService(opts ...option.RequestOption) (r *DEXService) {
 	return
 }
 
-type DeviceExperienceMonitor struct {
+type DigitalExperienceMonitor struct {
 	ID string `json:"id,required"`
 	// Whether the policy is the default for the account
-	Default bool                        `json:"default,required"`
-	Name    string                      `json:"name,required"`
-	JSON    deviceExperienceMonitorJSON `json:"-"`
+	Default bool                         `json:"default,required"`
+	Name    string                       `json:"name,required"`
+	JSON    digitalExperienceMonitorJSON `json:"-"`
 }
 
-// deviceExperienceMonitorJSON contains the JSON metadata for the struct
-// [DeviceExperienceMonitor]
-type deviceExperienceMonitorJSON struct {
+// digitalExperienceMonitorJSON contains the JSON metadata for the struct
+// [DigitalExperienceMonitor]
+type digitalExperienceMonitorJSON struct {
 	ID          apijson.Field
 	Default     apijson.Field
 	Name        apijson.Field
@@ -56,11 +56,11 @@ type deviceExperienceMonitorJSON struct {
 	ExtraFields map[string]apijson.Field
 }
 
-func (r *DeviceExperienceMonitor) UnmarshalJSON(data []byte) (err error) {
+func (r *DigitalExperienceMonitor) UnmarshalJSON(data []byte) (err error) {
 	return apijson.UnmarshalRoot(data, r)
 }
 
-func (r deviceExperienceMonitorJSON) RawJSON() string {
+func (r digitalExperienceMonitorJSON) RawJSON() string {
 	return r.raw
 }
 


Test patch:
diff --git a/zero_trust/dexhttptest.go b/zero_trust/dexhttptest.go
index 1a3a6322d..af51317dd 100644
--- a/zero_trust/dexhttptest.go
+++ b/zero_trust/dexhttptest.go
@@ -71,10 +71,10 @@ type HTTPDetails struct {
 	// The HTTP method to use when running the test
 	Method string `json:"method"`
 	// The name of the HTTP synthetic application test
-	Name           string                    `json:"name"`
-	TargetPolicies []DeviceExperienceMonitor `json:"target_policies,nullable"`
-	Targeted       bool                      `json:"targeted"`
-	JSON           httpDetailsJSON           `json:"-"`
+	Name           string                     `json:"name"`
+	TargetPolicies []DigitalExperienceMonitor `json:"target_policies,nullable"`
+	Targeted       bool                       `json:"targeted"`
+	JSON           httpDetailsJSON            `json:"-"`
 }
 
 // httpDetailsJSON contains the JSON metadata for the struct [HTTPDetails]
diff --git a/zero_trust/dextest.go b/zero_trust/dextest.go
index ff07fb4da..3e3faec89 100644
--- a/zero_trust/dextest.go
+++ b/zero_trust/dextest.go
@@ -178,7 +178,7 @@ type TestsTest struct {
 	HTTPResultsByColo []TestsTestsHTTPResultsByColo `json:"httpResultsByColo"`
 	// for HTTP, the method to use when running the test
 	Method                  string                              `json:"method"`
-	TargetPolicies          []DeviceExperienceMonitor           `json:"target_policies,nullable"`
+	TargetPolicies          []DigitalExperienceMonitor          `json:"target_policies,nullable"`
 	Targeted                bool                                `json:"targeted"`
 	TracerouteResults       TestsTestsTracerouteResults         `json:"tracerouteResults,nullable"`
 	TracerouteResultsByColo []TestsTestsTracerouteResultsByColo `json:"tracerouteResultsByColo"`
diff --git a/zero_trust/dextraceroutetest.go b/zero_trust/dextraceroutetest.go
index e36e15c24..f560324e3 100644
--- a/zero_trust/dextraceroutetest.go
+++ b/zero_trust/dextraceroutetest.go
@@ -109,7 +109,7 @@ type Traceroute struct {
 	Kind     TracerouteKind `json:"kind,required"`
 	// The name of the Traceroute synthetic application test
 	Name                  string                            `json:"name,required"`
-	TargetPolicies        []DeviceExperienceMonitor         `json:"target_policies,nullable"`
+	TargetPolicies        []DigitalExperienceMonitor        `json:"target_policies,nullable"`
 	Targeted              bool                              `json:"targeted"`
 	TracerouteStats       TracerouteTracerouteStats         `json:"tracerouteStats,nullable"`
 	TracerouteStatsByColo []TracerouteTracerouteStatsByColo `json:"tracerouteStatsByColo"`