Class: Unit::ApiToken::Customer::CreateCustomerTokenRequest
- Inherits:
-
Object
- Object
- Unit::ApiToken::Customer::CreateCustomerTokenRequest
- Defined in:
- lib/unit/models/api_token/customer/create_customer_token_request.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#verification_code ⇒ Object
readonly
Returns the value of attribute verification_code.
-
#verification_token ⇒ Object
readonly
Returns the value of attribute verification_token.
Instance Method Summary collapse
-
#initialize(customer_id, scope, verification_token, verification_code = nil, expires_in = nil, resources = nil) ⇒ CreateCustomerTokenRequest
constructor
A new instance of CreateCustomerTokenRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, scope, verification_token, verification_code = nil, expires_in = nil, resources = nil) ⇒ CreateCustomerTokenRequest
Returns a new instance of CreateCustomerTokenRequest.
17 18 19 20 21 22 23 24 25 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 17 def initialize(customer_id, scope, verification_token, verification_code = nil, expires_in = nil, resources = nil) @customer_id = customer_id @scope = scope @verification_token = verification_token @verification_code = verification_code @expires_in = expires_in @resources = resources end |
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def customer_id @customer_id end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def expires_in @expires_in end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def resources @resources end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def scope @scope end |
#verification_code ⇒ Object (readonly)
Returns the value of attribute verification_code.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def verification_code @verification_code end |
#verification_token ⇒ Object (readonly)
Returns the value of attribute verification_token.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 9 def verification_token @verification_token end |
Instance Method Details
#to_json_api ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/unit/models/api_token/customer/create_customer_token_request.rb', line 27 def to_json_api result = { data: { type: "customerToken", attributes: { scope: scope&.join(" "), verificationToken: verification_token, verificationCode: verification_code, expiresIn: expires_in, resources: resources } } } result[:data][:attributes].compact! result.to_json end |