Documentation ¶
Index ¶
- Constants
- type AddToGroupMembers
- type AddUserToGroupBody
- type Client
- func (c *Client) AddRoleToUser(ctx context.Context, roleId, email string) (*v2.RateLimitDescription, error)
- func (c *Client) AddUserToGroup(ctx context.Context, groupId, email, accessType string) (*v2.RateLimitDescription, error)
- func (c *Client) Authorize(ctx context.Context, appKey, appSecret string) (string, error)
- func (c *Client) ClearRoles(ctx context.Context, email string) (*v2.RateLimitDescription, error)
- func (c *Client) GetTeamMemberID(ctx context.Context, groupId, userId string) (string, error)
- func (c *Client) ListGroupMembers(ctx context.Context, groupId string, limit int) (*ListGroupMembersPayload, *v2.RateLimitDescription, error)
- func (c *Client) ListGroupMembersContinue(ctx context.Context, cursor string) (*ListGroupMembersPayload, *v2.RateLimitDescription, error)
- func (c *Client) ListGroups(ctx context.Context, limit int) (*ListGroupsPayload, *v2.RateLimitDescription, error)
- func (c *Client) ListGroupsContinue(ctx context.Context, cursor string) (*ListGroupsPayload, *v2.RateLimitDescription, error)
- func (c *Client) ListUsers(ctx context.Context, limit int) (*ListUsersPayload, *v2.RateLimitDescription, error)
- func (c *Client) ListUsersContinue(ctx context.Context, cursor string) (*ListUsersPayload, *v2.RateLimitDescription, error)
- func (c *Client) RemoveUserFromGroup(ctx context.Context, groupId, email string) (*v2.RateLimitDescription, error)
- func (c *Client) RequestAccessToken(ctx context.Context, code string) (string, *time.Time, string, error)
- func (c *Client) RequestAccessTokenUsingRefreshToken(ctx context.Context) (string, *time.Time, error)
- type Config
- type EmailTag
- type Group
- type GroupIdTag
- type ListGroupMembersBody
- type ListGroupMembersPayload
- type ListGroupsBody
- type ListGroupsPayload
- type ListUserBody
- type ListUsersPayload
- type MembersPayload
- type MembersProfile
- type Name
- type Profile
- type RemoveUserFromGroupBody
- type Role
- type Tag
- type UserPayload
Constants ¶
View Source
const ( BaseURL = "https://api.dropboxapi.com" AuthURL = "https://dropbox.com/oauth2/authorize" TokenURL = BaseURL + "/oauth2/token" )
View Source
const ( // users. ListUsersURL = BaseURL + "/2/team/members/list_v2" ListUsersContinueURL = BaseURL + "/2/team/members/list/continue_v2" // roles. SetRoleURL = BaseURL + "/2/team/members/set_admin_permissions_v2" // groups. ListGroupsURL = BaseURL + "/2/team/groups/list" ListGroupsContinueURL = BaseURL + "/2/team/groups/list/continue" ListGroupMembersURL = BaseURL + "/2/team/groups/members/list" ListGroupMembersContinueURL = BaseURL + "/2/team/groups/members/list/continue" AddUserToGroupURL = BaseURL + "/2/team/groups/members/add" RemoveUserFromGroupURL = BaseURL + "/2/team/groups/members/remove" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddToGroupMembers ¶
type AddUserToGroupBody ¶
type AddUserToGroupBody struct { Group GroupIdTag `json:"group"` Members []AddToGroupMembers `json:"members"` ReturnMembers bool `json:"return_members"` }
type Client ¶
type Client struct { uhttp.BaseHttpClient Config TokenSource oauth2.TokenSource }
func (*Client) AddRoleToUser ¶
func (*Client) AddUserToGroup ¶
func (*Client) ClearRoles ¶
endpoint only allows removing all roles, not specific roles also removing them all leaves the user with the member role by default https://www.dropbox.com/developers/documentation/http/teams#team-members-set_admin_permissions
func (*Client) GetTeamMemberID ¶
func (*Client) ListGroupMembers ¶
func (c *Client) ListGroupMembers(ctx context.Context, groupId string, limit int) (*ListGroupMembersPayload, *v2.RateLimitDescription, error)
func (*Client) ListGroupMembersContinue ¶
func (c *Client) ListGroupMembersContinue(ctx context.Context, cursor string) (*ListGroupMembersPayload, *v2.RateLimitDescription, error)
func (*Client) ListGroups ¶
func (c *Client) ListGroups(ctx context.Context, limit int) (*ListGroupsPayload, *v2.RateLimitDescription, error)
docs: https://www.dropbox.com/developers/documentation/http/teams#team-groups-list
func (*Client) ListGroupsContinue ¶
func (c *Client) ListGroupsContinue(ctx context.Context, cursor string) (*ListGroupsPayload, *v2.RateLimitDescription, error)
func (*Client) ListUsers ¶
func (c *Client) ListUsers(ctx context.Context, limit int) (*ListUsersPayload, *v2.RateLimitDescription, error)
func (*Client) ListUsersContinue ¶
func (c *Client) ListUsersContinue(ctx context.Context, cursor string) (*ListUsersPayload, *v2.RateLimitDescription, error)
func (*Client) RemoveUserFromGroup ¶
func (*Client) RequestAccessToken ¶
func (*Client) RequestAccessTokenUsingRefreshToken ¶
func (c *Client) RequestAccessTokenUsingRefreshToken(ctx context.Context) (string, *time.Time, error)
returns access token and expiry time
curl https://api.dropbox.com/oauth2/token \ -d grant_type=refresh_token \ -d refresh_token=<refresh_token> \ -d client_id=<app_key> \ -d client_secret=<app_secret>
type GroupIdTag ¶
type ListGroupMembersBody ¶
type ListGroupMembersBody struct { Group GroupIdTag `json:"group"` Limit int `json:"limit"` }
func DefaultGroupMembersBody ¶
func DefaultGroupMembersBody() ListGroupMembersBody
type ListGroupMembersPayload ¶
type ListGroupMembersPayload struct { Cursor string `json:"cursor"` HasMore bool `json:"has_more"` Members []MembersPayload `json:"members"` }
type ListGroupsBody ¶
type ListGroupsBody struct {
Limit int `json:"limit"`
}
func DefaultListGroupsBody ¶
func DefaultListGroupsBody() ListGroupsBody
type ListGroupsPayload ¶
type ListUserBody ¶
func DefaultListUserBody ¶
func DefaultListUserBody() ListUserBody
type ListUsersPayload ¶
type ListUsersPayload struct { Cursor string `json:"cursor"` HasMore bool `json:"has_more"` Members []UserPayload `json:"members"` }
type MembersPayload ¶
type MembersPayload struct { Profile MembersProfile `json:"profile"` // owner or member of the group AccessType Tag `json:"access_type"` }
type MembersProfile ¶
type RemoveUserFromGroupBody ¶
type RemoveUserFromGroupBody struct { Group GroupIdTag `json:"group"` Users []EmailTag `json:"users"` ReturnMembers bool `json:"return_members"` }
type UserPayload ¶
func (UserPayload) HasRole ¶
func (u UserPayload) HasRole(roleID string) bool
Click to show internal directories.
Click to hide internal directories.