class Io::Flow::V0::Models::ScheduledExport

Allows a user to create a scheduled export that will be delivered on a schedule (currently only support once / day at a set time)

Attributes

hour[R]
id[R]
last_sent_at[R]
minute[R]
organization_q[R]
timezone[R]
types[R]
user[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65040
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :user, :organization_q, :hour, :minute, :timezone, :types], 'ScheduledExport')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
  @organization_q = HttpClient::Preconditions.assert_class('organization_q', opts.delete(:organization_q), String)
  @hour = HttpClient::Preconditions.assert_class('hour', opts.delete(:hour), Integer)
  @minute = HttpClient::Preconditions.assert_class('minute', opts.delete(:minute), Integer)
  @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String)
  @types = HttpClient::Preconditions.assert_class('types', opts.delete(:types), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExportType) ? x : ::Io::Flow::V0::Models::ExportType.from_json(x)) }
  @last_sent_at = (x = opts.delete(:last_sent_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('last_sent_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65057
def copy(incoming={})
  ScheduledExport.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65061
def to_hash
  {
    :id => id,
    :user => user.to_hash,
    :organization_q => organization_q,
    :hour => hour,
    :minute => minute,
    :timezone => timezone,
    :types => types.map { |o| o.to_hash },
    :last_sent_at => last_sent_at
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65053
def to_json
  JSON.dump(to_hash)
end