github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/api/cloudcontroller/ccv3/space_feature.go (about) 1 package ccv3 2 3 import ( 4 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal" 5 ) 6 7 type SpaceFeature struct { 8 Name string 9 Enabled bool 10 } 11 12 func (client *Client) GetSpaceFeature(spaceGUID string, featureName string) (bool, Warnings, error) { 13 var responseBody SpaceFeature 14 15 _, warnings, err := client.MakeRequest(RequestParams{ 16 RequestName: internal.GetSpaceFeatureRequest, 17 URIParams: internal.Params{"space_guid": spaceGUID, "feature": featureName}, 18 ResponseBody: &responseBody, 19 }) 20 21 return responseBody.Enabled, warnings, err 22 } 23 24 func (client *Client) UpdateSpaceFeature(spaceGUID string, enabled bool, featureName string) (Warnings, error) { 25 _, warnings, err := client.MakeRequest(RequestParams{ 26 RequestName: internal.PatchSpaceFeaturesRequest, 27 URIParams: internal.Params{"space_guid": spaceGUID, "feature": featureName}, 28 RequestBody: struct { 29 Enabled bool `json:"enabled"` 30 }{Enabled: enabled}, 31 }) 32 33 return warnings, err 34 }