Class: Io::Flow::V0::Models::ShopifyLocationFlowCenterMapping

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ShopifyLocationFlowCenterMapping

Returns a new instance of ShopifyLocationFlowCenterMapping.



67816
67817
67818
67819
67820
67821
67822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67816

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :shopify_location, :flow_center], 'ShopifyLocationFlowCenterMapping')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @shopify_location = (x = opts.delete(:shopify_location); x.is_a?(::Io::Flow::V0::Models::ShopifyLocationReference) ? x : ::Io::Flow::V0::Models::ShopifyLocationReference.new(x))
  @flow_center = (x = opts.delete(:flow_center); x.is_a?(::Io::Flow::V0::Models::FlowCenterReference) ? x : ::Io::Flow::V0::Models::FlowCenterReference.new(x))
end

Instance Attribute Details

#flow_centerObject (readonly)

Returns the value of attribute flow_center.



67814
67815
67816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67814

def flow_center
  @flow_center
end

#idObject (readonly)

Returns the value of attribute id.



67814
67815
67816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67814

def id
  @id
end

#shopify_locationObject (readonly)

Returns the value of attribute shopify_location.



67814
67815
67816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67814

def shopify_location
  @shopify_location
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



67828
67829
67830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67828

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

#to_hashObject



67832
67833
67834
67835
67836
67837
67838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67832

def to_hash
  {
    :id => id,
    :shopify_location => shopify_location.to_hash,
    :flow_center => flow_center.to_hash
  }
end

#to_jsonObject



67824
67825
67826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67824

def to_json
  JSON.dump(to_hash)
end