Skip to content

Commit 179144c

Browse files
author
Dominik Rosiek
committed
Add support for content type
1 parent 6b86b37 commit 179144c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sumologic/sumologic_sources.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Source struct {
2929
CutoffRelativeTime string `json:"cutoffRelativeTime,omitempty"`
3030
Fields map[string]interface{} `json:"fields,omitempty"`
3131
Url string `json:"url,omitempty"`
32+
ContentType string `json:"contentType,omitempty"`
3233
}
3334

3435
type DefaultDateFormat struct {
@@ -193,6 +194,11 @@ func resourceSumologicSource() *schema.Resource {
193194
ForceNew: false,
194195
Default: true,
195196
},
197+
"content_type": {
198+
Type: schema.TypeString,
199+
Optional: true,
200+
Default: nil,
201+
},
196202
},
197203
}
198204
}
@@ -262,6 +268,7 @@ func resourceToSource(d *schema.ResourceData) Source {
262268
source.CutoffTimestamp = d.Get("cutoff_timestamp").(int)
263269
source.CutoffRelativeTime = d.Get("cutoff_relative_time").(string)
264270
source.Fields = d.Get("fields").(map[string]interface{})
271+
source.ContentType = d.Get("content_type").(string)
265272

266273
return source
267274
}
@@ -288,6 +295,7 @@ func resourceSumologicSourceRead(d *schema.ResourceData, source Source) error {
288295
if err := d.Set("fields", source.Fields); err != nil {
289296
return fmt.Errorf("error setting fields for resource %s: %s", d.Id(), err)
290297
}
298+
d.Set("content_type", source.ContentType)
291299
return nil
292300
}
293301

0 commit comments

Comments
 (0)