Class: Unit::Customer::PatchBusinessCustomerRequest
- Inherits:
-
Object
- Object
- Unit::Customer::PatchBusinessCustomerRequest
- Defined in:
- lib/unit/models/customer/patch_business_customer_request.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#authorized_users ⇒ Object
readonly
Returns the value of attribute authorized_users.
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#dba ⇒ Object
readonly
Returns the value of attribute dba.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(customer_id, address = nil, phone = nil, contact = nil, authorized_users = nil, dba = nil, tags = nil) ⇒ PatchBusinessCustomerRequest
constructor
more information regarding tags: docs.unit.co/#updating-tags.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, address = nil, phone = nil, contact = nil, authorized_users = nil, dba = nil, tags = nil) ⇒ PatchBusinessCustomerRequest
more information regarding tags: docs.unit.co/#updating-tags
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 18 def initialize(customer_id, address = nil, phone = nil, contact = nil, = nil, dba = nil, = nil) @customer_id = customer_id @address = address @phone = phone @contact = contact @authorized_users = @dba = dba @tags = end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def address @address end |
#authorized_users ⇒ Object (readonly)
Returns the value of attribute authorized_users.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def @authorized_users end |
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def contact @contact end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def customer_id @customer_id end |
#dba ⇒ Object (readonly)
Returns the value of attribute dba.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def dba @dba end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def phone @phone end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 8 def @tags end |
Instance Method Details
#to_json_api ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/unit/models/customer/patch_business_customer_request.rb', line 29 def to_json_api payload = { data: { type: "businessCustomer", attributes: { address: address&.represent, phone: phone&.represent, contact: contact&.represent, authorizedUsers: &.map(&:represent), dba: dba, tags: } } } payload[:data][:attributes].compact! payload.to_json end |