Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type AdminApiGroupsOpts
- type AdminApiService
- func (a *AdminApiService) CurrentSettings(ctx context.Context) (Setting, *http.Response, error)
- func (a *AdminApiService) Group(ctx context.Context, id int64) (GroupResponsePayload, *http.Response, error)
- func (a *AdminApiService) Groups(ctx context.Context, localVarOptionals *AdminApiGroupsOpts) (GroupsResponsePayload, *http.Response, error)
- func (a *AdminApiService) Impersonate(ctx context.Context, id int64) (TokenPayload, *http.Response, error)
- func (a *AdminApiService) InitializeSync(ctx context.Context) (SheetResponsePayload, *http.Response, error)
- func (a *AdminApiService) RunSync(ctx context.Context) (SheetResponsePayload, *http.Response, error)
- func (a *AdminApiService) RunSyncOnce(ctx context.Context, id int64) (*http.Response, error)
- func (a *AdminApiService) User(ctx context.Context, id int64) (UserResponsePayload, *http.Response, error)
- func (a *AdminApiService) Users(ctx context.Context, localVarOptionals *AdminApiUsersOpts) (UsersResponsePayload, *http.Response, error)
- type AdminApiUsersOpts
- type AuthApiService
- func (a *AuthApiService) ExchangeAdmin(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
- func (a *AuthApiService) ExchangeFacebook(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
- func (a *AuthApiService) ExchangeGoogle(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
- type BasicAuth
- type Configuration
- type ErrorPayload
- type GenericSwaggerError
- type Group
- type GroupResponsePayload
- type GroupsResponsePayload
- type Pagination
- type ProfileResponsePayload
- type Setting
- type SheetResponsePayload
- type TokenPayload
- type User
- type UserApiService
- type UserResponsePayload
- type UserWithGroup
- type UsersResponsePayload
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
AdminApi *AdminApiService
AuthApi *AuthApiService
UserApi *UserApiService
// contains filtered or unexported fields
}
APIClient manages communication with the API v In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AdminApiGroupsOpts ¶
type AdminApiService ¶
type AdminApiService service
func (*AdminApiService) CurrentSettings ¶
AdminApiService Returns the current application settings.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Setting
func (*AdminApiService) Group ¶
func (a *AdminApiService) Group(ctx context.Context, id int64) (GroupResponsePayload, *http.Response, error)
AdminApiService Returns a group and its users.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param id
@return GroupResponsePayload
func (*AdminApiService) Groups ¶
func (a *AdminApiService) Groups(ctx context.Context, localVarOptionals *AdminApiGroupsOpts) (GroupsResponsePayload, *http.Response, error)
func (*AdminApiService) Impersonate ¶
func (a *AdminApiService) Impersonate(ctx context.Context, id int64) (TokenPayload, *http.Response, error)
AdminApiService Gets an authentication token for an admin that allows scoping as a user
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param id
@return TokenPayload
func (*AdminApiService) InitializeSync ¶
func (a *AdminApiService) InitializeSync(ctx context.Context) (SheetResponsePayload, *http.Response, error)
AdminApiService Returns a google sheet reference.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return SheetResponsePayload
func (*AdminApiService) RunSync ¶
func (a *AdminApiService) RunSync(ctx context.Context) (SheetResponsePayload, *http.Response, error)
AdminApiService Returns a google sheet reference.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return SheetResponsePayload
func (*AdminApiService) RunSyncOnce ¶
AdminApiService Returns a google sheet reference.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param id
func (*AdminApiService) User ¶
func (a *AdminApiService) User(ctx context.Context, id int64) (UserResponsePayload, *http.Response, error)
AdminApiService Returns a user and its group.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param id
@return UserResponsePayload
func (*AdminApiService) Users ¶
func (a *AdminApiService) Users(ctx context.Context, localVarOptionals *AdminApiUsersOpts) (UsersResponsePayload, *http.Response, error)
type AdminApiUsersOpts ¶
type AuthApiService ¶
type AuthApiService service
func (*AuthApiService) ExchangeAdmin ¶
func (a *AuthApiService) ExchangeAdmin(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
AuthApiService Exchanges a google authentication token with an admin api token.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return TokenPayload
func (*AuthApiService) ExchangeFacebook ¶
func (a *AuthApiService) ExchangeFacebook(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
AuthApiService Exchanges a facebook authentication token with an api token.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return TokenPayload
func (*AuthApiService) ExchangeGoogle ¶
func (a *AuthApiService) ExchangeGoogle(ctx context.Context, body TokenPayload) (TokenPayload, *http.Response, error)
AuthApiService Exchanges a google authentication token with an api token.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return TokenPayload
type BasicAuth ¶
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type ErrorPayload ¶
type ErrorPayload struct {
Error_ string `json:"error,omitempty"`
}
ErrorPayload wraps errors in a well-defined api payload
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type Group ¶
type Group struct {
Archived bool `json:"archived,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Id int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Published bool `json:"published,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
ZoomLink string `json:"zoomLink,omitempty"`
}
type GroupResponsePayload ¶
type GroupResponsePayload struct {
Group *Group `json:"group,omitempty"`
Users []User `json:"users,omitempty"`
}
GroupResponsePayload contains the queried group and its users
type GroupsResponsePayload ¶
type GroupsResponsePayload struct {
Groups []Group `json:"groups,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
GroupsResponsePayload contains paginated groups
type Pagination ¶
type Pagination struct {
Cursor int64 `json:"cursor,omitempty"`
Filter string `json:"filter,omitempty"`
Limit int64 `json:"limit,omitempty"`
}
Pagination holds query data for pagination
type ProfileResponsePayload ¶
type ProfileResponsePayload struct {
User *UserWithGroup `json:"user,omitempty"`
}
ProfileResponsePayload contains user profile information
type SheetResponsePayload ¶
type SheetResponsePayload struct {
Sheet string `json:"sheet,omitempty"`
}
SheetResponsePayload contains the synchronized Google sheet
type TokenPayload ¶
type TokenPayload struct {
Token string `json:"token,omitempty"`
}
TokenPayload contain the body parameters for a token exchange
type UserApiService ¶
type UserApiService service
func (*UserApiService) Logout ¶
func (a *UserApiService) Logout(ctx context.Context) (TokenPayload, *http.Response, error)
UserApiService Log out of the user account.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TokenPayload
func (*UserApiService) Profile ¶
func (a *UserApiService) Profile(ctx context.Context) (ProfileResponsePayload, *http.Response, error)
UserApiService Returns the users profile.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ProfileResponsePayload
type UserResponsePayload ¶
type UserResponsePayload struct {
User *UserWithGroup `json:"user,omitempty"`
}
UserResponsePayload contains the queried user
type UserWithGroup ¶
type UserWithGroup struct {
Blocked bool `json:"blocked,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Email string `json:"email,omitempty"`
Group *Group `json:"group,omitempty"`
Id int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
UserWithGroup is a User model with eagerly loaded group data
type UsersResponsePayload ¶
type UsersResponsePayload struct {
Pagination *Pagination `json:"pagination,omitempty"`
Users []UserWithGroup `json:"users,omitempty"`
}
UsersResponsePayload contains the paginated users
Source Files
¶
- api_admin.go
- api_auth.go
- api_user.go
- client.go
- configuration.go
- model_error_payload.go
- model_group.go
- model_group_response_payload.go
- model_groups_response_payload.go
- model_pagination.go
- model_profile_response_payload.go
- model_setting.go
- model_sheet_response_payload.go
- model_token_payload.go
- model_user.go
- model_user_response_payload.go
- model_user_with_group.go
- model_users_response_payload.go
- response.go