@@ -10,23 +10,23 @@ import (
1010 "github.com/rootlyhq/rootly-go"
1111)
1212
13- // Convert a map to a APIObject
14- func convertObject (maps []map [string ]string ) []struct {
15- Key string " json:\ " key\" "
16- Value string " json:\ " value\" "
17- } {
18- objects := [] struct {
13+ // Convert a map to nullable API objects
14+ func convertObject (maps []map [string ]string ) []nullable. Nullable [ struct {
15+ Key string ` json:"key"`
16+ Value string ` json:"value"`
17+ }] {
18+ var objects []nullable. Nullable [ struct {
1919 Key string `json:"key"`
2020 Value string `json:"value"`
21- }{}
21+ }]
2222 for _ , mapData := range maps {
23- objects = append (objects , struct {
23+ objects = append (objects , nullable . NewNullableWithValue ( struct {
2424 Key string `json:"key"`
2525 Value string `json:"value"`
2626 }{
2727 Key : mapData ["key" ],
2828 Value : mapData ["value" ],
29- })
29+ }))
3030 }
3131 return objects
3232}
@@ -47,18 +47,18 @@ func convertPulse(pulse models.Pulse) (string, log.CtxErr) {
4747 data .Data .Attributes .StartedAt = nullable.NewNullableWithValue [time.Time ](pulse .StartedAt )
4848 }
4949 if len (pulse .ServiceIds ) != 0 {
50- data .Data .Attributes .ServiceIds = nullable .NewNullableWithValue (pulse .ServiceIds )
50+ data .Data .Attributes .ServiceIDs = nullable .NewNullableWithValue (pulse .ServiceIds )
5151 }
5252 if len (pulse .EnvironmentIds ) != 0 {
53- data .Data .Attributes .EnvironmentIds = nullable .NewNullableWithValue (pulse .EnvironmentIds )
53+ data .Data .Attributes .EnvironmentIDs = nullable .NewNullableWithValue (pulse .EnvironmentIds )
5454 }
5555 labels := convertObject (pulse .Labels )
5656 if len (labels ) != 0 {
57- data .Data .Attributes .Labels = & labels
57+ data .Data .Attributes .Labels = labels
5858 }
5959 refs := convertObject (pulse .Refs )
6060 if len (refs ) != 0 {
61- data .Data .Attributes .Refs = & refs
61+ data .Data .Attributes .Refs = refs
6262 }
6363
6464 // Marshaling the data
0 commit comments