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.



30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30043

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

#hourObject (readonly)

Returns the value of attribute hour.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def hour
  @hour
end

#minuteObject (readonly)

Returns the value of attribute minute.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def minute
  @minute
end

#organization_qObject (readonly)

Returns the value of attribute organization_q.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def organization_q
  @organization_q
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def timezone
  @timezone
end

#typesObject (readonly)

Returns the value of attribute types.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def types
  @types
end

#user_idObject (readonly)

Returns the value of attribute user_id.



30041
30042
30043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30041

def user_id
  @user_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30058
30059
30060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30058

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

#to_hashObject



30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30062

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_jsonObject



30054
30055
30056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30054

def to_json
  JSON.dump(to_hash)
end