Class: Io::Flow::V0::Models::ScheduledExportForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ScheduledExportForm

Returns a new instance of ScheduledExportForm.



19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19796

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:user_id, :organization_q, :hour, :minute, :timezone, :types], 'ScheduledExportForm')
  @user_id = HttpClient::Preconditions.assert_class('user_id', opts.delete(:user_id), String)
  @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)) }
end

Instance Attribute Details

#hour ⇒ Object (readonly)

Returns the value of attribute hour.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def hour
  @hour
end

#minute ⇒ Object (readonly)

Returns the value of attribute minute.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def minute
  @minute
end

#organization_q ⇒ Object (readonly)

Returns the value of attribute organization_q.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def organization_q
  @organization_q
end

#timezone ⇒ Object (readonly)

Returns the value of attribute timezone.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def timezone
  @timezone
end

#types ⇒ Object (readonly)

Returns the value of attribute types.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def types
  @types
end

#user_id ⇒ Object (readonly)

Returns the value of attribute user_id.



19794
19795
19796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19794

def user_id
  @user_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



19811
19812
19813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19811

def copy(incoming={})
  ScheduledExportForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hash ⇒ Object



19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19815

def to_hash
  {
    :user_id => user_id,
    :organization_q => organization_q,
    :hour => hour,
    :minute => minute,
    :timezone => timezone,
    :types => types.map { |o| o.to_hash }
  }
end

#to_json ⇒ Object



19807
19808
19809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19807

def to_json
  JSON.dump(to_hash)
end