Class: Unit::Customer::AddAuthorizedUsersRequest
- Inherits:
-
Object
- Object
- Unit::Customer::AddAuthorizedUsersRequest
- Defined in:
- lib/unit/models/customer/add_authorized_users_request.rb
Instance Attribute Summary collapse
-
#authorized_users ⇒ Object
readonly
Returns the value of attribute authorized_users.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
Instance Method Summary collapse
-
#initialize(customer_id, authorized_users) ⇒ AddAuthorizedUsersRequest
constructor
A new instance of AddAuthorizedUsersRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, authorized_users) ⇒ AddAuthorizedUsersRequest
Returns a new instance of AddAuthorizedUsersRequest.
12 13 14 15 |
# File 'lib/unit/models/customer/add_authorized_users_request.rb', line 12 def initialize(customer_id, ) @customer_id = customer_id @authorized_users = end |
Instance Attribute Details
#authorized_users ⇒ Object (readonly)
Returns the value of attribute authorized_users.
8 9 10 |
# File 'lib/unit/models/customer/add_authorized_users_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/add_authorized_users_request.rb', line 8 def customer_id @customer_id end |
Instance Method Details
#to_json_api ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/unit/models/customer/add_authorized_users_request.rb', line 17 def to_json_api payload = { data: { type: "addAuthorizedUsers", attributes: { authorizedUsers: .map(&:represent) } } } payload[:data][:attributes].compact! payload.to_json end |