Class: Unit::Customer::PatchIndividualCustomerRequest
- Inherits:
-
Object
- Object
- Unit::Customer::PatchIndividualCustomerRequest
- Defined in:
- lib/unit/models/customer/patch_individual_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.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#dba ⇒ Object
readonly
Returns the value of attribute dba.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#jwt_subject ⇒ Object
readonly
Returns the value of attribute jwt_subject.
-
#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, email = nil, dba = nil, authorized_users = nil, tags = nil, jwt_subject = nil) ⇒ PatchIndividualCustomerRequest
constructor
A new instance of PatchIndividualCustomerRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, address = nil, phone = nil, email = nil, dba = nil, authorized_users = nil, tags = nil, jwt_subject = nil) ⇒ PatchIndividualCustomerRequest
Returns a new instance of PatchIndividualCustomerRequest.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/unit/models/customer/patch_individual_customer_request.rb', line 18 def initialize(customer_id, address = nil, phone = nil, email = nil, dba = nil, = nil, = nil, jwt_subject = nil) @customer_id = customer_id @address = address @phone = phone @email = email @dba = dba @authorized_users = @tags = @jwt_subject = jwt_subject end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
8 9 10 |
# File 'lib/unit/models/customer/patch_individual_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_individual_customer_request.rb', line 8 def @authorized_users end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/customer/patch_individual_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_individual_customer_request.rb', line 8 def dba @dba end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
8 9 10 |
# File 'lib/unit/models/customer/patch_individual_customer_request.rb', line 8 def email @email end |
#jwt_subject ⇒ Object (readonly)
Returns the value of attribute jwt_subject.
8 9 10 |
# File 'lib/unit/models/customer/patch_individual_customer_request.rb', line 8 def jwt_subject @jwt_subject end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
8 9 10 |
# File 'lib/unit/models/customer/patch_individual_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_individual_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_individual_customer_request.rb', line 29 def to_json_api payload = { data: { type: "individualCustomer", attributes: { address: address&.represent, phone: phone&.represent, email: email, dba: dba, authorizedUsers: &.map(&:represent), tags: } } } payload[:data][:attributes].compact! payload.to_json end |