Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext::ItemAssignmentInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, bundle_sid: nil, sid: nil) ⇒ ItemAssignmentInstance

Initialize the ItemAssignmentInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • bundle_sid (String) (defaults to: nil)

    The unique string that we created to identify the Bundle resource.

  • sid (String) (defaults to: nil)

    The unique string that we created to identify the Identity resource.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 235

def initialize(version, payload, bundle_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'bundle_sid' => payload['bundle_sid'],
      'account_sid' => payload['account_sid'],
      'object_sid' => payload['object_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'bundle_sid' => bundle_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



278
279
280
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 278

def 
  @properties['account_sid']
end

#bundle_sidString

Returns The unique string that identifies the Bundle resource.

Returns:

  • (String)

    The unique string that identifies the Bundle resource.



272
273
274
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 272

def bundle_sid
  @properties['bundle_sid']
end

#contextItemAssignmentContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



257
258
259
260
261
262
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 257

def context
  unless @instance_context
    @instance_context = ItemAssignmentContext.new(@version, @params['bundle_sid'], @params['sid'], )
  end
  @instance_context
end

#date_createdTime

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was created



290
291
292
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 290

def date_created
  @properties['date_created']
end

#deleteBoolean

Deletes the ItemAssignmentInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



310
311
312
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 310

def delete
  context.delete
end

#fetchItemAssignmentInstance

Fetch a ItemAssignmentInstance

Returns:



303
304
305
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 303

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



323
324
325
326
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 323

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Numbers.V2.ItemAssignmentInstance #{values}>"
end

#object_sidString

Returns The sid of an object bag.

Returns:

  • (String)

    The sid of an object bag



284
285
286
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 284

def object_sid
  @properties['object_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



266
267
268
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 266

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



316
317
318
319
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 316

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Numbers.V2.ItemAssignmentInstance #{values}>"
end

#urlString

Returns The absolute URL of the Identity resource.

Returns:

  • (String)

    The absolute URL of the Identity resource



296
297
298
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb', line 296

def url
  @properties['url']
end