Skip to content

Commit b4860af

Browse files
committed
feat(BRIDGE-150): added organization endpoint route and call
1 parent d663a2e commit b4860af

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

organization.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package proton
2+
3+
import (
4+
"context"
5+
6+
"github.com/go-resty/resty/v2"
7+
)
8+
9+
type OrganizationResponse struct {
10+
Code int
11+
Organization organization
12+
}
13+
14+
type organization struct {
15+
Name string
16+
DisplayName string
17+
PlanName string
18+
MaxMembers int
19+
}
20+
21+
func (c *Client) GetOrganizationData(ctx context.Context) (OrganizationResponse, error) {
22+
var res OrganizationResponse
23+
24+
if err := c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
25+
return r.SetResult(&res).Get("/core/v4/organizations")
26+
}); err != nil {
27+
return res, err
28+
}
29+
30+
return res, nil
31+
}

0 commit comments

Comments
 (0)