class Io::Flow::V0::Models::Contact
Defines structured fields for a contact person. Typically used for specifying contact person for an account, shipment, or organization representative
Attributes
company[R]
email[R]
name[R]
phone[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 36978 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name], 'Contact') @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x)) @company = (x = opts.delete(:company); x.nil? ? nil : HttpClient::Preconditions.assert_class('company', x, String)) @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)) @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String)) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 36991 def copy(incoming={}) Contact.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 36995 def to_hash { :name => name.to_hash, :company => company, :email => email, :phone => phone } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 36987 def to_json JSON.dump(to_hash) end