Documentation
¶
Index ¶
- Variables
- type Attachment
- type AttachmentNotFoundError
- type Author
- type AuthorType
- type CreateReplyRequest
- type CreateRequestRequest
- type GetReplyResponseBody
- type GetReplySliceResponseBody
- type GetRequestResponseBody
- type GetRequestSliceResponseBody
- type PSSService
- type PaginatedReply
- type PaginatedRequest
- type PatchRequestRequest
- type Product
- type Reply
- type ReplyNotFoundError
- type Request
- type RequestNotFoundError
- type RequestPriority
- type RequestStatus
- type Service
- func (s *Service) CreateRequest(req CreateRequestRequest) (int, error)
- func (s *Service) CreateRequestReply(requestID int, req CreateReplyRequest) (string, error)
- func (s *Service) DeleteReplyAttachment(replyID string, attachmentName string) error
- func (s *Service) DownloadReplyAttachmentStream(replyID string, attachmentName string) (contentStream io.ReadCloser, err error)
- func (s *Service) GetReply(replyID string) (Reply, error)
- func (s *Service) GetRequest(requestID int) (Request, error)
- func (s *Service) GetRequestConversation(solutionID int, parameters connection.APIRequestParameters) ([]Reply, error)
- func (s *Service) GetRequestConversationPaginated(solutionID int, parameters connection.APIRequestParameters) (*PaginatedReply, error)
- func (s *Service) GetRequestReplies(solutionID int, parameters connection.APIRequestParameters) ([]Reply, error)
- func (s *Service) GetRequestRepliesPaginated(solutionID int, parameters connection.APIRequestParameters) (*PaginatedReply, error)
- func (s *Service) GetRequests(parameters connection.APIRequestParameters) ([]Request, error)
- func (s *Service) GetRequestsPaginated(parameters connection.APIRequestParameters) (*PaginatedRequest, error)
- func (s *Service) PatchRequest(requestID int, req PatchRequestRequest) error
- func (s *Service) UploadReplyAttachmentStream(replyID string, attachmentName string, stream io.Reader) (err error)
Constants ¶
This section is empty.
Variables ¶
var AuthorTypeEnum connection.EnumSlice = []connection.Enum{AuthorTypeClient, AuthorTypeAuto, AuthorTypeSupport}
var RequestPriorityEnum connection.EnumSlice = []connection.Enum{RequestPriorityNormal, RequestPriorityHigh, RequestPriorityCritical}
var RequestStatusEnum connection.EnumSlice = []connection.Enum{ RequestStatusCompleted, RequestStatusAwaitingCustomerResponse, RequestStatusRepliedAndCompleted, RequestStatusSubmitted, }
Functions ¶
This section is empty.
Types ¶
type Attachment ¶ added in v1.1.1
type Attachment struct {
Name string `json:"name"`
}
Attachment represents a PSS attachment
type AttachmentNotFoundError ¶ added in v1.1.2
type AttachmentNotFoundError struct {
Name string
}
AttachmentNotFoundError indicates a attachment was not found
func (*AttachmentNotFoundError) Error ¶ added in v1.1.2
func (e *AttachmentNotFoundError) Error() string
type Author ¶
type Author struct { ID int `json:"id"` Name string `json:"name"` Type AuthorType `json:"type"` }
Author represents a PSS request author
type AuthorType ¶
type AuthorType string
const ( AuthorTypeClient AuthorType = "Client" AuthorTypeAuto AuthorType = "Auto" AuthorTypeSupport AuthorType = "Support" )
func ParseAuthorType ¶ added in v1.1.5
func ParseAuthorType(s string) (AuthorType, error)
ParseAuthorType attempts to parse a AuthorType from string
func (AuthorType) String ¶
func (s AuthorType) String() string
type CreateReplyRequest ¶ added in v1.1.3
type CreateReplyRequest struct { connection.APIRequestBodyDefaultValidator Author Author `json:"author" validate:"required"` Description string `json:"description" validate:"required"` }
CreateReplyRequest represents a request to create a PSS request reply
func (*CreateReplyRequest) Validate ¶ added in v1.1.3
func (c *CreateReplyRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateRequestRequest ¶ added in v1.1.3
type CreateRequestRequest struct { connection.APIRequestBodyDefaultValidator Author Author `json:"author" validate:"required"` Secure bool `json:"secure"` Priority RequestPriority `json:"priority" validate:"required"` Subject string `json:"subject" validate:"required"` Details string `json:"details" validate:"required"` CC []string `json:"cc,omitempty"` RequestSMS bool `json:"request_sms"` CustomerReference string `json:"customer_reference,omitempty"` Product *Product `json:"product,omitempty"` }
CreateRequestRequest represents a request to create a PSS request
func (*CreateRequestRequest) Validate ¶ added in v1.1.3
func (c *CreateRequestRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type GetReplyResponseBody ¶ added in v1.1.0
type GetReplyResponseBody struct { connection.APIResponseBody Data Reply `json:"data"` }
GetReplyResponseBody represents an API response body containing Reply data
type GetReplySliceResponseBody ¶ added in v1.3.17
type GetReplySliceResponseBody struct { connection.APIResponseBody Data []Reply `json:"data"` }
GetReplySliceResponseBody represents an API response body containing []Reply data
type GetRequestResponseBody ¶
type GetRequestResponseBody struct { connection.APIResponseBody Data Request `json:"data"` }
GetRequestResponseBody represents an API response body containing Request data
type GetRequestSliceResponseBody ¶ added in v1.3.17
type GetRequestSliceResponseBody struct { connection.APIResponseBody Data []Request `json:"data"` }
GetRequestSliceResponseBody represents an API response body containing []Request data
type PSSService ¶
type PSSService interface { CreateRequest(req CreateRequestRequest) (int, error) GetRequests(parameters connection.APIRequestParameters) ([]Request, error) GetRequestsPaginated(parameters connection.APIRequestParameters) (*PaginatedRequest, error) GetRequest(requestID int) (Request, error) PatchRequest(requestID int, req PatchRequestRequest) error CreateRequestReply(requestID int, req CreateReplyRequest) (string, error) GetRequestReplies(solutionID int, parameters connection.APIRequestParameters) ([]Reply, error) GetRequestRepliesPaginated(solutionID int, parameters connection.APIRequestParameters) (*PaginatedReply, error) GetRequestConversation(requestID int, parameters connection.APIRequestParameters) ([]Reply, error) GetRequestConversationPaginated(requestID int, parameters connection.APIRequestParameters) (*PaginatedReply, error) GetReply(replyID string) (Reply, error) DownloadReplyAttachmentStream(replyID string, attachmentName string) (contentStream io.ReadCloser, err error) UploadReplyAttachmentStream(replyID string, attachmentName string, fileStream io.Reader) (err error) DeleteReplyAttachment(replyID string, attachmentName string) error }
PSSService is an interface for managing PSS
type PaginatedReply ¶ added in v1.1.0
type PaginatedReply struct { *connection.PaginatedBase Items []Reply }
PaginatedReply represents a paginated collection of Reply
func NewPaginatedReply ¶ added in v1.1.0
func NewPaginatedReply(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Reply) *PaginatedReply
NewPaginatedReply returns a pointer to an initialized PaginatedReply struct
type PaginatedRequest ¶ added in v1.1.0
type PaginatedRequest struct { *connection.PaginatedBase Items []Request }
PaginatedRequest represents a paginated collection of Request
func NewPaginatedRequest ¶ added in v1.1.0
func NewPaginatedRequest(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Request) *PaginatedRequest
NewPaginatedRequest returns a pointer to an initialized PaginatedRequest struct
type PatchRequestRequest ¶ added in v1.1.3
type PatchRequestRequest struct { Secure *bool `json:"secure,omitempty"` Read *bool `json:"read,omitempty"` Priority RequestPriority `json:"priority,omitempty"` Status RequestStatus `json:"status,omitempty"` RequestSMS *bool `json:"request_sms,omitempty"` Archived *bool `json:"archived,omitempty"` }
PatchRequestRequest represents a PSS Request patch request
type Reply ¶
type Reply struct { ID string `json:"id"` Author Author `json:"author"` Description string `json:"description"` CreatedAt connection.DateTime `json:"created_at"` Attachments []Attachment `json:"attachments"` }
Reply represents a PSS reply +genie:model_response +genie:model_paginated
type ReplyNotFoundError ¶ added in v1.1.0
type ReplyNotFoundError struct {
ID string
}
ReplyNotFoundError indicates a reply was not found
func (*ReplyNotFoundError) Error ¶ added in v1.1.0
func (e *ReplyNotFoundError) Error() string
type Request ¶
type Request struct { ID int `json:"id"` Author Author `json:"author"` Type string `json:"type"` Secure bool `json:"secure"` Subject string `json:"subject"` CreatedAt connection.DateTime `json:"created_at"` Priority RequestPriority `json:"priority"` Archived bool `json:"archived"` Status RequestStatus `json:"status"` RequestSMS bool `json:"request_sms"` Version int `json:"version"` CustomerReference string `json:"customer_reference"` Product Product `json:"product"` LastRepliedAt connection.DateTime `json:"last_replied_at"` }
Request represents a PSS request +genie:model_response +genie:model_paginated
type RequestNotFoundError ¶
type RequestNotFoundError struct {
ID int
}
RequestNotFoundError indicates a request was not found
func (*RequestNotFoundError) Error ¶
func (e *RequestNotFoundError) Error() string
type RequestPriority ¶
type RequestPriority string
const ( RequestPriorityNormal RequestPriority = "Normal" RequestPriorityHigh RequestPriority = "High" RequestPriorityCritical RequestPriority = "Critical" )
func ParseRequestPriority ¶ added in v1.1.4
func ParseRequestPriority(s string) (RequestPriority, error)
ParseRequestPriority attempts to parse a RequestPriority from string
func (RequestPriority) String ¶
func (s RequestPriority) String() string
type RequestStatus ¶
type RequestStatus string
const ( RequestStatusCompleted RequestStatus = "Completed" RequestStatusAwaitingCustomerResponse RequestStatus = "Awaiting Customer Response" RequestStatusRepliedAndCompleted RequestStatus = "Replied and Completed" RequestStatusSubmitted RequestStatus = "Submitted" )
func ParseRequestStatus ¶ added in v1.3.36
func ParseRequestStatus(s string) (RequestStatus, error)
ParseRequestStatus attempts to parse a RequestStatus from string
func (RequestStatus) String ¶
func (s RequestStatus) String() string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements PSSService for managing PSS via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of PSSService
func (*Service) CreateRequest ¶ added in v1.1.3
func (s *Service) CreateRequest(req CreateRequestRequest) (int, error)
CreateRequest creates a new request
func (*Service) CreateRequestReply ¶ added in v1.1.3
func (s *Service) CreateRequestReply(requestID int, req CreateReplyRequest) (string, error)
CreateRequestReply creates a new request reply
func (*Service) DeleteReplyAttachment ¶ added in v1.1.2
DeleteReplyAttachment removes a reply attachment
func (*Service) DownloadReplyAttachmentStream ¶ added in v1.1.2
func (s *Service) DownloadReplyAttachmentStream(replyID string, attachmentName string) (contentStream io.ReadCloser, err error)
DownloadReplyAttachmentStream downloads the provided attachment, returning a stream of the file contents and an error
func (*Service) GetRequest ¶
GetRequest retrieves a single request by id
func (*Service) GetRequestConversation ¶
func (s *Service) GetRequestConversation(solutionID int, parameters connection.APIRequestParameters) ([]Reply, error)
GetRequestConversation retrieves a list of replies
func (*Service) GetRequestConversationPaginated ¶ added in v1.0.15
func (s *Service) GetRequestConversationPaginated(solutionID int, parameters connection.APIRequestParameters) (*PaginatedReply, error)
GetRequestConversationPaginated retrieves a paginated list of domains
func (*Service) GetRequestReplies ¶ added in v1.1.1
func (s *Service) GetRequestReplies(solutionID int, parameters connection.APIRequestParameters) ([]Reply, error)
GetRequestReplies is an alias for GetRequestConversation
func (*Service) GetRequestRepliesPaginated ¶ added in v1.1.1
func (s *Service) GetRequestRepliesPaginated(solutionID int, parameters connection.APIRequestParameters) (*PaginatedReply, error)
GetRequestRepliesPaginated is an alias for GetRequestConversationPaginated
func (*Service) GetRequests ¶
func (s *Service) GetRequests(parameters connection.APIRequestParameters) ([]Request, error)
GetRequests retrieves a list of requests
func (*Service) GetRequestsPaginated ¶
func (s *Service) GetRequestsPaginated(parameters connection.APIRequestParameters) (*PaginatedRequest, error)
GetRequestsPaginated retrieves a paginated list of requests
func (*Service) PatchRequest ¶ added in v1.1.3
func (s *Service) PatchRequest(requestID int, req PatchRequestRequest) error
PatchRequest patches a request