github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/vpcep/v1/endpoints/BatchWhitelist.go (about) 1 package endpoints 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 7 ) 8 9 type BatchUpdateReq struct { 10 Permissions []string `json:"permissions" required:"true"` 11 Action string `json:"action" required:"true"` 12 } 13 14 func BatchUpdateWhitelist(client *golangsdk.ServiceClient, id string, opts BatchUpdateReq) (*BatchUpdateResponse, error) { 15 b, err := build.RequestBody(opts, "") 16 if err != nil { 17 return nil, err 18 } 19 20 // POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions/action 21 raw, err := client.Post(client.ServiceURL("vpc-endpoint-services", id, "permissions", "action"), b, nil, &golangsdk.RequestOpts{ 22 OkCodes: []int{200}, 23 }) 24 if err != nil { 25 return nil, err 26 } 27 28 var res BatchUpdateResponse 29 err = extract.Into(raw.Body, &res) 30 return &res, err 31 } 32 33 type BatchUpdateResponse struct { 34 Permissions []string `json:"permissions"` 35 }