github.com/aiven/aiven-go-client@v1.36.0/organization.go (about) 1 // Package aiven provides a client for using the Aiven API. 2 package aiven 3 4 type ( 5 // OrganizationHandler is the client which interacts with the Organizations API on Aiven. 6 OrganizationHandler struct { 7 // client is the API client to use. 8 client *Client 9 } 10 11 // OrganizationInfo is a response from Aiven for a single organization. 12 OrganizationInfo struct { 13 APIResponse 14 15 // ID is the unique identifier of the organization. 16 ID string `json:"organization_id"` 17 // Name is the name of the organization. 18 Name string `json:"organization_name"` 19 // AccountID is the unique identifier of the account. 20 AccountID string `json:"account_id"` 21 // CreateTime is the time when the organization was created. 22 CreateTime string `json:"create_time"` 23 // UpdateTime is the time when the organization was last updated. 24 UpdateTime string `json:"update_time"` 25 } 26 ) 27 28 // Get returns information about the specified organization. 29 func (h *OrganizationHandler) Get(id string) (*OrganizationInfo, error) { 30 path := buildPath("organization", id) 31 32 bts, err := h.client.doGetRequest(path, nil) 33 if err != nil { 34 return nil, err 35 } 36 37 var r OrganizationInfo 38 39 return &r, checkAPIResponse(bts, &r) 40 }