Class: Io::Flow::V0::Models::QueryFilterUnstructured

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

Instance Attribute Summary collapse

Attributes inherited from QueryFilter

#discriminator

Instance Method Summary collapse

Methods inherited from QueryFilter

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ QueryFilterUnstructured

Returns a new instance of QueryFilterUnstructured.



40519
40520
40521
40522
40523
40524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40519

def initialize(incoming={})
  super(:discriminator => QueryFilter::Types::QUERY_FILTER_UNSTRUCTURED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:q], 'QueryFilterUnstructured')
  @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
end

Instance Attribute Details

#qObject (readonly)

Returns the value of attribute q.



40517
40518
40519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40517

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40530
40531
40532
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40530

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

#subtype_to_hashObject



40534
40535
40536
40537
40538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40534

def subtype_to_hash
  {
    :q => q
  }
end

#to_jsonObject



40526
40527
40528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40526

def to_json
  JSON.dump(to_hash)
end