Module: Unit::ApiToken::Customer
- Defined in:
- lib/unit/models/api_token/api_token.rb,
lib/unit/models/api_token/customer/create_customer_token_request.rb,
lib/unit/models/api_token/customer/create_token_using_jwt_request.rb,
lib/unit/models/api_token/customer/create_customer_token_verification.rb
Defined Under Namespace
Classes: CreateCustomerTokenRequest, CreateCustomerTokenVerification, CreateTokenUsingJwtRequest
Class Method Summary collapse
-
.create_customer_token(customer_id:, scope:, verification_token:, verification_code: nil, expires_in: nil, resources: nil) ⇒ UnitResponse, UnitError
Create customer token by calling Unit’s API.
-
.create_customer_token_verification(customer_id:, channel:, phone: nil, app_hash: nil, language: nil) ⇒ UnitResponse, UnitError
Create customer token verification by calling Unit’s API.
-
.create_customer_token_with_jwt(customer_id:, scope:, jwt_token: nil) ⇒ UnitResponse, UnitError
Create customer token using JWT by calling Unit’s API.
Class Method Details
.create_customer_token(customer_id:, scope:, verification_token:, verification_code: nil, expires_in: nil, resources: nil) ⇒ UnitResponse, UnitError
Create customer token by calling Unit’s API
57 58 59 60 61 |
# File 'lib/unit/models/api_token/api_token.rb', line 57 def create_customer_token(customer_id:, scope:, verification_token:, verification_code: nil, expires_in: nil, resources: nil) request = CreateCustomerTokenRequest.new(customer_id, scope, verification_token, verification_code, expires_in, resources) Unit::Resource::ApiTokenResource.create_customer_token(request) end |
.create_customer_token_verification(customer_id:, channel:, phone: nil, app_hash: nil, language: nil) ⇒ UnitResponse, UnitError
Create customer token verification by calling Unit’s API
82 83 84 85 |
# File 'lib/unit/models/api_token/api_token.rb', line 82 def create_customer_token_verification(customer_id:, channel:, phone: nil, app_hash: nil, language: nil) request = CreateCustomerTokenVerification.new(customer_id, channel, phone, app_hash, language) Unit::Resource::ApiTokenResource.create_token_verification(request) end |
.create_customer_token_with_jwt(customer_id:, scope:, jwt_token: nil) ⇒ UnitResponse, UnitError
Create customer token using JWT by calling Unit’s API
69 70 71 72 |
# File 'lib/unit/models/api_token/api_token.rb', line 69 def create_customer_token_with_jwt(customer_id:, scope:, jwt_token: nil) request = CreateTokenUsingJwtRequest.new(customer_id, scope, jwt_token) Unit::Resource::ApiTokenResource.create_customer_token(request) end |