Documentation
¶
Index ¶
- type APIClient
- func (c *APIClient) Close() error
- func (c *APIClient) CreateAttachment(ctx context.Context, filePath string) (map[string]interface{}, error)
- func (c *APIClient) CreateCase(ctx context.Context, caseData *Case, headers ...CaseHeaders) (*Case, error)
- func (c *APIClient) EmailMessage(ctx context.Context, params EmailMessageParams) (map[string]interface{}, error)
- func (c *APIClient) GetCase(ctx context.Context, caseID string) (*Case, error)
- func (c *APIClient) GetCaseID() string
- func (c *APIClient) Query(ctx context.Context, soql string) (*QueryResponse, error)
- func (c *APIClient) Request(ctx context.Context, path, method string, data interface{}, ...) (*Response, error)
- func (c *APIClient) SetCaseID(caseID string)
- func (c *APIClient) UploadAttachment(ctx context.Context, parentID, filePath string) (map[string]interface{}, error)
- type AttachmentResponse
- type AuthConfig
- type AuthError
- type AuthResponse
- type Case
- type CaseHeaders
- type EmailMessageParams
- type ErrorResponse
- type Logger
- type QueryResponse
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient main client
func NewAPIClient ¶
func NewAPIClient(authConfig *AuthConfig) *APIClient
NewAPIClient creates a new client instance
func (*APIClient) CreateAttachment ¶
func (c *APIClient) CreateAttachment(ctx context.Context, filePath string) (map[string]interface{}, error)
CreateAttachment creates an attachment for a case
func (*APIClient) CreateCase ¶
func (c *APIClient) CreateCase(ctx context.Context, caseData *Case, headers ...CaseHeaders) (*Case, error)
CreateCase creates a new case with support for custom headers
func (*APIClient) EmailMessage ¶
func (c *APIClient) EmailMessage(ctx context.Context, params EmailMessageParams) (map[string]interface{}, error)
EmailMessage creates a new email message
type AttachmentResponse ¶
type AttachmentResponse struct {
ID string `json:"id"`
Success bool `json:"success"`
Errors []struct {
Message string `json:"message"`
ErrorCode string `json:"errorCode"`
} `json:"errors"`
}
AttachmentResponse model for Attachment API response
type AuthConfig ¶
type AuthConfig struct {
ClientID string
ClientSecret string
RefreshToken string
Username string
Password string
LoginURL string
GrantType string
Debug bool
ToEmail string
LogFile string
LogLevel string
}
AuthConfig authentication configuration
type AuthError ¶
type AuthError struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
}
AuthError model for OAuth error response
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `json:"access_token"`
InstanceURL string `json:"instance_url"`
ID string `json:"id"`
TokenType string `json:"token_type"`
IssuedAt string `json:"issued_at"`
Signature string `json:"signature"`
}
AuthResponse model for OAuth response
type Case ¶
type Case struct {
ID string `json:"Id,omitempty"`
CaseNumber string `json:"CaseNumber,omitempty"`
Subject string `json:"Subject,omitempty"`
Description string `json:"Description,omitempty"`
Status string `json:"Status,omitempty"`
Priority string `json:"Priority,omitempty"`
Origin string `json:"Origin,omitempty"`
RecordTypeId string `json:"RecordTypeId,omitempty"`
AccountId string `json:"AccountId,omitempty"`
ContactId string `json:"ContactId,omitempty"`
SuppliedName string `json:"SuppliedName,omitempty"`
SuppliedEmail string `json:"SuppliedEmail,omitempty"`
SuppliedCountry string `json:"SuppliedCountry__c,omitempty"`
SuppliedPhone string `json:"SuppliedPhone,omitempty"`
IPAddress string `json:"IP_Address__c,omitempty"`
Severity string `json:"Severity__c,omitempty"`
Product string `json:"Product__c,omitempty"`
OperatingSystem string `json:"Operating_System__c,omitempty"`
WebQueueEmail string `json:"Web_Queue_Email__c,omitempty"`
WebURL string `json:"Web_URL__c,omitempty"`
Type string `json:"type,omitempty"`
}
Case model for Case object with extended fields
type CaseHeaders ¶
type CaseHeaders struct {
SforceAssignmentRuleHeader string `json:"Sforce-Assignment-Rule-Header,omitempty"`
SforceEmailHeader string `json:"Sforce-Email-Header,omitempty"`
}
CaseHeaders headers for creating Case
type EmailMessageParams ¶
type EmailMessageParams struct {
ParentId string `json:"ParentId,omitempty"`
FromAddress string `json:"FromAddress,omitempty"`
FromName string `json:"FromName,omitempty"`
ToAddress string `json:"ToAddress,omitempty"`
Subject string `json:"Subject,omitempty"`
TextBody string `json:"TextBody,omitempty"`
Status int `json:"Status,omitempty"`
Incoming bool `json:"Incoming,omitempty"`
}
EmailMessageParams contains parameters for creating an EmailMessage
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
ErrorCode string `json:"errorCode"`
Fields []string `json:"fields,omitempty"`
}
ErrorResponse model for API errors
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type QueryResponse ¶
type QueryResponse struct {
TotalSize int `json:"totalSize"`
Done bool `json:"done"`
Records []interface{} `json:"records"`
}
QueryResponse model for SOQL response
Click to show internal directories.
Click to hide internal directories.