Class: Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that the Campaign belongs to.
-
#age_gated ⇒ Boolean
A boolean that specifies whether campaign is age gated or not.
-
#brand_registration_sid ⇒ String
The unique string to identify the A2P brand.
-
#campaign_id ⇒ String
The Campaign Registry (TCR) Campaign ID.
-
#campaign_status ⇒ String
Campaign status.
-
#context ⇒ UsAppToPersonContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the UsAppToPersonInstance.
-
#description ⇒ String
A short description of what this SMS campaign does.
-
#direct_lending ⇒ Boolean
A boolean that specifies whether campaign allows direct lending or not.
-
#errors ⇒ Array<Hash>
Details indicating why a campaign registration failed.
-
#fetch ⇒ UsAppToPersonInstance
Fetch the UsAppToPersonInstance.
-
#has_embedded_links ⇒ Boolean
Indicate that this SMS campaign will send messages that contain links.
-
#has_embedded_phone ⇒ Boolean
Indicates that this SMS campaign will send messages that contain phone numbers.
-
#help_keywords ⇒ Array<String>
End users should be able to text in a keyword to receive help.
-
#help_message ⇒ String
When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information.
-
#initialize(version, payload, messaging_service_sid: nil, sid: nil) ⇒ UsAppToPersonInstance
constructor
Initialize the UsAppToPersonInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#is_externally_registered ⇒ Boolean
Indicates whether the campaign was registered externally or not.
-
#message_flow ⇒ String
Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages.
-
#message_samples ⇒ Array<String>
An array of sample message strings, min two and max five.
-
#messaging_service_sid ⇒ String
The SID of the [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with.
-
#mock ⇒ Boolean
A boolean that specifies whether campaign is a mock or not.
-
#opt_in_keywords ⇒ Array<String>
If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided.
-
#opt_in_message ⇒ String
If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided.
-
#opt_out_keywords ⇒ Array<String>
End users should be able to text in a keyword to stop receiving messages from this campaign.
-
#opt_out_message ⇒ String
Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent.
-
#rate_limits ⇒ Hash
Rate limit and/or classification set by each carrier, Ex.
-
#sid ⇒ String
The unique string that identifies a US A2P Compliance resource ‘QE2c6890da8086d771620e9b13fadeba0b`.
-
#subscriber_opt_in ⇒ Boolean
A boolean that specifies whether campaign has Subscriber Optin or not.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil) ⇒ UsAppToPersonInstance
Update the UsAppToPersonInstance.
-
#url ⇒ String
The absolute URL of the US App to Person resource.
-
#us_app_to_person_usecase ⇒ String
A2P Campaign Use Case.
Constructor Details
#initialize(version, payload, messaging_service_sid: nil, sid: nil) ⇒ UsAppToPersonInstance
Initialize the UsAppToPersonInstance
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 329 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'], 'subscriber_opt_in' => payload['subscriber_opt_in'], 'age_gated' => payload['age_gated'], 'direct_lending' => payload['direct_lending'], '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'], 'errors' => payload['errors'], } # Context @instance_context = nil @params = { 'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that the Campaign belongs to.
388 389 390 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 388 def account_sid @properties['account_sid'] end |
#age_gated ⇒ Boolean
Returns A boolean that specifies whether campaign is age gated or not.
442 443 444 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 442 def age_gated @properties['age_gated'] end |
#brand_registration_sid ⇒ String
Returns The unique string to identify the A2P brand.
394 395 396 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 394 def brand_registration_sid @properties['brand_registration_sid'] end |
#campaign_id ⇒ String
Returns The Campaign Registry (TCR) Campaign ID.
460 461 462 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 460 def campaign_id @properties['campaign_id'] end |
#campaign_status ⇒ String
Returns Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED.
454 455 456 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 454 def campaign_status @properties['campaign_status'] end |
#context ⇒ UsAppToPersonContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 373 def context unless @instance_context @instance_context = UsAppToPersonContext.new(@version , @params['messaging_service_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
520 521 522 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 520 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
526 527 528 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 526 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the UsAppToPersonInstance
551 552 553 554 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 551 def delete context.delete end |
#description ⇒ String
Returns A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
406 407 408 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 406 def description @properties['description'] end |
#direct_lending ⇒ Boolean
Returns A boolean that specifies whether campaign allows direct lending or not.
448 449 450 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 448 def direct_lending @properties['direct_lending'] end |
#errors ⇒ Array<Hash>
Returns Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements.
544 545 546 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 544 def errors @properties['errors'] end |
#fetch ⇒ UsAppToPersonInstance
Fetch the UsAppToPersonInstance
559 560 561 562 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 559 def fetch context.fetch end |
#has_embedded_links ⇒ Boolean
Returns Indicate that this SMS campaign will send messages that contain links.
424 425 426 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 424 def @properties['has_embedded_links'] end |
#has_embedded_phone ⇒ Boolean
Returns Indicates that this SMS campaign will send messages that contain phone numbers.
430 431 432 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 430 def @properties['has_embedded_phone'] end |
#help_keywords ⇒ Array<String>
Returns End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio’s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.
514 515 516 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 514 def help_keywords @properties['help_keywords'] end |
#help_message ⇒ String
Returns When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio’s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
496 497 498 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 496 def @properties['help_message'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
604 605 606 607 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 604 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.UsAppToPersonInstance #{values}>" end |
#is_externally_registered ⇒ Boolean
Returns Indicates whether the campaign was registered externally or not.
466 467 468 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 466 def is_externally_registered @properties['is_externally_registered'] end |
#message_flow ⇒ String
Returns Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.
478 479 480 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 478 def @properties['message_flow'] end |
#message_samples ⇒ Array<String>
Returns An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars.
412 413 414 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 412 def @properties['message_samples'] end |
#messaging_service_sid ⇒ String
Returns The SID of the [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with.
400 401 402 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 400 def messaging_service_sid @properties['messaging_service_sid'] end |
#mock ⇒ Boolean
Returns A boolean that specifies whether campaign is a mock or not. Mock campaigns will be automatically created if using a mock brand. Mock campaigns should only be used for testing purposes.
538 539 540 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 538 def mock @properties['mock'] end |
#opt_in_keywords ⇒ Array<String>
Returns If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum.
502 503 504 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 502 def opt_in_keywords @properties['opt_in_keywords'] end |
#opt_in_message ⇒ String
Returns If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum.
484 485 486 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 484 def @properties['opt_in_message'] end |
#opt_out_keywords ⇒ Array<String>
Returns End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio’s Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.
508 509 510 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 508 def opt_out_keywords @properties['opt_out_keywords'] end |
#opt_out_message ⇒ String
Returns Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio’s Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
490 491 492 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 490 def @properties['opt_out_message'] end |
#rate_limits ⇒ Hash
Returns Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile.
472 473 474 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 472 def rate_limits @properties['rate_limits'] end |
#sid ⇒ String
Returns The unique string that identifies a US A2P Compliance resource ‘QE2c6890da8086d771620e9b13fadeba0b`.
382 383 384 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 382 def sid @properties['sid'] end |
#subscriber_opt_in ⇒ Boolean
Returns A boolean that specifies whether campaign has Subscriber Optin or not.
436 437 438 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 436 def subscriber_opt_in @properties['subscriber_opt_in'] end |
#to_s ⇒ Object
Provide a user friendly representation
597 598 599 600 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 597 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.UsAppToPersonInstance #{values}>" end |
#update(has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil) ⇒ UsAppToPersonInstance
Update the UsAppToPersonInstance
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 574 def update( has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil ) context.update( has_embedded_links: , has_embedded_phone: , message_samples: , message_flow: , description: description, age_gated: age_gated, direct_lending: direct_lending, ) end |
#url ⇒ String
Returns The absolute URL of the US App to Person resource.
532 533 534 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 532 def url @properties['url'] end |
#us_app_to_person_usecase ⇒ String
Returns A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR…]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand.
418 419 420 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 418 def us_app_to_person_usecase @properties['us_app_to_person_usecase'] end |