Class: ApolloDeploySignalSdkRails::StreamTokenResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::StreamTokenResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: StreamTokenResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ StreamTokenResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(token:, expires_at:) ⇒ StreamTokenResponse
constructor
A new instance of StreamTokenResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(token:, expires_at:) ⇒ StreamTokenResponse
Returns a new instance of StreamTokenResponse.
601 602 603 604 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 601 def initialize(token: , expires_at: ) @token = token @expires_at = expires_at end |
Instance Attribute Details
#expires_at ⇒ String
598 599 600 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 598 def expires_at @expires_at end |
#token ⇒ String
596 597 598 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 596 def token @token end |
Class Method Details
.from_json(attributes) ⇒ StreamTokenResponse
Create an instance from a parsed JSON hash.
617 618 619 620 621 622 623 624 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 617 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( token: attributes.key?("token") ? attributes["token"] : attributes[:token], expires_at: attributes.key?("expiresAt") ? attributes["expiresAt"] : attributes[:expires_at], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
607 608 609 610 611 612 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 607 def to_h { token: @token, expires_at: @expires_at, }.compact end |