github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/actor/v2action/space_quota.go (about) 1 package v2action 2 3 import ( 4 "fmt" 5 6 "code.cloudfoundry.org/cli/api/cloudcontroller/ccerror" 7 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv2" 8 ) 9 10 type SpaceQuota ccv2.SpaceQuota 11 12 type SpaceQuotaNotFoundError struct { 13 GUID string 14 } 15 16 func (e SpaceQuotaNotFoundError) Error() string { 17 return fmt.Sprintf("Space quota with GUID '%s' not found.", e.GUID) 18 } 19 20 func (actor Actor) GetSpaceQuota(guid string) (SpaceQuota, Warnings, error) { 21 spaceQuota, warnings, err := actor.CloudControllerClient.GetSpaceQuota(guid) 22 23 if _, ok := err.(ccerror.ResourceNotFoundError); ok { 24 return SpaceQuota{}, Warnings(warnings), SpaceQuotaNotFoundError{GUID: guid} 25 } 26 27 return SpaceQuota(spaceQuota), Warnings(warnings), err 28 }