1// Copyright © 2016 Aaron Longwell
2//
3// Use of this source code is governed by an MIT licese.
4// Details in the LICENSE file.
5
6package trello
7
8import (
9	"fmt"
10)
11
12// Organization represents a Trello organization or team, i.e. a collection of members and boards.
13// https://developers.trello.com/reference/#organizations
14type Organization struct {
15	client      *Client
16	ID          string   `json:"id"`
17	Name        string   `json:"name"`
18	DisplayName string   `json:"displayName"`
19	Desc        string   `json:"desc"`
20	URL         string   `json:"url"`
21	Website     string   `json:"website"`
22	Products    []string `json:"products"`
23	PowerUps    []string `json:"powerUps"`
24}
25
26// GetOrganization takes an organization id and Arguments and either
27// GETs returns an Organization, or an error.
28func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error) {
29	path := fmt.Sprintf("organizations/%s", orgID)
30	err = c.Get(path, args, &organization)
31	if organization != nil {
32		organization.client = c
33	}
34	return
35}
36