Class: Mailfloss::Resources::Jobs

Inherits:
Base
  • Object
show all
Defined in:
lib/mailfloss/resources.rb,
sig/resources.rbs

Overview

GET /jobs

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#encode, #initialize

Constructor Details

This class inherits a constructor from Mailfloss::Resources::Base

Instance Method Details

#get(id) ⇒ Hash

GET /jobs/id

Parameters:

  • id (String)

Returns:

  • (Hash)

    { id:, status:, source:, source_integration:, created_at:, finished_at:, results: }



77
78
79
# File 'lib/mailfloss/resources.rb', line 77

def get(id)
  client.request(:get, "/jobs/#{encode(id)}")
end

#list(per_page: nil, cursor: nil, source: nil, status: nil) ⇒ Hash

GET /jobs — cursor-paginated job history.

Parameters:

  • per_page (Integer, nil) (defaults to: nil)
  • cursor (String, nil) (defaults to: nil)
  • source (String, nil) (defaults to: nil)

    api|csv|zapier|widget|input|integration

  • status (String, nil) (defaults to: nil)

    queued|processing|completed|cancelled

Returns:

  • (Hash)

    { data: [Job], pagination: { next_cursor:, has_more: } }



68
69
70
71
# File 'lib/mailfloss/resources.rb', line 68

def list(per_page: nil, cursor: nil, source: nil, status: nil)
  client.request(:get, "/jobs",
                 query: { per_page: per_page, cursor: cursor, source: source, status: status })
end