Class: LiveKit::VideoGrant
- Inherits:
-
Object
- Object
- LiveKit::VideoGrant
- Defined in:
- lib/livekit/grants.rb
Instance Attribute Summary collapse
-
#canPublish ⇒ Object
Returns the value of attribute canPublish.
-
#canPublishData ⇒ Object
Returns the value of attribute canPublishData.
-
#canPublishSources ⇒ Object
Returns the value of attribute canPublishSources.
-
#canSubscribe ⇒ Object
Returns the value of attribute canSubscribe.
-
#canUpdateOwnMetadata ⇒ Object
Returns the value of attribute canUpdateOwnMetadata.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#ingressAdmin ⇒ Object
Returns the value of attribute ingressAdmin.
-
#recorder ⇒ Object
Returns the value of attribute recorder.
-
#room ⇒ Object
Returns the value of attribute room.
-
#roomAdmin ⇒ Object
Returns the value of attribute roomAdmin.
-
#roomCreate ⇒ Object
Returns the value of attribute roomCreate.
-
#roomJoin ⇒ Object
Returns the value of attribute roomJoin.
-
#roomList ⇒ Object
Returns the value of attribute roomList.
-
#roomRecord ⇒ Object
Returns the value of attribute roomRecord.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(roomCreate: nil, roomJoin: nil, roomList: nil, roomRecord: nil, roomAdmin: nil, room: nil, canPublish: nil, canPublishSources: nil, canSubscribe: nil, canPublishData: nil, canUpdateOwnMetadata: nil, hidden: nil, recorder: nil, ingressAdmin: nil) ⇒ VideoGrant
constructor
A new instance of VideoGrant.
- #to_hash ⇒ Object
Constructor Details
#initialize(roomCreate: nil, roomJoin: nil, roomList: nil, roomRecord: nil, roomAdmin: nil, room: nil, canPublish: nil, canPublishSources: nil, canSubscribe: nil, canPublishData: nil, canUpdateOwnMetadata: nil, hidden: nil, recorder: nil, ingressAdmin: nil) ⇒ VideoGrant
Returns a new instance of VideoGrant.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/livekit/grants.rb', line 68 def initialize( # true if can create or delete rooms roomCreate: nil, # true if can join room roomJoin: nil, # true if can list rooms roomList: nil, # true if can record roomRecord: nil, # true if can manage the room roomAdmin: nil, # name of the room for join or admin permissions room: nil, # for join tokens, can participant publish, true by default canPublish: nil, # TrackSource types that a participant may publish canPublishSources: nil, # for join tokens, can participant subscribe, true by default canSubscribe: nil, # for join tokens, can participant publish data messages, true by default canPublishData: nil, # by default, a participant is not allowed to update its own metadata canUpdateOwnMetadata: nil, # if participant should remain invisible to others hidden: nil, # if participant is recording the room recorder: nil, # can create and manage Ingress ingressAdmin: nil ) @roomCreate = roomCreate @roomJoin = roomJoin @roomList = roomList @roomRecord = roomRecord @roomAdmin = roomAdmin @room = room @canPublish = canPublish @canPublishSources = canPublishSources @canSubscribe = canSubscribe @canPublishData = canPublishData @canUpdateOwnMetadata = canUpdateOwnMetadata @hidden = hidden @recorder = recorder @ingressAdmin = ingressAdmin end |
Instance Attribute Details
#canPublish ⇒ Object
Returns the value of attribute canPublish.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def canPublish @canPublish end |
#canPublishData ⇒ Object
Returns the value of attribute canPublishData.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def canPublishData @canPublishData end |
#canPublishSources ⇒ Object
Returns the value of attribute canPublishSources.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def canPublishSources @canPublishSources end |
#canSubscribe ⇒ Object
Returns the value of attribute canSubscribe.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def canSubscribe @canSubscribe end |
#canUpdateOwnMetadata ⇒ Object
Returns the value of attribute canUpdateOwnMetadata.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def canUpdateOwnMetadata @canUpdateOwnMetadata end |
#hidden ⇒ Object
Returns the value of attribute hidden.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def hidden @hidden end |
#ingressAdmin ⇒ Object
Returns the value of attribute ingressAdmin.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def ingressAdmin @ingressAdmin end |
#recorder ⇒ Object
Returns the value of attribute recorder.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def recorder @recorder end |
#room ⇒ Object
Returns the value of attribute room.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def room @room end |
#roomAdmin ⇒ Object
Returns the value of attribute roomAdmin.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def roomAdmin @roomAdmin end |
#roomCreate ⇒ Object
Returns the value of attribute roomCreate.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def roomCreate @roomCreate end |
#roomJoin ⇒ Object
Returns the value of attribute roomJoin.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def roomJoin @roomJoin end |
#roomList ⇒ Object
Returns the value of attribute roomList.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def roomList @roomList end |
#roomRecord ⇒ Object
Returns the value of attribute roomRecord.
64 65 66 |
# File 'lib/livekit/grants.rb', line 64 def roomRecord @roomRecord end |
Class Method Details
.from_hash(hash) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/livekit/grants.rb', line 114 def self.from_hash(hash) return nil if hash.nil? hash = hash.stringify_keys VideoGrant.new( roomCreate: hash["roomCreate"], roomJoin: hash["roomJoin"], roomList: hash["roomList"], roomRecord: hash["roomRecord"], roomAdmin: hash["roomAdmin"], room: hash["room"], canPublish: hash["canPublish"], canPublishSources: hash["canPublishSources"], canSubscribe: hash["canSubscribe"], canPublishData: hash["canPublishData"], canUpdateOwnMetadata: hash["canUpdateOwnMetadata"], hidden: hash["hidden"], recorder: hash["recorder"], ingressAdmin: hash["ingressAdmin"] ) end |
Instance Method Details
#to_hash ⇒ Object
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/livekit/grants.rb', line 137 def to_hash hash = {} instance_variables.each { |var| val = instance_variable_get(var) if val != nil hash[var.to_s.delete("@")] = val end } hash end |