Class: Twilio::REST::Media::V1::PlayerStreamerContext::PlaybackGrantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Media::V1::PlayerStreamerContext::PlaybackGrantInstance
- Defined in:
- lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this resource.
-
#context ⇒ PlaybackGrantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create(ttl: :unset, access_control_allow_origin: :unset) ⇒ PlaybackGrantInstance
Create the PlaybackGrantInstance.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#fetch ⇒ PlaybackGrantInstance
Fetch the PlaybackGrantInstance.
-
#grant ⇒ Hash
The grant that authorizes the player sdk to connect to the livestream.
-
#initialize(version, payload, sid: nil) ⇒ PlaybackGrantInstance
constructor
Initialize the PlaybackGrantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ PlaybackGrantInstance
Initialize the PlaybackGrantInstance
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 149 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'url' => payload['url'], 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'grant' => payload['grant'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this resource.
191 192 193 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 191 def account_sid @properties['account_sid'] end |
#context ⇒ PlaybackGrantContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 170 def context unless @instance_context @instance_context = PlaybackGrantContext.new(@version , @params['sid']) end @instance_context end |
#create(ttl: :unset, access_control_allow_origin: :unset) ⇒ PlaybackGrantInstance
Create the PlaybackGrantInstance
212 213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 212 def create( ttl: :unset, access_control_allow_origin: :unset ) context.create( ttl: ttl, access_control_allow_origin: access_control_allow_origin, ) end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
197 198 199 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 197 def date_created @properties['date_created'] end |
#fetch ⇒ PlaybackGrantInstance
Fetch the PlaybackGrantInstance
226 227 228 229 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 226 def fetch context.fetch end |
#grant ⇒ Hash
Returns The grant that authorizes the player sdk to connect to the livestream.
203 204 205 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 203 def grant @properties['grant'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 240 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlaybackGrantInstance #{values}>" end |
#sid ⇒ String
Returns The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for.
179 180 181 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 179 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 233 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.PlaybackGrantInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
185 186 187 |
# File 'lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb', line 185 def url @properties['url'] end |