-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(BRIDGE-150): added organization endpoint route and call
- Loading branch information
1 parent
d663a2e
commit b4860af
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package proton | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/go-resty/resty/v2" | ||
) | ||
|
||
type OrganizationResponse struct { | ||
Code int | ||
Organization organization | ||
} | ||
|
||
type organization struct { | ||
Name string | ||
DisplayName string | ||
PlanName string | ||
MaxMembers int | ||
} | ||
|
||
func (c *Client) GetOrganizationData(ctx context.Context) (OrganizationResponse, error) { | ||
var res OrganizationResponse | ||
|
||
if err := c.do(ctx, func(r *resty.Request) (*resty.Response, error) { | ||
return r.SetResult(&res).Get("/core/v4/organizations") | ||
}); err != nil { | ||
return res, err | ||
} | ||
|
||
return res, nil | ||
} |