Reuse chronograf.Organization type
parent
6d2c7e18d1
commit
9eccded4b2
|
@ -788,7 +788,7 @@ type Organization struct {
|
|||
DefaultRole string `json:"defaultRole,omitempty"`
|
||||
// Public specifies whether users must be explicitly added to the organization.
|
||||
// It is currently only used by the default organization, but that may change in the future.
|
||||
Public bool `json:"public,omitempty"`
|
||||
Public bool `json:"public"`
|
||||
}
|
||||
|
||||
// OrganizationQuery represents the attributes that a organization may be retrieved by.
|
||||
|
|
|
@ -57,19 +57,13 @@ func (r *organizationRequest) ValidDefaultRole() error {
|
|||
}
|
||||
|
||||
type organizationResponse struct {
|
||||
Links selfLinks `json:"links"`
|
||||
ID uint64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
DefaultRole string `json:"defaultRole,omitempty"`
|
||||
Public bool `json:"public"`
|
||||
Links selfLinks `json:"links"`
|
||||
chronograf.Organization
|
||||
}
|
||||
|
||||
func newOrganizationResponse(o *chronograf.Organization) *organizationResponse {
|
||||
return &organizationResponse{
|
||||
ID: o.ID,
|
||||
Name: o.Name,
|
||||
DefaultRole: o.DefaultRole,
|
||||
Public: o.Public,
|
||||
Organization: *o,
|
||||
Links: selfLinks{
|
||||
Self: fmt.Sprintf("/chronograf/v1/organizations/%d", o.ID),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue