Class: Svix::StreamPortalAccessIn
- Inherits:
-
Object
- Object
- Svix::StreamPortalAccessIn
- Defined in:
- lib/svix/models/stream_portal_access_in.rb
Instance Attribute Summary collapse
-
#expiry ⇒ Object
How long the token will be valid for, in seconds.
-
#feature_flags ⇒ Object
The set of feature flags the created token will have access to.
-
#session_id ⇒ Object
An optional session ID to attach to the token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ StreamPortalAccessIn
constructor
A new instance of StreamPortalAccessIn.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ StreamPortalAccessIn
Returns a new instance of StreamPortalAccessIn.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 21 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::StreamPortalAccessIn` new method") end attributes.each do |k, v| unless ALL_FIELD.include?(k.to_s) fail(ArgumentError, "The field #{k} is not part of Svix::StreamPortalAccessIn") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#expiry ⇒ Object
How long the token will be valid for, in seconds.
Valid values are between 1 hour and 7 days. The default is 7 days.
10 11 12 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 10 def expiry @expiry end |
#feature_flags ⇒ Object
The set of feature flags the created token will have access to.
12 13 14 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 12 def feature_flags @feature_flags end |
#session_id ⇒ Object
An optional session ID to attach to the token.
When expiring tokens with “Expire All”, you can include the session ID to only expire tokens that were created with that session ID.
16 17 18 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 16 def session_id @session_id end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 36 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["expiry"] = attributes["expiry"] attrs["feature_flags"] = attributes["featureFlags"] attrs["session_id"] = attributes["sessionId"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 45 def serialize out = Hash.new out["expiry"] = Svix::serialize_primitive(@expiry) if @expiry out["featureFlags"] = Svix::serialize_primitive(@feature_flags) if @feature_flags out["sessionId"] = Svix::serialize_primitive(@session_id) if @session_id out end |
#to_json ⇒ Object
Serializes the object to a json string
55 56 57 |
# File 'lib/svix/models/stream_portal_access_in.rb', line 55 def to_json JSON.dump(serialize) end |