Documentation ¶
Index ¶
- Constants
- type ActionResult
- type ContactMethod
- type CreateUserRequest
- type CreateUserResponse
- type Delay
- type DeleteUserRequest
- type DeleteUserResponse
- type Escalation
- type Expand
- type ForwardingRule
- type GetUserRequest
- type GetUserResponse
- type Identifier
- type ListUserEscalationsRequest
- type ListUserEscalationsResponse
- type ListUserForwardingRulesRequest
- type ListUserForwardingRulesResponse
- type ListUserSchedulesRequest
- type ListUserSchedulesResponse
- type ListUserTeamsRequest
- type ListUserTeamsResponse
- type ListUsersRequest
- type ListUsersResponse
- type Order
- type OwnerTeam
- type Recipient
- type ResponseMeta
- type Result
- type Rule
- type Schedule
- type Sort
- type Team
- type UpdateUserRequest
- type UpdateUserResponse
- type User
- type UserAddress
- type UserContact
- type UserMeta
- type UserRole
Constants ¶
const ( // OwnerRoleId is the text value of standard role "owner" OwnerRoleId = "Owner" // AdminRole is the text value of standard role "admin" AdminRoleId = "Admin" // UserRoleId is the text value of standard role "user" UserRoleId = "User" // StakeHolderRoleId is the text value of standard role "user" StakeHolderRoleId = "Stakeholder" // ObserverRoleId is the text value of standard role "user" ObserverRoleId = "Observer" )
const (
// ContactExpandableField is the query parameter, which is needed to load fully contact data of user.
ContactExpandableField = "contact"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionResult ¶
type ActionResult struct {
Result Result `json:"result"`
}
ActionResult contains result of action with notification rule.
type ContactMethod ¶
type ContactMethod string
ContactMethod is a type of user contact method.
const ( // The list of notification methods. SMSContactMethod ContactMethod = "sms" EmailContactMethod ContactMethod = "email" VoiceContactMethod ContactMethod = "voice" MobileContactMethod ContactMethod = "mobile" )
type CreateUserRequest ¶
type CreateUserRequest struct { UserName string `json:"username,omitempty"` FullName string `json:"fullName,omitempty"` Role *UserRole `json:"role,omitempty"` SkypeUsername string `json:"skypeUsername,omitempty"` UserAddress UserAddress `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"` DisableInvitation bool `json:"invitationDisabled,omitempty"` ApiKey string `json:"-"` }
CreateUserRequest is a request for creating new user.
func (*CreateUserRequest) GenerateUrl ¶
func (r *CreateUserRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates url to API endpoint.
func (*CreateUserRequest) GetApiKey ¶
func (r *CreateUserRequest) GetApiKey() string
GetApiKey returns api key.
type CreateUserResponse ¶
type CreateUserResponse struct { User UserMeta `json:"data"` ResponseMeta }
CreateUserResponse is a response of creating user result.
type Delay ¶
type Delay struct { TimeAmount int `json:"timeAmount,omitempty"` TimeUnit string `json:"timeUnit,omitempty"` }
Delay contains info about delaying alerts.
type DeleteUserRequest ¶
type DeleteUserRequest struct { *Identifier ApiKey string }
DeleteUserRequest is a request for deleting user.
func (*DeleteUserRequest) GenerateUrl ¶
func (r *DeleteUserRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates url to API endpoint.
func (*DeleteUserRequest) GetApiKey ¶
func (r *DeleteUserRequest) GetApiKey() string
GetApiKey returns api key.
type DeleteUserResponse ¶
type DeleteUserResponse struct { ResponseMeta ActionResult }
DeleteUserResponse is a response of deleting user result.
type Escalation ¶
type Escalation struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` OwnerTeam OwnerTeam `json:"ownerTeam,omitempty"` Rules []Rule `json:"rules,omitempty"` }
Escalation is a struct of escalation.
type Expand ¶
type Expand string
Expand is a type of expand user data, which is used for loading fully data of user.
type ForwardingRule ¶
type ForwardingRule struct { ID string `json:"id,omitempty"` Alias string `json:"alias,omitempty"` FromUser UserMeta `json:"fromUser,omitempty"` ToUser UserMeta `json:"toUser,omitempty"` StartDate time.Time `json:"startDate,omitempty"` EndDate time.Time `json:"endDate,omitempty"` }
ForwardingRule contains data of forwarding rule.
type GetUserRequest ¶
type GetUserRequest struct { *Identifier ApiKey string ExpandContact bool }
GetUserRequest is a request for getting user.
func (*GetUserRequest) GenerateUrl ¶
func (request *GetUserRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
func (*GetUserRequest) GetApiKey ¶
func (r *GetUserRequest) GetApiKey() string
GetApiKey returns api key.
type GetUserResponse ¶
type GetUserResponse struct { User User `json:"data"` ResponseMeta }
GetUserResponse is a response of getting user result.
type Identifier ¶
Identifier defined the set of attributes for identification user.
func (*Identifier) GenerateUrl ¶
func (request *Identifier) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
type ListUserEscalationsRequest ¶
type ListUserEscalationsRequest struct { *Identifier ApiKey string }
ListUserEscalationsRequest is a request for getting user escalation list.
func (*ListUserEscalationsRequest) GenerateUrl ¶
func (r *ListUserEscalationsRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
func (*ListUserEscalationsRequest) GetApiKey ¶
func (r *ListUserEscalationsRequest) GetApiKey() string
GetApiKey returns api key.
type ListUserEscalationsResponse ¶
type ListUserEscalationsResponse struct { Escalations []Escalation `json:"data,omitempty"` ResponseMeta }
ListUserEscalationsResponse is a response with list of user escalations.
type ListUserForwardingRulesRequest ¶
type ListUserForwardingRulesRequest struct { *Identifier ApiKey string }
ListUserForwardingRulesRequest is a request for getting list of forwarding rules.
func (*ListUserForwardingRulesRequest) GenerateUrl ¶
func (r *ListUserForwardingRulesRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
func (*ListUserForwardingRulesRequest) GetApiKey ¶
func (r *ListUserForwardingRulesRequest) GetApiKey() string
GetApiKey returns api key.
type ListUserForwardingRulesResponse ¶
type ListUserForwardingRulesResponse struct { ForwardingRules []ForwardingRule `json:"data,omitempty"` ResponseMeta }
ListUserForwardingRulesResponse is a response with list of forwarding rules.
type ListUserSchedulesRequest ¶
type ListUserSchedulesRequest struct { *Identifier ApiKey string }
ListUserSchedulesRequest is a request for getting list of user schedules.
func (*ListUserSchedulesRequest) GenerateUrl ¶
func (r *ListUserSchedulesRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
func (*ListUserSchedulesRequest) GetApiKey ¶
func (r *ListUserSchedulesRequest) GetApiKey() string
GetApiKey returns api key.
type ListUserSchedulesResponse ¶
type ListUserSchedulesResponse struct { Schedules []Schedule `json:"data,omitempty"` ResponseMeta }
ListUserSchedulesResponse is a response with list of user schedules.
type ListUserTeamsRequest ¶
type ListUserTeamsRequest struct { *Identifier ApiKey string }
ListUserTeamsRequest is a request for getting list of user teams.
func (*ListUserTeamsRequest) GenerateUrl ¶
func (r *ListUserTeamsRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url using specified attributes of identifier.
func (*ListUserTeamsRequest) GetApiKey ¶
func (r *ListUserTeamsRequest) GetApiKey() string
GetApiKey returns api key.
type ListUserTeamsResponse ¶
type ListUserTeamsResponse struct { Teams []Team `json:"data"` ResponseMeta }
ListUserTeamsResponse is a response with list of user teams.
type ListUsersRequest ¶
type ListUsersRequest struct { Limit int Offset int Sort Sort Order Order Query string ApiKey string }
ListUsersRequest is a request for getting user list.
func (*ListUsersRequest) GenerateUrl ¶
func (r *ListUsersRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates API url for getting user list.
func (*ListUsersRequest) GetApiKey ¶
func (r *ListUsersRequest) GetApiKey() string
GetApiKey returns api key.
type ListUsersResponse ¶
type ListUsersResponse struct { Users []User `json:"data"` *ResponseMeta }
ListUsersResponse is a response with list of users.
type Recipient ¶
type Recipient struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` }
Recipient contains info about recipient of alerts.
type ResponseMeta ¶
ResponseMeta is a struct of meta data.
func (*ResponseMeta) SetRateLimitState ¶
func (rm *ResponseMeta) SetRateLimitState(state string)
SetRateLimitState sets state of rate limit.
func (*ResponseMeta) SetRequestID ¶
func (rm *ResponseMeta) SetRequestID(requestID string)
SetRequestID sets identifier of request.
func (*ResponseMeta) SetResponseTime ¶
func (rm *ResponseMeta) SetResponseTime(responseTime float32)
SetResponseTime sets response time.
type Rule ¶
type Rule struct { Condition string `json:"condition,omitempty"` NotifyType string `json:"notifyType,omitempty"` Delay Delay `json:"delay,omitempty"` Recipient Recipient `json:"recipient,omitempty"` }
Rule is a rule of escalation.
type Schedule ¶
type Schedule struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Enabled bool `json:"enabled,omitempty"` }
Schedule contains data of schedule.
type UpdateUserRequest ¶
type UpdateUserRequest struct { *Identifier Username string `json:"username,omitempty"` FullName string `json:"fullName,omitempty"` Role UserRole `json:"role,omitempty"` SkypeUsername string `json:"skypeUsername,omitempty"` UserAddress UserAddress `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"` DisableInvitation bool `json:"invitationDisabled,omitempty"` ApiKey string `json:"-"` }
UpdateUserRequest is a request for updating user.
func (*UpdateUserRequest) GenerateUrl ¶
func (r *UpdateUserRequest) GenerateUrl() (string, url.Values, error)
GenerateUrl generates url to API endpoint.
func (*UpdateUserRequest) GetApiKey ¶
func (r *UpdateUserRequest) GetApiKey() string
GetApiKey returns api key.
type UpdateUserResponse ¶
type UpdateUserResponse struct {
ResponseMeta
}
UpdateUserResponse is response with status of updating user.
type User ¶
type User struct { ID string `json:"id,omitempty"` Blocked bool `json:"blocked,omitempty"` Verified bool `json:"verified,omitempty"` Username string `json:"username,omitempty"` FullName string `json:"fullName,omitempty"` Role UserRole `json:"role,omitempty"` TimeZone string `json:"timeZone,omitempty"` Locale string `json:"locale,omitempty"` UserAddress UserAddress `json:"userAddress,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` MutedUntil time.Time `json:"mutedUntil,omitempty"` Details map[string][]string `json:"details,omitempty"` Tags []string `json:"tags,omitempty"` UserContacts []UserContact `json:"userContacts,omitempty"` }
User contains user data.
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"` }
UserAddress contains data user user address.
type UserContact ¶
type UserContact struct { ID string `json:"id"` To string `json:"to"` ContactMethod ContactMethod `json:"contactMethod"` DisabledReason string `json:"disabledReason"` Enabled bool `json:"enabled"` }
UserContact contains data of user contact.
Source Files ¶
- action_result.go
- contact_method.go
- create_user_request.go
- create_user_response.go
- delete_user_request.go
- delete_user_response.go
- escalation.go
- expand.go
- get_user_request.go
- get_user_response.go
- identifier.go
- list_user_escalations_request.go
- list_user_escalations_response.go
- list_user_forwarding_rules_request.go
- list_user_forwarding_rules_response.go
- list_user_schedules_request.go
- list_user_schedules_response.go
- list_user_teams_request.go
- list_user_teams_response.go
- list_users_request.go
- list_users_response.go
- order.go
- response_meta.go
- sort.go
- team.go
- update_user_request.go
- update_user_response.go
- user.go
- user_address.go
- user_contact.go
- user_meta.go
- user_role.go