github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/swr/v2/organizations/Get.go (about) 1 package organizations 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 ) 7 8 func Get(client *golangsdk.ServiceClient, id string) (*Organization, error) { 9 // GET /v2/manage/namespaces/{namespace} 10 raw, err := client.Get(client.ServiceURL("manage", "namespaces", id), nil, nil) 11 if err != nil { 12 return nil, err 13 } 14 15 var res Organization 16 err = extract.Into(raw.Body, &res) 17 return &res, err 18 } 19 20 type Organization struct { 21 // Organization ID 22 ID int `json:"id"` 23 // Organization name 24 Name string `json:"name"` 25 // IAM username 26 CreatorName string `json:"creator_name"` 27 // User permission 28 // 7: Manage 29 // 3: Write 30 // 1: Read 31 Auth int `json:"auth"` 32 }