class Twilio::REST::IpMessaging::V1::ServiceContext::RoleInstance

Public Class Methods

new(version, payload, service_sid: nil, sid: nil) click to toggle source

Initialize the RoleInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The service_sid @param [String] sid The sid @return [RoleInstance] RoleInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
228 def initialize(version, payload, service_sid: nil, sid: nil)
229   super(version)
230 
231   # Marshaled Properties
232   @properties = {
233       'sid' => payload['sid'],
234       'account_sid' => payload['account_sid'],
235       'service_sid' => payload['service_sid'],
236       'friendly_name' => payload['friendly_name'],
237       'type' => payload['type'],
238       'permissions' => payload['permissions'],
239       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
240       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
241       'url' => payload['url'],
242   }
243 
244   # Context
245   @instance_context = nil
246   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
247 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
268 def account_sid
269   @properties['account_sid']
270 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RoleContext] RoleContext for this RoleInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
253 def context
254   unless @instance_context
255     @instance_context = RoleContext.new(@version, @params['service_sid'], @params['sid'], )
256   end
257   @instance_context
258 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
298 def date_created
299   @properties['date_created']
300 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
304 def date_updated
305   @properties['date_updated']
306 end
delete() click to toggle source

Delete the RoleInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
324 def delete
325   context.delete
326 end
fetch() click to toggle source

Fetch the RoleInstance @return [RoleInstance] Fetched RoleInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
317 def fetch
318   context.fetch
319 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
280 def friendly_name
281   @properties['friendly_name']
282 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
345 def inspect
346   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
347   "<Twilio.IpMessaging.V1.RoleInstance #{values}>"
348 end
permissions() click to toggle source

@return [Array] The permissions

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
292 def permissions
293   @properties['permissions']
294 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
274 def service_sid
275   @properties['service_sid']
276 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
262 def sid
263   @properties['sid']
264 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
338 def to_s
339   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
340   "<Twilio.IpMessaging.V1.RoleInstance #{values}>"
341 end
type() click to toggle source

@return [role.RoleType] The type

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
286 def type
287   @properties['type']
288 end
update(permission: nil) click to toggle source

Update the RoleInstance @param [Array] permission The permission @return [RoleInstance] Updated RoleInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
332 def update(permission: nil)
333   context.update(permission: permission, )
334 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb
310 def url
311   @properties['url']
312 end