MCPcopy Index your code
hub / github.com/cloudfoundry/cli / UnmarshalJSON

Method UnmarshalJSON

resources/organization_resource.go:21–49  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

19}
20
21func (org *Organization) UnmarshalJSON(data []byte) error {
22 type alias Organization
23 var aliasOrg alias
24 err := json.Unmarshal(data, &aliasOrg)
25 if err != nil {
26 return err
27 }
28
29 *org = Organization(aliasOrg)
30
31 remainingFields := new(struct {
32 Relationships struct {
33 Quota struct {
34 Data struct {
35 GUID string
36 }
37 }
38 }
39 })
40
41 err = json.Unmarshal(data, &remainingFields)
42 if err != nil {
43 return err
44 }
45
46 org.QuotaGUID = remainingFields.Relationships.Quota.Data.GUID
47
48 return nil
49}

Callers

nothing calls this directly

Calls 1

OrganizationStruct · 0.70

Tested by

no test coverage detected