Documentation
¶
Overview ¶
Package user provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- func NewGetUserCustomerRequest(server string) (*http.Request, error)
- func NewGetUserRequest(server string) (*http.Request, error)
- func NewListAccountsRequest(server string) (*http.Request, error)
- func NewResetPasswordRequest(server string) (*http.Request, error)
- type Account
- type AccountRole
- type Client
- func (c *Client) GetUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetUserCustomer(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListAccounts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ResetPassword(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetUserCustomerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserCustomerHTTPResp, error)
- func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserHTTPResp, error)
- func (c *ClientWithResponses) ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsHTTPResp, error)
- func (c *ClientWithResponses) ResetPasswordWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ResetPasswordHTTPResp, error)
- type ClientWithResponsesInterface
- type DefaultV2MessageResponse
- type GetUserCustomerHTTPResp
- type GetUserHTTPResp
- type HttpRequestDoer
- type ListAccountsHTTPResp
- type PaginatedAccountResponse
- type Pagination
- type RequestEditorFn
- type ResetPasswordHTTPResp
- type User
- type UserAccount
- type UserCustomer
- type UserCustomerCustomer
- type UserCustomerCustomerApis
- type UserCustomerCustomerApisBabelforce
- type UserCustomerCustomerApisStream
- type UserCustomerCustomerSettings
- type UserCustomerItemResponse
- type UserCustomerUser
- type UserItemResponse
Constants ¶
const ( AccessIdScopes = "accessId.Scopes" AccessTokenScopes = "accessToken.Scopes" Oauth2Scopes = "oauth2.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func NewGetUserCustomerRequest ¶
NewGetUserCustomerRequest generates requests for GetUserCustomer
func NewGetUserRequest ¶
NewGetUserRequest generates requests for GetUser
func NewListAccountsRequest ¶
NewListAccountsRequest generates requests for ListAccounts
Types ¶
type Account ¶
type Account struct {
// Id The unique Identifier (UUID) of the object
Id openapi_types.UUID `json:"id"`
// Name The Name of the Company
Name string `json:"name"`
// Roles A role associated with the Account
Roles AccountRole `json:"roles"`
}
Account Babelforce Account
type AccountRole ¶
type AccountRole string
AccountRole A role associated with the Account
const ( AccountRoleAgent AccountRole = "agent" AccountRoleManager AccountRole = "manager" AccountRoleOwner AccountRole = "owner" AccountRoleReporter AccountRole = "reporter" AccountRoleRouter AccountRole = "router" AccountRoleSales AccountRole = "sales" AccountRoleScheduler AccountRole = "scheduler" AccountRoleSupervisor AccountRole = "supervisor" AccountRoleUser AccountRole = "user" )
Defines values for AccountRole.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetUserCustomer ¶
func (*Client) ListAccounts ¶
func (*Client) ResetPassword ¶
type ClientInterface ¶
type ClientInterface interface {
// GetUserCustomer request
GetUserCustomer(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListAccounts request
ListAccounts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUser request
GetUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ResetPassword request
ResetPassword(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetUserCustomerWithResponse ¶
func (c *ClientWithResponses) GetUserCustomerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserCustomerHTTPResp, error)
GetUserCustomerWithResponse request returning *GetUserCustomerHTTPResp
func (*ClientWithResponses) GetUserWithResponse ¶
func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserHTTPResp, error)
GetUserWithResponse request returning *GetUserHTTPResp
func (*ClientWithResponses) ListAccountsWithResponse ¶
func (c *ClientWithResponses) ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsHTTPResp, error)
ListAccountsWithResponse request returning *ListAccountsHTTPResp
func (*ClientWithResponses) ResetPasswordWithResponse ¶
func (c *ClientWithResponses) ResetPasswordWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ResetPasswordHTTPResp, error)
ResetPasswordWithResponse request returning *ResetPasswordHTTPResp
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetUserCustomerWithResponse request
GetUserCustomerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserCustomerHTTPResp, error)
// ListAccountsWithResponse request
ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsHTTPResp, error)
// GetUserWithResponse request
GetUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUserHTTPResp, error)
// ResetPasswordWithResponse request
ResetPasswordWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ResetPasswordHTTPResp, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DefaultV2MessageResponse ¶
type DefaultV2MessageResponse struct {
Message *string `json:"message,omitempty"`
// Success Whether or not the request was successful
Success bool `json:"success"`
}
DefaultV2MessageResponse defines model for DefaultV2MessageResponse.
type GetUserCustomerHTTPResp ¶
type GetUserCustomerHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *UserCustomerItemResponse
}
func ParseGetUserCustomerHTTPResp ¶
func ParseGetUserCustomerHTTPResp(rsp *http.Response) (*GetUserCustomerHTTPResp, error)
ParseGetUserCustomerHTTPResp parses an HTTP response from a GetUserCustomerWithResponse call
func (GetUserCustomerHTTPResp) Status ¶
func (r GetUserCustomerHTTPResp) Status() string
Status returns HTTPResponse.Status
func (GetUserCustomerHTTPResp) StatusCode ¶
func (r GetUserCustomerHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetUserHTTPResp ¶
type GetUserHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *UserItemResponse
}
func ParseGetUserHTTPResp ¶
func ParseGetUserHTTPResp(rsp *http.Response) (*GetUserHTTPResp, error)
ParseGetUserHTTPResp parses an HTTP response from a GetUserWithResponse call
func (GetUserHTTPResp) Status ¶
func (r GetUserHTTPResp) Status() string
Status returns HTTPResponse.Status
func (GetUserHTTPResp) StatusCode ¶
func (r GetUserHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListAccountsHTTPResp ¶
type ListAccountsHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *PaginatedAccountResponse
}
func ParseListAccountsHTTPResp ¶
func ParseListAccountsHTTPResp(rsp *http.Response) (*ListAccountsHTTPResp, error)
ParseListAccountsHTTPResp parses an HTTP response from a ListAccountsWithResponse call
func (ListAccountsHTTPResp) Status ¶
func (r ListAccountsHTTPResp) Status() string
Status returns HTTPResponse.Status
func (ListAccountsHTTPResp) StatusCode ¶
func (r ListAccountsHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PaginatedAccountResponse ¶
type PaginatedAccountResponse struct {
Items []Account `json:"items"`
Pagination Pagination `json:"pagination"`
}
PaginatedAccountResponse defines model for PaginatedAccountResponse.
type Pagination ¶
type Pagination struct {
Current int `json:"current"`
Max int `json:"max"`
Next *string `json:"next,omitempty"`
Pages int `json:"pages"`
Total int `json:"total"`
}
Pagination defines model for Pagination.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResetPasswordHTTPResp ¶
type ResetPasswordHTTPResp struct {
Body []byte
HTTPResponse *http.Response
JSON200 *DefaultV2MessageResponse
}
func ParseResetPasswordHTTPResp ¶
func ParseResetPasswordHTTPResp(rsp *http.Response) (*ResetPasswordHTTPResp, error)
ParseResetPasswordHTTPResp parses an HTTP response from a ResetPasswordWithResponse call
func (ResetPasswordHTTPResp) Status ¶
func (r ResetPasswordHTTPResp) Status() string
Status returns HTTPResponse.Status
func (ResetPasswordHTTPResp) StatusCode ¶
func (r ResetPasswordHTTPResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type User ¶
type User struct {
// Account A Company User Account
Account UserAccount `json:"account"`
// Id The unique Identifier (UUID) of the object
Id openapi_types.UUID `json:"id"`
// Roles A List of Roles which are associated with the current User
Roles []AccountRole `json:"roles"`
Username string `json:"username"`
}
User defines model for User.
type UserAccount ¶
type UserAccount struct {
// Company The Name of the Company associated with that User
Company string `json:"company"`
// Id The unique Identifier (UUID) of the object
Id openapi_types.UUID `json:"id"`
}
UserAccount A Company User Account
type UserCustomer ¶
type UserCustomer struct {
// Customer A user's customer account details
Customer UserCustomerCustomer `json:"customer"`
// User Basic user information
User UserCustomerUser `json:"user"`
}
UserCustomer User & associated customer account information
type UserCustomerCustomer ¶
type UserCustomerCustomer struct {
// Apis API access information for the user's customer account
Apis UserCustomerCustomerApis `json:"apis"`
// Company The name of the company associated with the user
Company string `json:"company"`
DateCreated time.Time `json:"dateCreated"`
// Email Customer account owner's email
Email openapi_types.Email `json:"email"`
// FirstName Customer account owner's first name
FirstName string `json:"firstName"`
// Id The unique Identifier (UUID) of the object
Id openapi_types.UUID `json:"id"`
// LastName Customer account owner's last name
LastName string `json:"lastName"`
// Phone The contact number for the user's customer account
Phone string `json:"phone"`
// Settings User's customer account settings
Settings UserCustomerCustomerSettings `json:"settings"`
}
UserCustomerCustomer A user's customer account details
type UserCustomerCustomerApis ¶
type UserCustomerCustomerApis struct {
// Babelforce REST API access credentials
Babelforce UserCustomerCustomerApisBabelforce `json:"babelforce"`
// Stream Stream API access information
Stream UserCustomerCustomerApisStream `json:"stream"`
}
UserCustomerCustomerApis API access information for the user's customer account
type UserCustomerCustomerApisBabelforce ¶
type UserCustomerCustomerApisBabelforce struct {
// AccessId The unique Identifier (UUID) of the object
AccessId openapi_types.UUID `json:"accessId"`
// AccessToken The unique Identifier (UUID) of the object
AccessToken openapi_types.UUID `json:"accessToken"`
}
UserCustomerCustomerApisBabelforce REST API access credentials
type UserCustomerCustomerApisStream ¶
type UserCustomerCustomerApisStream struct {
DateCreated time.Time `json:"dateCreated"`
LastUpdated time.Time `json:"lastUpdated"`
// Token Push API token
Token string `json:"token"`
}
UserCustomerCustomerApisStream Stream API access information
type UserCustomerCustomerSettings ¶
type UserCustomerCustomerSettings struct {
// DefaultTimeZone Timezone of the user's customer account
DefaultTimeZone string `json:"defaultTimeZone"`
// Enabled Whether the user's customer account is enabled or not
Enabled bool `json:"enabled"`
// IsTrialExpired Whether the user's customer account is an expired trial account or not
IsTrialExpired bool `json:"isTrialExpired"`
TrialExpirationDate time.Time `json:"trialExpirationDate"`
}
UserCustomerCustomerSettings User's customer account settings
type UserCustomerItemResponse ¶
type UserCustomerItemResponse struct {
// Item User & associated customer account information
Item UserCustomer `json:"item"`
// Success Whether the Request was successful or not
Success bool `json:"success"`
}
UserCustomerItemResponse defines model for UserCustomerItemResponse.
type UserCustomerUser ¶
type UserCustomerUser struct {
// Expired Whether or not the user account has expired
Expired *bool `json:"expired,omitempty"`
// Id The unique Identifier (UUID) of the object
Id *openapi_types.UUID `json:"id,omitempty"`
// Roles A List of Roles which are associated with the current User
Roles *[]AccountRole `json:"roles,omitempty"`
// Username User's email username
Username *openapi_types.Email `json:"username,omitempty"`
}
UserCustomerUser Basic user information
type UserItemResponse ¶
type UserItemResponse struct {
Item User `json:"item"`
// Success Whether the Request was successful or not
Success bool `json:"success"`
}
UserItemResponse defines model for UserItemResponse.