Skip to content

Commit

Permalink
team.profile.get
Browse files Browse the repository at this point in the history
  • Loading branch information
candiduslynx committed Apr 26, 2024
1 parent 204bf37 commit ceced00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions team.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,24 @@ func (api *Client) GetTeamInfoContext(ctx context.Context) (*TeamInfo, error) {
}

// GetTeamProfile gets the Team Profile settings of the user
func (api *Client) GetTeamProfile() (*TeamProfile, error) {
return api.GetTeamProfileContext(context.Background())
func (api *Client) GetTeamProfile(teamID ...string) (*TeamProfile, error) {
return api.GetTeamProfileContext(context.Background(), teamID...)
}

// GetTeamProfileContext gets the Team Profile settings of the user with a custom context
func (api *Client) GetTeamProfileContext(ctx context.Context) (*TeamProfile, error) {
func (api *Client) GetTeamProfileContext(ctx context.Context, teamID ...string) (*TeamProfile, error) {
values := url.Values{
"token": {api.token},
}
if len(teamID) > 0 {
values["team_id"] = teamID
}

response, err := api.teamProfileRequest(ctx, api.httpclient, "team.profile.get", values)
if err != nil {
return nil, err
}
return &response.Profile, nil

}

// GetAccessLogs retrieves a page of logins according to the parameters given
Expand Down

0 comments on commit ceced00

Please sign in to comment.