Documentation
¶
Index ¶
- func RequestAccessToken(ctx context.Context, clientID string, clientSecret string, enterpriseId string, ...) (string, error)
- type APIError
- type BaseType
- type Client
- func (c *Client) ActivateUser(ctx context.Context, userID string) error
- func (c *Client) CheckAdminAccess(ctx context.Context) error
- func (c *Client) CreateUser(ctx context.Context, input CreateUserInput) (*User, error)
- func (c *Client) DeactivateUser(ctx context.Context, userID string) error
- func (c *Client) DeleteUser(ctx context.Context, userID string) error
- func (c *Client) GetCurrentUserWithEnterprise(ctx context.Context) (User, error)
- func (c *Client) GetGroup(ctx context.Context, groupId string) (Group, error)
- func (c *Client) GetGroupMemberships(ctx context.Context, groupId string, marker string) ([]GroupMembership, string, annotations.Annotations, error)
- func (c *Client) GetGroups(ctx context.Context, marker string) ([]Group, string, annotations.Annotations, error)
- func (c *Client) GetUser(ctx context.Context, userID string) (*User, error)
- func (c *Client) GetUserByLogin(ctx context.Context, login string) (*User, error)
- func (c *Client) GetUsers(ctx context.Context, marker string) ([]User, string, annotations.Annotations, error)
- func (c *Client) UpdateUser(ctx context.Context, userID string, updates map[string]interface{}) (*User, error)
- type CreateUserInput
- type Enterprise
- type Group
- type GroupMembership
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶ added in v0.0.4
APIError carries a structured Box API error so callers can check error codes with errors.As.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ActivateUser ¶ added in v0.0.4
ActivateUser sets a Box user's status back to active.
func (*Client) CheckAdminAccess ¶ added in v0.0.5
CheckAdminAccess verifies the token has manage-users admin scope by requesting a single user entry. Box CCG Service Accounts are not assigned a role designation, so validating via the role field is incorrect; a 403 here means insufficient scope.
func (*Client) CreateUser ¶ added in v0.0.4
CreateUser creates a new managed Box user via POST /2.0/users.
func (*Client) DeactivateUser ¶ added in v0.0.4
DeactivateUser sets a Box user's status to inactive (reversible).
func (*Client) DeleteUser ¶ added in v0.0.4
DeleteUser permanently deletes a Box user via DELETE /2.0/users/{id}. force=true removes the user even when they still have content. notify=false suppresses the email notification sent to the user.
func (*Client) GetCurrentUserWithEnterprise ¶
GetCurrentUserWithEnterprise returns current user with enterprise data.
func (*Client) GetGroupMemberships ¶
func (c *Client) GetGroupMemberships(ctx context.Context, groupId string, marker string) ([]GroupMembership, string, annotations.Annotations, error)
GetGroupMemberships returns one page of memberships for the given group.
func (*Client) GetGroups ¶
func (c *Client) GetGroups(ctx context.Context, marker string) ([]Group, string, annotations.Annotations, error)
GetGroups returns one page of groups from the Box enterprise.
func (*Client) GetUserByLogin ¶ added in v0.0.4
GetUserByLogin fetches a single user by exact login (email) match via GET /2.0/users?filter_term=. Returns nil, nil when no user with that login exists.
type CreateUserInput ¶ added in v0.0.4
type CreateUserInput struct {
Login string `json:"login"`
Name string `json:"name"`
Role string `json:"role,omitempty"`
Status string `json:"status,omitempty"`
}
CreateUserInput holds the fields sent to POST /2.0/users.