Class: Io::Flow::V0::Models::OperationsContact

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

Overview

Defines structured fields for a operations contact person. Typically used for specifying operations contact person for a third party logistics partner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OperationsContact

Returns a new instance of OperationsContact.



51096
51097
51098
51099
51100
51101
51102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51096

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @full_name = (x = opts.delete(:full_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('full_name', x, String))
  @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

Instance Attribute Details

#companyObject (readonly)

Returns the value of attribute company.



51094
51095
51096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51094

def company
  @company
end

#emailObject (readonly)

Returns the value of attribute email.



51094
51095
51096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51094

def email
  @email
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



51094
51095
51096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51094

def full_name
  @full_name
end

#phoneObject (readonly)

Returns the value of attribute phone.



51094
51095
51096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51094

def phone
  @phone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51108
51109
51110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51108

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

#to_hashObject



51112
51113
51114
51115
51116
51117
51118
51119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51112

def to_hash
  {
    :full_name => full_name,
    :company => company,
    :email => email,
    :phone => phone
  }
end

#to_jsonObject



51104
51105
51106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51104

def to_json
  JSON.dump(to_hash)
end