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.



22587
22588
22589
22590
22591
22592
22593
22594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22587

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.



22585
22586
22587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22585

def from
  @from
end

#intervalObject (readonly)

Returns the value of attribute interval.



22585
22586
22587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22585

def interval
  @interval
end

#regionObject (readonly)

Returns the value of attribute region.



22585
22586
22587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22585

def region
  @region
end

#toObject (readonly)

Returns the value of attribute to.



22585
22586
22587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22585

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22600
22601
22602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22600

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

#subtype_to_hashObject



22604
22605
22606
22607
22608
22609
22610
22611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22604

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

#to_jsonObject



22596
22597
22598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22596

def to_json
  JSON.dump(to_hash)
end