Class: Verizon::ThingspaceOauthCredentials
- Inherits:
-
Object
- Object
- Verizon::ThingspaceOauthCredentials
- Defined in:
- lib/verizon/http/auth/thingspace_oauth.rb
Overview
Data class for ThingspaceOauthCredentials.
Instance Attribute Summary collapse
-
#oauth_client_id ⇒ Object
readonly
Returns the value of attribute oauth_client_id.
-
#oauth_client_secret ⇒ Object
readonly
Returns the value of attribute oauth_client_secret.
-
#oauth_clock_skew ⇒ Object
readonly
Returns the value of attribute oauth_clock_skew.
-
#oauth_on_token_update ⇒ Object
readonly
Returns the value of attribute oauth_on_token_update.
-
#oauth_scopes ⇒ Object
readonly
Returns the value of attribute oauth_scopes.
-
#oauth_token ⇒ Object
readonly
Returns the value of attribute oauth_token.
-
#oauth_token_provider ⇒ Object
readonly
Returns the value of attribute oauth_token_provider.
Instance Method Summary collapse
- #clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) ⇒ Object
-
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) ⇒ ThingspaceOauthCredentials
constructor
A new instance of ThingspaceOauthCredentials.
Constructor Details
#initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) ⇒ ThingspaceOauthCredentials
Returns a new instance of ThingspaceOauthCredentials.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 104 def initialize(oauth_client_id:, oauth_client_secret:, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) raise ArgumentError, 'oauth_client_id cannot be nil' if oauth_client_id.nil? raise ArgumentError, 'oauth_client_secret cannot be nil' if oauth_client_secret.nil? @oauth_client_id = oauth_client_id @oauth_client_secret = oauth_client_secret @oauth_token = oauth_token @oauth_scopes = oauth_scopes @oauth_token_provider = oauth_token_provider @oauth_on_token_update = oauth_on_token_update @oauth_clock_skew = oauth_clock_skew end |
Instance Attribute Details
#oauth_client_id ⇒ Object (readonly)
Returns the value of attribute oauth_client_id.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_client_id @oauth_client_id end |
#oauth_client_secret ⇒ Object (readonly)
Returns the value of attribute oauth_client_secret.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_client_secret @oauth_client_secret end |
#oauth_clock_skew ⇒ Object (readonly)
Returns the value of attribute oauth_clock_skew.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_clock_skew @oauth_clock_skew end |
#oauth_on_token_update ⇒ Object (readonly)
Returns the value of attribute oauth_on_token_update.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_on_token_update @oauth_on_token_update end |
#oauth_scopes ⇒ Object (readonly)
Returns the value of attribute oauth_scopes.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_scopes @oauth_scopes end |
#oauth_token ⇒ Object (readonly)
Returns the value of attribute oauth_token.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_token @oauth_token end |
#oauth_token_provider ⇒ Object (readonly)
Returns the value of attribute oauth_token_provider.
100 101 102 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 100 def oauth_token_provider @oauth_token_provider end |
Instance Method Details
#clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/verizon/http/auth/thingspace_oauth.rb', line 119 def clone_with(oauth_client_id: nil, oauth_client_secret: nil, oauth_token: nil, oauth_scopes: nil, oauth_token_provider: nil, oauth_on_token_update: nil, oauth_clock_skew: nil) oauth_client_id ||= self.oauth_client_id oauth_client_secret ||= self.oauth_client_secret oauth_token ||= self.oauth_token oauth_scopes ||= self.oauth_scopes oauth_token_provider ||= self.oauth_token_provider oauth_on_token_update ||= self.oauth_on_token_update oauth_clock_skew ||= self.oauth_clock_skew ThingspaceOauthCredentials.new( oauth_client_id: oauth_client_id, oauth_client_secret: oauth_client_secret, oauth_token: oauth_token, oauth_scopes: oauth_scopes, oauth_token_provider: oauth_token_provider, oauth_on_token_update: oauth_on_token_update, oauth_clock_skew: oauth_clock_skew ) end |