Class: Io::Flow::V0::Models::ExclusionRulesExportType

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

Overview

Defines the filters that can be applied when requesting an exclusion rule data export

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 = {}) ⇒ ExclusionRulesExportType

Returns a new instance of ExclusionRulesExportType.



41370
41371
41372
41373
41374
41375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41370

def initialize(incoming={})
  super(:discriminator => ExportType::Types::EXCLUSION_RULES_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @states = (x = opts.delete(:states); x.nil? ? nil : HttpClient::Preconditions.assert_class('states', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExclusionRuleState) ? x : ::Io::Flow::V0::Models::ExclusionRuleState.apply(x)) })
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#sortObject (readonly)

Returns the value of attribute sort.



41368
41369
41370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41368

def sort
  @sort
end

#statesObject (readonly)

Returns the value of attribute states.



41368
41369
41370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41368

def states
  @states
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41381
41382
41383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41381

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

#subtype_to_hashObject



41385
41386
41387
41388
41389
41390
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41385

def subtype_to_hash
  {
    :states => states.nil? ? nil : states.map { |o| o.value },
    :sort => sort
  }
end

#to_jsonObject



41377
41378
41379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41377

def to_json
  JSON.dump(to_hash)
end