@@ -12,7 +12,7 @@ import (
1212
1313type AssurancePolicy struct {
1414 AssuranceType string `json:"assurance_type"`
15- Id int `json:"id,omitempty "`
15+ Id int `json:"id"`
1616 Name string `json:"name"`
1717 Author string `json:"author"`
1818 Registry string `json:"registry,omitempty"`
@@ -185,19 +185,19 @@ type KubernetesControls struct {
185185type KubernetesControlsArray []KubernetesControls
186186
187187// GetAssurancePolicy - returns single Assurance Policy
188- func (cli * Client ) GetAssurancePolicy (name string , at string ) (* AssurancePolicy , error ) {
188+ func (cli * Client ) GetAssurancePolicy (name string , assuranceType string ) (* AssurancePolicy , error ) {
189189 var err error
190190 var response AssurancePolicy
191191 var atype string
192- if strings .EqualFold (at , "host" ) {
192+ if strings .EqualFold (assuranceType , "host" ) {
193193 atype = "host"
194- } else if strings .EqualFold (at , "image" ) {
194+ } else if strings .EqualFold (assuranceType , "image" ) {
195195 atype = "image"
196- } else if strings .EqualFold (at , "function" ) {
196+ } else if strings .EqualFold (assuranceType , "function" ) {
197197 atype = "function"
198- } else if strings .EqualFold (at , "kubernetes" ) {
198+ } else if strings .EqualFold (assuranceType , "kubernetes" ) {
199199 atype = "kubernetes"
200- } else if strings .EqualFold (at , "cf_application" ) {
200+ } else if strings .EqualFold (assuranceType , "cf_application" ) {
201201 atype = "cf_application"
202202 }
203203
@@ -238,18 +238,18 @@ func (cli *Client) GetAssurancePolicy(name string, at string) (*AssurancePolicy,
238238}
239239
240240// CreateAssurancePolicy - creates single Aqua Assurance Policy
241- func (cli * Client ) CreateAssurancePolicy (assurancepolicy * AssurancePolicy , at string ) error {
242- payload , err := json .Marshal (assurancepolicy )
241+ func (cli * Client ) CreateAssurancePolicy (assurancePolicy * AssurancePolicy , assuranceType string ) error {
242+ payload , err := json .Marshal (assurancePolicy )
243243 var atype string
244- if strings .EqualFold (at , "host" ) {
244+ if strings .EqualFold (assuranceType , "host" ) {
245245 atype = "host"
246- } else if strings .EqualFold (at , "image" ) {
246+ } else if strings .EqualFold (assuranceType , "image" ) {
247247 atype = "image"
248- } else if strings .EqualFold (at , "function" ) {
248+ } else if strings .EqualFold (assuranceType , "function" ) {
249249 atype = "function"
250- } else if strings .EqualFold (at , "kubernetes" ) {
250+ } else if strings .EqualFold (assuranceType , "kubernetes" ) {
251251 atype = "kubernetes"
252- } else if strings .EqualFold (at , "cf_application" ) {
252+ } else if strings .EqualFold (assuranceType , "cf_application" ) {
253253 atype = "cf_application"
254254 }
255255
@@ -284,24 +284,24 @@ func (cli *Client) CreateAssurancePolicy(assurancepolicy *AssurancePolicy, at st
284284}
285285
286286// UpdateAssurancePolicy updates an existing Assurance Policy
287- func (cli * Client ) UpdateAssurancePolicy (assurancepolicy * AssurancePolicy , at string ) error {
288- payload , err := json .Marshal (assurancepolicy )
287+ func (cli * Client ) UpdateAssurancePolicy (assurancePolicy * AssurancePolicy , assuranceType string ) error {
288+ payload , err := json .Marshal (assurancePolicy )
289289 if err != nil {
290290 return err
291291 }
292292 var atype string
293- if strings .EqualFold (at , "host" ) {
293+ if strings .EqualFold (assuranceType , "host" ) {
294294 atype = "host"
295- } else if strings .EqualFold (at , "image" ) {
295+ } else if strings .EqualFold (assuranceType , "image" ) {
296296 atype = "image"
297- } else if strings .EqualFold (at , "function" ) {
297+ } else if strings .EqualFold (assuranceType , "function" ) {
298298 atype = "function"
299- } else if strings .EqualFold (at , "kubernetes" ) {
299+ } else if strings .EqualFold (assuranceType , "kubernetes" ) {
300300 atype = "kubernetes"
301- } else if strings .EqualFold (at , "cf_application" ) {
301+ } else if strings .EqualFold (assuranceType , "cf_application" ) {
302302 atype = "cf_application"
303303 }
304- apiPath := "/api/v2/assurance_policy/" + atype + "/" + assurancepolicy .Name
304+ apiPath := "/api/v2/assurance_policy/" + atype + "/" + assurancePolicy .Name
305305 request := cli .gorequest
306306 err = cli .limiter .Wait (context .Background ())
307307 if err != nil {
@@ -329,18 +329,18 @@ func (cli *Client) UpdateAssurancePolicy(assurancepolicy *AssurancePolicy, at st
329329}
330330
331331// DeleteAssurancePolicy removes a Assurance Policy
332- func (cli * Client ) DeleteAssurancePolicy (name string , at string ) error {
332+ func (cli * Client ) DeleteAssurancePolicy (name string , assuranceType string ) error {
333333 request := cli .gorequest
334334 var atype string
335- if strings .EqualFold (at , "host" ) {
335+ if strings .EqualFold (assuranceType , "host" ) {
336336 atype = "host"
337- } else if strings .EqualFold (at , "image" ) {
337+ } else if strings .EqualFold (assuranceType , "image" ) {
338338 atype = "image"
339- } else if strings .EqualFold (at , "function" ) {
339+ } else if strings .EqualFold (assuranceType , "function" ) {
340340 atype = "function"
341- } else if strings .EqualFold (at , "kubernetes" ) {
341+ } else if strings .EqualFold (assuranceType , "kubernetes" ) {
342342 atype = "kubernetes"
343- } else if strings .EqualFold (at , "cf_application" ) {
343+ } else if strings .EqualFold (assuranceType , "cf_application" ) {
344344 atype = "cf_application"
345345 }
346346 apiPath := "/api/v2/assurance_policy/" + atype + "/" + name
0 commit comments