Skip to content

Commit 94471a3

Browse files
committed
SUMO-207948, removed string pointer and used omit empty solving the null problem
1 parent 6d36288 commit 94471a3

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

sumologic/resource_sumologic_connection.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ func resourceToConnection(d *schema.ResourceData) Connection {
213213
connection.Headers = mapToHeaders(d.Get("headers").(map[string]interface{}))
214214
connection.CustomHeaders = mapToHeaders(d.Get("custom_headers").(map[string]interface{}))
215215
connection.DefaultPayload = d.Get("default_payload").(string)
216-
if d.Get("resolution_payload").(string) != "" {
217-
v := d.Get("resolution_payload").(string)
218-
connection.ResolutionPayload = &v
219-
}
216+
connection.ResolutionPayload = d.Get("resolution_payload").(string)
220217
connection.WebhookType = d.Get("webhook_type").(string)
221218
connection.ConnectionSubtype = d.Get("connection_subtype").(string)
222219

@@ -250,9 +247,7 @@ func printConnection(connection Connection) {
250247
log.Printf("Headers: %s", connection.Headers)
251248
log.Printf("CustomHeaders: %s", connection.CustomHeaders)
252249
log.Printf("DefaultPayload: %s", connection.DefaultPayload)
253-
if connection.ResolutionPayload != nil {
254-
log.Printf("ResolutionPayload: %s", *connection.ResolutionPayload)
255-
}
250+
log.Printf("ResolutionPayload: %s", connection.ResolutionPayload)
256251
log.Printf("WebhookType: %s", connection.WebhookType)
257252
log.Printf("ConnectionSubtype: %s", connection.ConnectionSubtype)
258253
}

sumologic/sumologic_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ type Connection struct {
447447
DefaultPayload string `json:"defaultPayload"`
448448
WebhookType string `json:"webhookType"`
449449
ConnectionSubtype string `json:"connectionSubtype,omitempty"`
450-
ResolutionPayload *string `json:"resolutionPayload"`
450+
ResolutionPayload string `json:"resolutionPayload,omitempty"`
451451
}
452452

453453
// Headers is used to describe headers for http requests.

0 commit comments

Comments
 (0)