Documentation ¶
Index ¶
- type ColumnDelimiter
- type ContentType
- type FailedRecord
- type Formatter
- type Info
- type Job
- func (j *Job) Abort() (Response, error)
- func (j *Job) Close() (Response, error)
- func (j *Job) Delete() error
- func (j *Job) FailedRecords() ([]FailedRecord, error)
- func (j *Job) Info() (Info, error)
- func (j *Job) SuccessfulRecords() ([]SuccessfulRecord, error)
- func (j *Job) UnprocessedRecords() ([]UnprocessedRecord, error)
- func (j *Job) Upload(body io.Reader) error
- type JobRecord
- type JobType
- type Jobs
- type LineEnding
- type Operation
- type Options
- type Parameters
- type Record
- type Resource
- type Response
- type State
- type SuccessfulRecord
- type UnprocessedRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnDelimiter ¶
type ColumnDelimiter string
ColumnDelimiter is the column delimiter used for CSV job data.
const ( // Backquote is the (`) character. Backquote ColumnDelimiter = "BACKQUOTE" // Caret is the (^) character. Caret ColumnDelimiter = "CARET" // Comma is the (,) character. Comma ColumnDelimiter = "COMMA" // Pipe is the (|) character. Pipe ColumnDelimiter = "PIPE" // SemiColon is the (;) character. SemiColon ColumnDelimiter = "SEMICOLON" // Tab is the (\t) character. Tab ColumnDelimiter = "TAB" )
type ContentType ¶
type ContentType string
ContentType is the format of the data being processed.
const CSV ContentType = "CSV"
CSV is the supported content data type.
type FailedRecord ¶
FailedRecord indicates why the record failed and the data of the record.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter is the object that will add records for the bulk uploader.
func NewFormatter ¶
NewFormatter creates a new formatter using the job and the list of fields.
type Info ¶
type Info struct { Response ApexProcessingTime int `json:"apexProcessingTime"` APIActiveProcessingTime int `json:"apiActiveProcessingTime"` NumberRecordsFailed int `json:"numberRecordsFailed"` NumberRecordsProcessed int `json:"numberRecordsProcessed"` Retries int `json:"retries"` TotalProcessingTime int `json:"totalProcessingTime"` ErrorMessage string `json:"errorMessage"` }
Info is the response to the job information API.
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job is the bulk job.
func (*Job) FailedRecords ¶
func (j *Job) FailedRecords() ([]FailedRecord, error)
FailedRecords returns the failed records for the job.
func (*Job) SuccessfulRecords ¶
func (j *Job) SuccessfulRecords() ([]SuccessfulRecord, error)
SuccessfulRecords returns the successful records for the job.
func (*Job) UnprocessedRecords ¶
func (j *Job) UnprocessedRecords() ([]UnprocessedRecord, error)
UnprocessedRecords returns the unprocessed records for the job.
type JobRecord ¶
type JobRecord struct { ID string UnprocessedRecord }
JobRecord is the record for the job. Includes the Salesforce ID along with the fields.
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs presents the response from the all jobs request.
type LineEnding ¶
type LineEnding string
LineEnding is the line ending used for the CSV job data.
const ( // Linefeed is the (\n) character. Linefeed LineEnding = "LF" // CarriageReturnLinefeed is the (\r\n) character. CarriageReturnLinefeed LineEnding = "CRLF" )
type Operation ¶
type Operation string
Operation is the processing operation for the job.
const ( // Insert is the object operation for inserting records. Insert Operation = "insert" // Delete is the object operation for deleting records. Delete Operation = "delete" // Update is the object operation for updating records. Update Operation = "update" // Upsert is the object operation for upserting records. Upsert Operation = "upsert" )
type Options ¶
type Options struct { ColumnDelimiter ColumnDelimiter `json:"columnDelimiter"` ContentType ContentType `json:"contentType"` ExternalIDFieldName string `json:"externalIdFieldName"` LineEnding LineEnding `json:"lineEnding"` Object string `json:"object"` Operation Operation `json:"operation"` }
Options are the options for the job.
ColumnDelimiter is the delimiter used for the CSV job. This field is optional.
ContentType is the content type for the job. This field is optional.
ExternalIDFieldName is the external ID field in the object being updated. Only needed for upsert operations. This field is required for upsert operations.
LineEnding is the line ending used for the CSV job data. This field is optional.
Object is the object type for the data bneing processed. This field is required.
Operation is the processing operation for the job. This field is required.
type Parameters ¶
Parameters to query all of the bulk jobs.
IsPkChunkingEnabled will filter jobs with PK chunking enabled.
JobType will filter jobs based on job type.
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is the structure that can be used to create bulk 2.0 jobs.
func NewResource ¶
func NewResource(session session.ServiceFormatter) (*Resource, error)
NewResource creates a new bulk 2.0 REST resource. If the session is nil an error will be returned.
func (*Resource) AllJobs ¶
func (r *Resource) AllJobs(parameters Parameters) (*Jobs, error)
AllJobs will retrieve all of the bulk 2.0 jobs.
type Response ¶
type Response struct { APIVersion float32 `json:"apiVersion"` ColumnDelimiter ColumnDelimiter `json:"columnDelimiter"` ConcurrencyMode string `json:"concurrencyMode"` ContentType string `json:"contentType"` ContentURL string `json:"contentUrl"` CreatedByID string `json:"createdById"` CreatedDate string `json:"createdDate"` ExternalIDFieldName string `json:"externalIdFieldName"` ID string `json:"id"` JobType JobType `json:"jobType"` LineEnding LineEnding `json:"lineEnding"` Object string `json:"object"` Operation Operation `json:"operation"` State State `json:"state"` SystemModstamp string `json:"systemModstamp"` }
Response is the response to job APIs.
type State ¶
type State string
State is the current state of processing for the job.
const ( // Open the job has been created and job data can be uploaded tothe job. Open State = "Open" // UpdateComplete all data for the job has been uploaded and the job is ready to be queued and processed. UpdateComplete State = "UploadComplete" // Aborted the job has been aborted. Aborted State = "Aborted" // JobComplete the job was processed by Salesforce. JobComplete State = "JobComplete" // Failed some records in the job failed. Failed State = "Failed" )
type SuccessfulRecord ¶
SuccessfulRecord indicates for the record was created and the data that was uploaded.
type UnprocessedRecord ¶
UnprocessedRecord is the unprocessed records from the job.