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.



36188
36189
36190
36191
36192
36193
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36188

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.



36186
36187
36188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36186

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



36199
36200
36201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36199

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

#subtype_to_hashObject



36203
36204
36205
36206
36207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36203

def subtype_to_hash
  {
    :q => q
  }
end

#to_jsonObject



36195
36196
36197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36195

def to_json
  JSON.dump(to_hash)
end