Documentation ¶
Index ¶
- Constants
- func GetNextToken(offset int, limit int, total int) string
- func ParsePaginationToken(pToken *pagination.Token) (int, int, string, error)
- func WithBearerToken(token string) uhttp.RequestOption
- type AuthRequest
- type AuthResponse
- type Client
- func (c *Client) AddUserToOrganization(ctx context.Context, organizationId string, userId string) (*v2.RateLimitDescription, error)
- func (c *Client) AddUserToRole(ctx context.Context, roleId string, userId string) (*v2.RateLimitDescription, error)
- func (c *Client) Authorize(ctx context.Context, clientId string, clientSecret string) error
- func (c *Client) GetOrganizationMembers(ctx context.Context, organizationId string, limit int, offset int) ([]User, int, *v2.RateLimitDescription, error)
- func (c *Client) GetOrganizations(ctx context.Context, limit int, offset int) ([]Organization, int, *v2.RateLimitDescription, error)
- func (c *Client) GetRoleUsers(ctx context.Context, roleId string, limit int, offset int) ([]User, int, *v2.RateLimitDescription, error)
- func (c *Client) GetRoles(ctx context.Context, limit int, offset int) ([]Role, int, *v2.RateLimitDescription, error)
- func (c *Client) GetUsers(ctx context.Context, limit int, offset int) ([]User, int, *v2.RateLimitDescription, error)
- func (c *Client) List(ctx context.Context, path string, target interface{}, limit int, offset int) (*v2.RateLimitDescription, error)
- func (c *Client) RemoveUserFromOrganization(ctx context.Context, organizationId string, userId string) (*v2.RateLimitDescription, error)
- func (c *Client) RemoveUserFromRole(ctx context.Context, roleId string, userId string) (*v2.RateLimitDescription, error)
- type Organization
- type OrganizationMembersResponse
- type OrganizationsResponse
- type PaginatedResponse
- type Pagination
- type Role
- type RolesResponse
- type RolesUsersResponse
- type User
- type UserIdentities
- type UsersResponse
Constants ¶
View Source
const PageSizeDefault = 100
Variables ¶
This section is empty.
Functions ¶
func GetNextToken ¶
GetNextToken given a limit and offset that were used to fetch _this_ page of data, and total number of resources, return the next pagination token as a string.
func ParsePaginationToken ¶
ParsePaginationToken - takes as pagination token and returns offset, limit, and `pagingRequestId` in that order.
func WithBearerToken ¶
func WithBearerToken(token string) uhttp.RequestOption
WithBearerToken - TODO(marcos): move this function to `baton-sdk`.
Types ¶
type AuthRequest ¶
type AuthResponse ¶
type Client ¶
type Client struct { BearerToken string BaseUrl *url.URL // contains filtered or unexported fields }
func (*Client) AddUserToOrganization ¶
func (*Client) AddUserToRole ¶
func (*Client) GetOrganizationMembers ¶
func (*Client) GetOrganizations ¶
func (c *Client) GetOrganizations( ctx context.Context, limit int, offset int, ) ( []Organization, int, *v2.RateLimitDescription, error, )
func (*Client) GetRoleUsers ¶
func (*Client) RemoveUserFromOrganization ¶
func (*Client) RemoveUserFromRole ¶
type Organization ¶
type OrganizationMembersResponse ¶
type OrganizationMembersResponse struct { Members []User `json:"members"` PaginatedResponse }
type OrganizationsResponse ¶
type OrganizationsResponse struct { Organizations []Organization `json:"organizations"` PaginatedResponse }
type PaginatedResponse ¶
type Pagination ¶
type RolesResponse ¶
type RolesResponse struct { PaginatedResponse Roles []Role `json:"roles"` }
type RolesUsersResponse ¶
type RolesUsersResponse struct { PaginatedResponse Users []User `json:"users"` }
type User ¶
type User struct { CreatedAt time.Time `json:"created_at"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Identities []UserIdentities `json:"identities"` Name string `json:"name"` Nickname string `json:"nickname"` Picture string `json:"picture"` UpdatedAt time.Time `json:"updated_at"` UserId string `json:"user_id"` }
type UserIdentities ¶
type UsersResponse ¶
type UsersResponse struct { PaginatedResponse Length int `json:"length"` Users []User `json:"users"` }
Click to show internal directories.
Click to hide internal directories.