Sha256: 45c0ed4b4346ca3199d3ff4a0b247b4c4b8fea80b8e06b7270e95a494311fa23

Contents?: true

Size: 757 Bytes

Versions: 14

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

# A Report contains a csv that is a log of all the objects created within a certain time frame.
class EasyPost::Report < EasyPost::Resource
  # Create a Report.
  def self.create(params = {}, api_key = nil)
    url = "#{self.url}/#{params[:type]}"

    wrapped_params = {}
    wrapped_params[class_name.to_sym] = params

    response = EasyPost.make_request(:post, url, api_key, params)
    EasyPost::Util.convert_to_easypost_object(response, api_key)
  end

  # Retrieve a list of Report objects.
  def self.all(filters = {}, api_key = nil)
    url = "#{self.url}/#{filters[:type]}"

    response = EasyPost.make_request(:get, url, api_key, filters)
    EasyPost::Util.convert_to_easypost_object(response, api_key)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
easypost-4.12.0 lib/easypost/report.rb
easypost-4.11.0 lib/easypost/report.rb
easypost-4.10.0 lib/easypost/report.rb
easypost-4.9.0 lib/easypost/report.rb
easypost-4.8.1 lib/easypost/report.rb
easypost-4.8.0 lib/easypost/report.rb
easypost-4.7.1 lib/easypost/report.rb
easypost-4.7.0 lib/easypost/report.rb
easypost-4.6.0 lib/easypost/report.rb
easypost-4.5.0 lib/easypost/report.rb
easypost-4.4.0 lib/easypost/report.rb
easypost-4.3.0 lib/easypost/report.rb
easypost-4.2.1 lib/easypost/report.rb
easypost-4.2.0 lib/easypost/report.rb