Class: Io::Flow::V0::Models::AnalyticsExportType

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

Instance Attribute Summary collapse

Attributes inherited from ExportType

#discriminator

Instance Method Summary collapse

Methods inherited from ExportType

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ AnalyticsExportType

Returns a new instance of AnalyticsExportType.



28318
28319
28320
28321
28322
28323
28324
28325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28318

def initialize(incoming={})
  super(:discriminator => ExportType::Types::ANALYTICS_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @from = (x = opts.delete(:from); x.nil? ? nil : HttpClient::Preconditions.assert_class('from', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @to = (x = opts.delete(:to); x.nil? ? nil : HttpClient::Preconditions.assert_class('to', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @region = (x = opts.delete(:region); x.nil? ? nil : HttpClient::Preconditions.assert_class('region', x, String))
  @interval = (x = opts.delete(:interval); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfTime) ? x : ::Io::Flow::V0::Models::UnitOfTime.apply(x)))
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



28316
28317
28318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28316

def from
  @from
end

#intervalObject (readonly)

Returns the value of attribute interval.



28316
28317
28318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28316

def interval
  @interval
end

#regionObject (readonly)

Returns the value of attribute region.



28316
28317
28318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28316

def region
  @region
end

#toObject (readonly)

Returns the value of attribute to.



28316
28317
28318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28316

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28331
28332
28333
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28331

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

#subtype_to_hashObject



28335
28336
28337
28338
28339
28340
28341
28342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28335

def subtype_to_hash
  {
    :from => from,
    :to => to,
    :region => region,
    :interval => interval.nil? ? nil : interval.value
  }
end

#to_jsonObject



28327
28328
28329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28327

def to_json
  JSON.dump(to_hash)
end