Skip to content

Commit d19fe3b

Browse files
committed
fix: remove omitempty from Locations and PrivateLocations
When omitempty, the property is not sent to the server. Our PUT endpoints however act like PATCH would, meaning that partial updates are supported. When a property is not set, it is kept intact, even though the intention most likely was to remove it.
1 parent dac9fad commit d19fe3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ type Check struct {
474474
Muted bool `json:"muted"`
475475
ShouldFail bool `json:"shouldFail"`
476476
RunParallel bool `json:"runParallel"`
477-
Locations []string `json:"locations,omitempty"`
477+
Locations []string `json:"locations"`
478478
DegradedResponseTime int `json:"degradedResponseTime"`
479479
MaxResponseTime int `json:"maxResponseTime"`
480480
Script string `json:"script,omitempty"`
@@ -517,7 +517,7 @@ type MultiStepCheck struct {
517517
Muted bool `json:"muted"`
518518
ShouldFail bool `json:"shouldFail"`
519519
RunParallel bool `json:"runParallel"`
520-
Locations []string `json:"locations,omitempty"`
520+
Locations []string `json:"locations"`
521521
Script string `json:"script,omitempty"`
522522
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"`
523523
Tags []string `json:"tags,omitempty"`
@@ -559,7 +559,7 @@ type TCPCheck struct {
559559
Muted bool `json:"muted"`
560560
ShouldFail bool `json:"shouldFail"`
561561
RunParallel bool `json:"runParallel"`
562-
Locations []string `json:"locations,omitempty"`
562+
Locations []string `json:"locations"`
563563
DegradedResponseTime int `json:"degradedResponseTime,omitempty"`
564564
MaxResponseTime int `json:"maxResponseTime,omitempty"`
565565
Tags []string `json:"tags,omitempty"`
@@ -569,7 +569,7 @@ type TCPCheck struct {
569569
GroupID int64 `json:"groupId,omitempty"`
570570
GroupOrder int `json:"groupOrder,omitempty"`
571571
AlertChannelSubscriptions []AlertChannelSubscription `json:"alertChannelSubscriptions,omitempty"`
572-
PrivateLocations *[]string `json:"privateLocations,omitempty"`
572+
PrivateLocations *[]string `json:"privateLocations"`
573573
RuntimeID *string `json:"runtimeId"`
574574
RetryStrategy *RetryStrategy `json:"retryStrategy,omitempty"`
575575
CreatedAt time.Time `json:"created_at,omitempty"`

0 commit comments

Comments
 (0)