Class: Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, messaging_service_sid: nil, sid: nil) ⇒ UsAppToPersonInstance

Initialize the UsAppToPersonInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • messaging_service_sid (String) (defaults to: nil)

    The SID of the Messaging Service that the resource is associated with.

  • sid (String) (defaults to: nil)

    The SID of the US A2P Compliance resource to fetch ‘QE2c6890da8086d771620e9b13fadeba0b`.



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 276

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

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'brand_registration_sid' => payload['brand_registration_sid'],
      'messaging_service_sid' => payload['messaging_service_sid'],
      'description' => payload['description'],
      'message_samples' => payload['message_samples'],
      'us_app_to_person_usecase' => payload['us_app_to_person_usecase'],
      'has_embedded_links' => payload['has_embedded_links'],
      'has_embedded_phone' => payload['has_embedded_phone'],
      'campaign_status' => payload['campaign_status'],
      'campaign_id' => payload['campaign_id'],
      'is_externally_registered' => payload['is_externally_registered'],
      'rate_limits' => payload['rate_limits'],
      'message_flow' => payload['message_flow'],
      'opt_in_message' => payload['opt_in_message'],
      'opt_out_message' => payload['opt_out_message'],
      'help_message' => payload['help_message'],
      'opt_in_keywords' => payload['opt_in_keywords'],
      'opt_out_keywords' => payload['opt_out_keywords'],
      'help_keywords' => payload['help_keywords'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
      'mock' => payload['mock'],
  }

  # Context
  @instance_context = nil
  @params = {'messaging_service_sid' => messaging_service_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



335
336
337
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 335

def 
  @properties['account_sid']
end

#brand_registration_sidString

Returns A2P Brand Registration SID.

Returns:

  • (String)

    A2P Brand Registration SID



341
342
343
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 341

def brand_registration_sid
  @properties['brand_registration_sid']
end

#campaign_idString

Returns The Campaign Registry (TCR) Campaign ID.

Returns:

  • (String)

    The Campaign Registry (TCR) Campaign ID.



389
390
391
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 389

def campaign_id
  @properties['campaign_id']
end

#campaign_statusString

Returns Campaign status.

Returns:

  • (String)

    Campaign status



383
384
385
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 383

def campaign_status
  @properties['campaign_status']
end

#contextUsAppToPersonContext

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

Returns:



316
317
318
319
320
321
322
323
324
325
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 316

def context
  unless @instance_context
    @instance_context = UsAppToPersonContext.new(
        @version,
        @params['messaging_service_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



449
450
451
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 449

def date_created
  @properties['date_created']
end

#date_updatedTime

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

Returns:

  • (Time)

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



455
456
457
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 455

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the UsAppToPersonInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



474
475
476
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 474

def delete
  context.delete
end

#descriptionString

Returns A short description of what this SMS campaign does.

Returns:

  • (String)

    A short description of what this SMS campaign does



353
354
355
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 353

def description
  @properties['description']
end

#fetchUsAppToPersonInstance

Fetch the UsAppToPersonInstance

Returns:



481
482
483
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 481

def fetch
  context.fetch
end

Returns Indicate that this SMS campaign will send messages that contain links.

Returns:

  • (Boolean)

    Indicate that this SMS campaign will send messages that contain links



371
372
373
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 371

def has_embedded_links
  @properties['has_embedded_links']
end

#has_embedded_phoneBoolean

Returns Indicates that this SMS campaign will send messages that contain phone numbers.

Returns:

  • (Boolean)

    Indicates that this SMS campaign will send messages that contain phone numbers



377
378
379
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 377

def has_embedded_phone
  @properties['has_embedded_phone']
end

#help_keywordsArray[String]

Returns Help Keywords.

Returns:

  • (Array[String])

    Help Keywords



443
444
445
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 443

def help_keywords
  @properties['help_keywords']
end

#help_messageString

Returns Help Message.

Returns:

  • (String)

    Help Message



425
426
427
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 425

def help_message
  @properties['help_message']
end

#inspectObject

Provide a detailed, user friendly representation



494
495
496
497
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 494

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

#is_externally_registeredBoolean

Returns Indicates whether the campaign was registered externally or not.

Returns:

  • (Boolean)

    Indicates whether the campaign was registered externally or not



395
396
397
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 395

def is_externally_registered
  @properties['is_externally_registered']
end

#message_flowString

Returns Consumer opt-in flow.

Returns:

  • (String)

    Consumer opt-in flow



407
408
409
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 407

def message_flow
  @properties['message_flow']
end

#message_samplesArray[String]

Returns Message samples.

Returns:

  • (Array[String])

    Message samples



359
360
361
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 359

def message_samples
  @properties['message_samples']
end

#messaging_service_sidString

Returns The SID of the Messaging Service the resource is associated with.

Returns:

  • (String)

    The SID of the Messaging Service the resource is associated with



347
348
349
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 347

def messaging_service_sid
  @properties['messaging_service_sid']
end

#mockBoolean

Returns A boolean that specifies whether campaign is a mock or not.

Returns:

  • (Boolean)

    A boolean that specifies whether campaign is a mock or not.



467
468
469
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 467

def mock
  @properties['mock']
end

#opt_in_keywordsArray[String]

Returns Opt In Keywords.

Returns:

  • (Array[String])

    Opt In Keywords



431
432
433
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 431

def opt_in_keywords
  @properties['opt_in_keywords']
end

#opt_in_messageString

Returns Opt In Message.

Returns:

  • (String)

    Opt In Message



413
414
415
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 413

def opt_in_message
  @properties['opt_in_message']
end

#opt_out_keywordsArray[String]

Returns Opt Out Keywords.

Returns:

  • (Array[String])

    Opt Out Keywords



437
438
439
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 437

def opt_out_keywords
  @properties['opt_out_keywords']
end

#opt_out_messageString

Returns Opt Out Message.

Returns:

  • (String)

    Opt Out Message



419
420
421
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 419

def opt_out_message
  @properties['opt_out_message']
end

#rate_limitsHash

Returns Rate limit and/or classification set by each carrier.

Returns:

  • (Hash)

    Rate limit and/or classification set by each carrier



401
402
403
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 401

def rate_limits
  @properties['rate_limits']
end

#sidString

Returns The unique string that identifies a US A2P Compliance resource.

Returns:

  • (String)

    The unique string that identifies a US A2P Compliance resource



329
330
331
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 329

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



487
488
489
490
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 487

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

#urlString

Returns The absolute URL of the US App to Person resource.

Returns:

  • (String)

    The absolute URL of the US App to Person resource



461
462
463
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 461

def url
  @properties['url']
end

#us_app_to_person_usecaseString

Returns A2P Campaign Use Case.

Returns:

  • (String)

    A2P Campaign Use Case.



365
366
367
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 365

def us_app_to_person_usecase
  @properties['us_app_to_person_usecase']
end