Class: Unit::Customer::RemoveAuthorizedUsersRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/customer/remove_authorized_users_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(customer_id, authorized_users_emails) ⇒ RemoveAuthorizedUsersRequest

Returns a new instance of RemoveAuthorizedUsersRequest.

Parameters:

  • customer_id (String)
  • authorized_users_emails (Array<String>)


12
13
14
15
# File 'lib/unit/models/customer/remove_authorized_users_request.rb', line 12

def initialize(customer_id, authorized_users_emails)
  @customer_id = customer_id
  @authorized_users_emails = authorized_users_emails
end

Instance Attribute Details

#authorized_users_emailsObject (readonly)

Returns the value of attribute authorized_users_emails.



8
9
10
# File 'lib/unit/models/customer/remove_authorized_users_request.rb', line 8

def authorized_users_emails
  @authorized_users_emails
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



8
9
10
# File 'lib/unit/models/customer/remove_authorized_users_request.rb', line 8

def customer_id
  @customer_id
end

Instance Method Details

#to_json_apiObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/unit/models/customer/remove_authorized_users_request.rb', line 17

def to_json_api
  payload = {
    data: {
      type: "removeAuthorizedUsers",
      attributes: {
        authorizedUsersEmails: authorized_users_emails
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end