Class: Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapPermissionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapPermissionContext
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the SyncMapPermissionInstance.
-
#fetch ⇒ SyncMapPermissionInstance
Fetch the SyncMapPermissionInstance.
-
#initialize(version, service_sid, map_sid, identity) ⇒ SyncMapPermissionContext
constructor
Initialize the SyncMapPermissionContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(read: nil, write: nil, manage: nil) ⇒ SyncMapPermissionInstance
Update the SyncMapPermissionInstance.
Constructor Details
#initialize(version, service_sid, map_sid, identity) ⇒ SyncMapPermissionContext
Initialize the SyncMapPermissionContext
137 138 139 140 141 142 143 144 145 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 137 def initialize(version, service_sid, map_sid, identity) super(version) # Path Solution @solution = { service_sid: service_sid, map_sid: map_sid, identity: identity, } @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Permissions/#{@solution[:identity]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the SyncMapPermissionInstance
149 150 151 152 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 149 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ SyncMapPermissionInstance
Fetch the SyncMapPermissionInstance
157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 157 def fetch payload = @version.fetch('GET', @uri) SyncMapPermissionInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], identity: @solution[:identity], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
207 208 209 210 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 207 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncMapPermissionContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
200 201 202 203 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 200 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncMapPermissionContext #{context}>" end |
#update(read: nil, write: nil, manage: nil) ⇒ SyncMapPermissionInstance
Update the SyncMapPermissionInstance
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb', line 175 def update( read: nil, write: nil, manage: nil ) data = Twilio::Values.of({ 'Read' => read, 'Write' => write, 'Manage' => manage, }) payload = @version.update('POST', @uri, data: data) SyncMapPermissionInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], identity: @solution[:identity], ) end |