user

package
v1.2.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Asc  Order = "asc"
	Desc Order = "desc"

	Username    SortField = "username"
	Role        SortField = "role"
	FullName    SortField = "fullName"
	FullNameRaw SortField = "fullName.raw"
	Verified    SortField = "verified"
	Blocked     SortField = "blocked"
	CreatedAt   SortField = "createdAt"

	Name Identifier = iota
	Id
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *client.Config) (*Client, error)

func (*Client) Create

func (c *Client) Create(context context.Context, request *CreateRequest) (*CreateResult, error)

func (*Client) Delete

func (c *Client) Delete(context context.Context, request *DeleteRequest) (*DeleteResult, error)

func (*Client) DeleteSavedSearch

func (c *Client) DeleteSavedSearch(context context.Context, request *DeleteSavedSearchRequest) (*DeleteSavedSearchResult, error)

func (*Client) Get

func (c *Client) Get(context context.Context, request *GetRequest) (*GetResult, error)

func (*Client) GetSavedSearch

func (c *Client) GetSavedSearch(context context.Context, request *GetSavedSearchRequest) (*GetSavedSearchResult, error)

func (*Client) List

func (c *Client) List(context context.Context, request *ListRequest) (*ListResult, error)

func (*Client) ListSavedSearches

func (c *Client) ListSavedSearches(context context.Context, request *ListSavedSearchesRequest) (*ListSavedSearchesResult, error)

func (*Client) ListUserEscalations

func (c *Client) ListUserEscalations(context context.Context, request *ListUserEscalationsRequest) (*ListUserEscalationsResult, error)

func (*Client) ListUserForwardingRules

func (c *Client) ListUserForwardingRules(context context.Context, request *ListUserForwardingRulesRequest) (*ListUserForwardingRulesResult, error)

func (*Client) ListUserSchedules

func (c *Client) ListUserSchedules(context context.Context, request *ListUserSchedulesRequest) (*ListUserSchedulesResult, error)

func (*Client) ListUserTeams

func (c *Client) ListUserTeams(context context.Context, request *ListUserTeamsRequest) (*ListUserTeamsResult, error)

func (*Client) Update

func (c *Client) Update(context context.Context, request *UpdateRequest) (*UpdateResult, error)

type CreateRequest

type CreateRequest struct {
	client.BaseRequest
	Username           string              `json:"username"`
	FullName           string              `json:"fullName"`
	Role               *UserRoleRequest    `json:"role"`
	SkypeUsername      string              `json:"skypeUsername,omitempty"`
	UserAddressRequest *UserAddressRequest `json:"userAddress,omitempty"`
	Tags               []string            `json:"tags,omitempty"`
	Details            map[string][]string `json:"details,omitempty"`
	TimeZone           string              `json:"timeZone,omitempty"`
	Locale             string              `json:"locale,omitempty"`
	InvitationDisabled string              `json:"invitationDisabled,omitempty"`
}

func (*CreateRequest) Method

func (r *CreateRequest) Method() string

func (*CreateRequest) ResourcePath

func (r *CreateRequest) ResourcePath() string

func (*CreateRequest) Validate

func (r *CreateRequest) Validate() error

type CreateResult

type CreateResult struct {
	client.ResultMetadata
	Message string            `json:"message"`
	Errors  map[string]string `json:"errors"`
	Id      string            `json:"id"`
	Name    string            `json:"name"`
}

type DeleteRequest

type DeleteRequest struct {
	client.BaseRequest
	Identifier string
}

func (*DeleteRequest) Method

func (r *DeleteRequest) Method() string

func (*DeleteRequest) ResourcePath

func (r *DeleteRequest) ResourcePath() string

func (*DeleteRequest) Validate

func (r *DeleteRequest) Validate() error

type DeleteResult

type DeleteResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type DeleteSavedSearchRequest

type DeleteSavedSearchRequest struct {
	client.BaseRequest
	Identifier     string
	IdentifierType Identifier
}

func (*DeleteSavedSearchRequest) Method

func (r *DeleteSavedSearchRequest) Method() string

func (*DeleteSavedSearchRequest) RequestParams

func (r *DeleteSavedSearchRequest) RequestParams() map[string]string

func (*DeleteSavedSearchRequest) ResourcePath

func (r *DeleteSavedSearchRequest) ResourcePath() string

func (*DeleteSavedSearchRequest) Validate

func (r *DeleteSavedSearchRequest) Validate() error

type DeleteSavedSearchResult

type DeleteSavedSearchResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type EscalationDelay

type EscalationDelay struct {
	TimeUnit   og.TimeUnit `json:"timeUnit"`
	TimeAmount int         `json:"timeAmount"`
}

type ForwardedUser

type ForwardedUser struct {
	Id       string `json:"id"`
	Username string `json:"username"`
}

type ForwardingRule

type ForwardingRule struct {
	FromUser  ForwardedUser `json:"fromUser"`
	ToUser    ForwardedUser `json:"toUser"`
	StartDate time.Time     `json:"startDate"`
	EndDate   time.Time     `json:"endDate"`
	Alias     string        `json:"alias"`
	Id        string        `json:"id"`
}

type GetRequest

type GetRequest struct {
	client.BaseRequest
	Identifier string
	Expand     string
}

func (*GetRequest) Method

func (r *GetRequest) Method() string

func (*GetRequest) RequestParams

func (r *GetRequest) RequestParams() map[string]string

func (*GetRequest) ResourcePath

func (r *GetRequest) ResourcePath() string

func (*GetRequest) Validate

func (r *GetRequest) Validate() error

type GetResult

type GetResult struct {
	client.ResultMetadata
	Id            string              `json:"id"`
	Username      string              `json:"username"`
	FullName      string              `json:"fullName"`
	Role          *UserRole           `json:"role"`
	Blocked       bool                `json:"blocked"`
	Verified      bool                `json:"verified"`
	UserAddress   *UserAddress        `json:"userAddress"`
	SkypeUsername string              `json:"skypeUsername"`
	Tags          []string            `json:"tags"`
	Details       map[string][]string `json:"details"`
	TimeZone      string              `json:"timeZone"`
	Locale        string              `json:"locale"`
	CreatedAt     time.Time           `json:"createdAt"`
	UserContacts  []UserContact       `json:"userContacts"`
}

type GetSavedSearchRequest

type GetSavedSearchRequest struct {
	client.BaseRequest
	Identifier     string
	IdentifierType Identifier
}

func (*GetSavedSearchRequest) Method

func (r *GetSavedSearchRequest) Method() string

func (*GetSavedSearchRequest) RequestParams

func (r *GetSavedSearchRequest) RequestParams() map[string]string

func (*GetSavedSearchRequest) ResourcePath

func (r *GetSavedSearchRequest) ResourcePath() string

func (*GetSavedSearchRequest) Validate

func (r *GetSavedSearchRequest) Validate() error

type GetSavedSearchResult

type GetSavedSearchResult struct {
	client.ResultMetadata
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	OwnerId     string `json:"ownerId"`
	Query       string `json:"query"`
}

type Identifier

type Identifier uint32

type ListRequest

type ListRequest struct {
	client.BaseRequest
	Limit  int
	Offset int
	Sort   SortField
	Order  Order
	Query  string
}

func (*ListRequest) Method

func (r *ListRequest) Method() string

func (*ListRequest) RequestParams

func (r *ListRequest) RequestParams() map[string]string

func (*ListRequest) ResourcePath

func (r *ListRequest) ResourcePath() string

func (*ListRequest) Validate

func (r *ListRequest) Validate() error

type ListResult

type ListResult struct {
	client.ResultMetadata
	Users      []User `json:"data"`
	Paging     Paging `json:"paging"`
	TotalCount int    `json:"totalCount"`
}

type ListSavedSearchesRequest

type ListSavedSearchesRequest struct {
	client.BaseRequest
}

func (*ListSavedSearchesRequest) Method

func (r *ListSavedSearchesRequest) Method() string

func (*ListSavedSearchesRequest) ResourcePath

func (r *ListSavedSearchesRequest) ResourcePath() string

func (*ListSavedSearchesRequest) Validate

func (r *ListSavedSearchesRequest) Validate() error

type ListSavedSearchesResult

type ListSavedSearchesResult struct {
	client.ResultMetadata
	UsersSavedSearches []UsersSavedSearch `json:"data"`
}

type ListUserEscalationsRequest

type ListUserEscalationsRequest struct {
	client.BaseRequest
	Identifier string
}

func (*ListUserEscalationsRequest) Method

func (r *ListUserEscalationsRequest) Method() string

func (*ListUserEscalationsRequest) ResourcePath

func (r *ListUserEscalationsRequest) ResourcePath() string

func (*ListUserEscalationsRequest) Validate

func (r *ListUserEscalationsRequest) Validate() error

type ListUserEscalationsResult

type ListUserEscalationsResult struct {
	client.ResultMetadata
	Escalations []UserEscalation `json:"data"`
}

type ListUserForwardingRulesRequest

type ListUserForwardingRulesRequest struct {
	client.BaseRequest
	Identifier string
}

func (*ListUserForwardingRulesRequest) Method

func (*ListUserForwardingRulesRequest) ResourcePath

func (r *ListUserForwardingRulesRequest) ResourcePath() string

func (*ListUserForwardingRulesRequest) Validate

func (r *ListUserForwardingRulesRequest) Validate() error

type ListUserForwardingRulesResult

type ListUserForwardingRulesResult struct {
	client.ResultMetadata
	ForwardingRules []ForwardingRule `json:"data"`
}

type ListUserSchedulesRequest

type ListUserSchedulesRequest struct {
	client.BaseRequest
	Identifier string
}

func (*ListUserSchedulesRequest) Method

func (r *ListUserSchedulesRequest) Method() string

func (*ListUserSchedulesRequest) ResourcePath

func (r *ListUserSchedulesRequest) ResourcePath() string

func (*ListUserSchedulesRequest) Validate

func (r *ListUserSchedulesRequest) Validate() error

type ListUserSchedulesResult

type ListUserSchedulesResult struct {
	client.ResultMetadata
	Schedules []Schedule `json:"data"`
}

type ListUserTeamsRequest

type ListUserTeamsRequest struct {
	client.BaseRequest
	Identifier string
}

func (*ListUserTeamsRequest) Method

func (r *ListUserTeamsRequest) Method() string

func (*ListUserTeamsRequest) ResourcePath

func (r *ListUserTeamsRequest) ResourcePath() string

func (*ListUserTeamsRequest) Validate

func (r *ListUserTeamsRequest) Validate() error

type ListUserTeamsResult

type ListUserTeamsResult struct {
	client.ResultMetadata
	Teams []Team `json:"data"`
}

type Order

type Order string

type Paging

type Paging struct {
	Next  string `json:"next"`
	Prev  string `json:"prev"`
	First string `json:"first"`
	Last  string `json:"last"`
}

type Rule

type Rule struct {
	Condition  og.EscalationCondition `json:"condition"`
	NotifyType og.NotifyType          `json:"notifyType"`
	Recipient  og.Participant         `json:"recipient"`
	Delay      EscalationDelay        `json:"delay"`
}

type Schedule

type Schedule struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
}

type SortField

type SortField string

type Team

type Team struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type UpdateRequest

type UpdateRequest struct {
	client.BaseRequest
	Identifier         string
	Username           string              `json:"username,omitempty"`
	FullName           string              `json:"fullName,omitempty"`
	Role               *UserRoleRequest    `json:"role,omitempty"`
	SkypeUsername      string              `json:"skypeUsername,omitempty"`
	UserAddressRequest *UserAddressRequest `json:"userAddress,omitempty"`
	Tags               []string            `json:"tags,omitempty"`
	Details            map[string][]string `json:"details,omitempty"`
	TimeZone           string              `json:"timeZone,omitempty"`
	Locale             string              `json:"locale,omitempty"`
	InvitationDisabled string              `json:"invitationDisabled,omitempty"`
}

func (*UpdateRequest) Method

func (r *UpdateRequest) Method() string

func (*UpdateRequest) ResourcePath

func (r *UpdateRequest) ResourcePath() string

func (*UpdateRequest) Validate

func (r *UpdateRequest) Validate() error

type UpdateResult

type UpdateResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type User

type User struct {
	Id          string              `json:"id"`
	Username    string              `json:"username"`
	FullName    string              `json:"fullName"`
	Role        *UserRole           `json:"role"`
	Blocked     bool                `json:"blocked"`
	Verified    bool                `json:"verified"`
	UserAddress *UserAddress        `json:"userAddress"`
	Tags        []string            `json:"tags"`
	Details     map[string][]string `json:"details"`
	TimeZone    string              `json:"timeZone"`
	Locale      string              `json:"locale"`
	CreatedAt   time.Time           `json:"createdAt"`
}

type UserAddress

type UserAddress struct {
	Country string `json:"country"`
	State   string `json:"state"`
	City    string `json:"city"`
	Line    string `json:"line"`
	ZipCode string `json:"zipCode"`
}

type UserAddressRequest

type UserAddressRequest struct {
	Country string `json:"country,omitempty"`
	State   string `json:"state,omitempty"`
	City    string `json:"city,omitempty"`
	Line    string `json:"line,omitempty"`
	ZipCode string `json:"zipCode,omitempty"`
}

type UserContact

type UserContact struct {
	To            string `json:"to"`
	Id            string `json:"id"`
	ContactMethod string `json:"contactMethod"`
	Enabled       bool   `json:"enabled"`
}

type UserEscalation

type UserEscalation struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Rules       []Rule `json:"rules"`
	OwnerTeam   Team   `json:"ownerTeam"`
}

type UserRole

type UserRole struct {
	RoleName string `json:"name"`
}

type UserRoleRequest

type UserRoleRequest struct {
	RoleName string `json:"name"`
}

type UsersSavedSearch

type UsersSavedSearch struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL