@@ -102,81 +102,41 @@ type DestinationMetadataState struct {
102102}
103103
104104func (d * DestinationMetadataState ) getPartnerOwned (owned * bool ) types.Bool {
105- var partnerOwned types.Bool
106-
107- if owned != nil {
108- partnerOwned = types .BoolValue (* owned )
109- }
105+ partnerOwned := types .BoolPointerValue (owned )
110106
111107 return partnerOwned
112108}
113109
114110func (d * DestinationMetadataState ) getSupportedPlatforms (platforms api.SupportedPlatforms ) * SupportedPlatform {
115111 var supportedPlatform SupportedPlatform
116112
117- if platforms .Browser != nil {
118- supportedPlatform .Browser = types .BoolValue (* platforms .Browser )
119- }
120-
121- if platforms .Server != nil {
122- supportedPlatform .Server = types .BoolValue (* platforms .Server )
123- }
124-
125- if platforms .Mobile != nil {
126- supportedPlatform .Mobile = types .BoolValue (* platforms .Mobile )
127- }
113+ supportedPlatform .Browser = types .BoolPointerValue (platforms .Browser )
114+ supportedPlatform .Server = types .BoolPointerValue (platforms .Server )
115+ supportedPlatform .Mobile = types .BoolPointerValue (platforms .Mobile )
128116
129117 return & supportedPlatform
130118}
131119
132120func (d * DestinationMetadataState ) getSupportedFeatures (features api.SupportedFeatures ) * SupportedFeature {
133121 var supportedFeature SupportedFeature
134122
135- if features .CloudModeInstances != nil {
136- supportedFeature .CloudModeInstances = types .StringValue (* features .CloudModeInstances )
137- }
138-
139- if features .DeviceModeInstances != nil {
140- supportedFeature .DeviceModeInstances = types .StringValue (* features .DeviceModeInstances )
141- }
142-
143- if features .Replay != nil {
144- supportedFeature .Replay = types .BoolValue (* features .Replay )
145- }
146-
147- if features .BrowserUnbundling != nil {
148- supportedFeature .BrowseUnbundling = types .BoolValue (* features .BrowserUnbundling )
149- }
150-
151- if features .BrowserUnbundlingPublic != nil {
152- supportedFeature .BrowseUnbundlingPublic = types .BoolValue (* features .BrowserUnbundlingPublic )
153- }
123+ supportedFeature .CloudModeInstances = types .StringPointerValue (features .CloudModeInstances )
124+ supportedFeature .DeviceModeInstances = types .StringPointerValue (features .DeviceModeInstances )
125+ supportedFeature .Replay = types .BoolPointerValue (features .Replay )
126+ supportedFeature .BrowseUnbundling = types .BoolPointerValue (features .BrowserUnbundling )
127+ supportedFeature .BrowseUnbundlingPublic = types .BoolPointerValue (features .BrowserUnbundlingPublic )
154128
155129 return & supportedFeature
156130}
157131
158132func (d * DestinationMetadataState ) getSupportedMethods (methods api.SupportedMethods ) * SupportedMethod {
159133 var supportedMethod SupportedMethod
160134
161- if methods .Pageview != nil {
162- supportedMethod .PageView = types .BoolValue (* methods .Pageview )
163- }
164-
165- if methods .Identify != nil {
166- supportedMethod .Identify = types .BoolValue (* methods .Identify )
167- }
168-
169- if methods .Alias != nil {
170- supportedMethod .Alias = types .BoolValue (* methods .Alias )
171- }
172-
173- if methods .Track != nil {
174- supportedMethod .Track = types .BoolValue (* methods .Track )
175- }
176-
177- if methods .Group != nil {
178- supportedMethod .Group = types .BoolValue (* methods .Group )
179- }
135+ supportedMethod .PageView = types .BoolPointerValue (methods .Pageview )
136+ supportedMethod .Identify = types .BoolPointerValue (methods .Identify )
137+ supportedMethod .Alias = types .BoolPointerValue (methods .Alias )
138+ supportedMethod .Track = types .BoolPointerValue (methods .Track )
139+ supportedMethod .Group = types .BoolPointerValue (methods .Group )
180140
181141 return & supportedMethod
182142}
@@ -200,9 +160,7 @@ func (d *DestinationMetadataState) getComponents(components []api.DestinationMet
200160 Code : types .StringValue (c .Code ),
201161 }
202162
203- if c .Owner != nil {
204- componentToAdd .Owner = types .StringValue (* c .Owner )
205- }
163+ componentToAdd .Owner = types .StringPointerValue (c .Owner )
206164
207165 componentsToAdd = append (componentsToAdd , componentToAdd )
208166 }
@@ -235,10 +193,10 @@ func (d *DestinationMetadataState) getContacts(contacts []api.Contact) []Contact
235193
236194 for _ , c := range contacts {
237195 contactToAdd := Contact {
238- Name : types .StringValue ( * c .Name ),
196+ Name : types .StringPointerValue ( c .Name ),
239197 Email : types .StringValue (c .Email ),
240- Role : types .StringValue ( * c .Role ),
241- IsPrimary : types .BoolValue ( * c .IsPrimary ),
198+ Role : types .StringPointerValue ( c .Role ),
199+ IsPrimary : types .BoolPointerValue ( c .IsPrimary ),
242200 }
243201
244202 contactsToAdd = append (contactsToAdd , contactToAdd )
@@ -315,9 +273,7 @@ func (d *DestinationMetadataState) getFields(fields []api.DestinationMetadataAct
315273 AllowNull : types .BoolValue (f .AllowNull ),
316274 }
317275
318- if f .Placeholder != nil {
319- fieldToAdd .Placeholder = types .StringValue (* f .Placeholder )
320- }
276+ fieldToAdd .Placeholder = types .StringPointerValue (f .Placeholder )
321277
322278 if f .DefaultValue != nil {
323279 defaultValue , err := json .Marshal (f .DefaultValue )
@@ -345,11 +301,11 @@ func (d *DestinationMetadataState) getLogosDestinationMetadata(logos api.Logos)
345301 }
346302
347303 if logos .Mark .IsSet () {
348- logosToAdd .Mark = types .StringValue ( * logos .Mark .Get ())
304+ logosToAdd .Mark = types .StringPointerValue ( logos .Mark .Get ())
349305 }
350306
351307 if logos .Alt .IsSet () {
352- logosToAdd .Alt = types .StringValue ( * logos .Alt .Get ())
308+ logosToAdd .Alt = types .StringPointerValue ( logos .Alt .Get ())
353309 }
354310
355311 return & logosToAdd
@@ -365,13 +321,9 @@ func getOptions(options []api.IntegrationOptionBeta) ([]IntegrationOptionState,
365321 Required : types .BoolValue (opt .Required ),
366322 }
367323
368- if opt .Description != nil {
369- integrationOption .Description = types .StringValue (* opt .Description )
370- }
324+ integrationOption .Description = types .StringPointerValue (opt .Description )
371325
372- if opt .Label != nil {
373- integrationOption .Label = types .StringValue (* opt .Label )
374- }
326+ integrationOption .Label = types .StringPointerValue (opt .Label )
375327
376328 if opt .DefaultValue != nil {
377329 defaultValue , err := json .Marshal (opt .DefaultValue )
0 commit comments