Class: Zernio::StartSmsRegistrationRequestCampaign
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::StartSmsRegistrationRequestCampaign
- Defined in:
- lib/zernio-sdk/models/start_sms_registration_request_campaign.rb
Overview
Required for 10DLC. What you'll send and how recipients opt in/out. The opt-in/opt-out/help auto-responses (optinMessage, optoutMessage, helpMessage) are optional: when omitted, a compliant, brand-named template with the carrier-required disclosures is generated for you. If you do send them, they must name the registered brand and carry the disclosures — submissions that don't are rewritten to the compliant template before the campaign is filed.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#age_gated ⇒ Object
Returns the value of attribute age_gated.
-
#description ⇒ Object
Returns the value of attribute description.
-
#direct_lending ⇒ Object
Returns the value of attribute direct_lending.
-
#embedded_link ⇒ Object
Whether messages carry links.
-
#embedded_phone ⇒ Object
Whether messages carry phone numbers.
-
#help_keywords ⇒ Object
Returns the value of attribute help_keywords.
-
#help_message ⇒ Object
Returns the value of attribute help_message.
-
#message_flow ⇒ Object
How a recipient ends up receiving your messages (the opt-in flow).
-
#number_pool ⇒ Object
Returns the value of attribute number_pool.
-
#optin_keywords ⇒ Object
Returns the value of attribute optin_keywords.
-
#optin_message ⇒ Object
Returns the value of attribute optin_message.
-
#optout_keywords ⇒ Object
Returns the value of attribute optout_keywords.
-
#optout_message ⇒ Object
Returns the value of attribute optout_message.
-
#privacy_policy_link ⇒ Object
Link to your privacy policy.
-
#sample1 ⇒ Object
Returns the value of attribute sample1.
-
#sample2 ⇒ Object
Second example message; carriers require two distinct samples, so it must differ from sample1.
-
#sub_usecases ⇒ Object
The concrete kinds of messages a MIXED campaign sends (the carrier registry requires 2-5, and reviewers match them against the sample messages).
-
#terms_and_conditions_link ⇒ Object
Link to your terms & conditions.
-
#usecase ⇒ Object
Returns the value of attribute usecase.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ StartSmsRegistrationRequestCampaign
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ StartSmsRegistrationRequestCampaign
Initializes the object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 154 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::StartSmsRegistrationRequestCampaign` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::StartSmsRegistrationRequestCampaign`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'usecase') self.usecase = attributes[:'usecase'] else self.usecase = nil end if attributes.key?(:'sub_usecases') if (value = attributes[:'sub_usecases']).is_a?(Array) self.sub_usecases = value end end if attributes.key?(:'description') self.description = attributes[:'description'] else self.description = nil end if attributes.key?(:'message_flow') self. = attributes[:'message_flow'] else self. = nil end if attributes.key?(:'sample1') self.sample1 = attributes[:'sample1'] else self.sample1 = nil end if attributes.key?(:'sample2') self.sample2 = attributes[:'sample2'] else self.sample2 = nil end if attributes.key?(:'help_message') self. = attributes[:'help_message'] end if attributes.key?(:'optin_keywords') self.optin_keywords = attributes[:'optin_keywords'] else self.optin_keywords = nil end if attributes.key?(:'optin_message') self. = attributes[:'optin_message'] end if attributes.key?(:'optout_keywords') self.optout_keywords = attributes[:'optout_keywords'] else self.optout_keywords = nil end if attributes.key?(:'optout_message') self. = attributes[:'optout_message'] end if attributes.key?(:'help_keywords') self.help_keywords = attributes[:'help_keywords'] else self.help_keywords = nil end if attributes.key?(:'embedded_link') self. = attributes[:'embedded_link'] end if attributes.key?(:'embedded_phone') self. = attributes[:'embedded_phone'] end if attributes.key?(:'number_pool') self.number_pool = attributes[:'number_pool'] end if attributes.key?(:'age_gated') self.age_gated = attributes[:'age_gated'] end if attributes.key?(:'direct_lending') self.direct_lending = attributes[:'direct_lending'] end if attributes.key?(:'privacy_policy_link') self.privacy_policy_link = attributes[:'privacy_policy_link'] end if attributes.key?(:'terms_and_conditions_link') self.terms_and_conditions_link = attributes[:'terms_and_conditions_link'] end end |
Instance Attribute Details
#age_gated ⇒ Object
Returns the value of attribute age_gated.
54 55 56 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 54 def age_gated @age_gated end |
#description ⇒ Object
Returns the value of attribute description.
24 25 26 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 24 def description @description end |
#direct_lending ⇒ Object
Returns the value of attribute direct_lending.
56 57 58 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 56 def direct_lending @direct_lending end |
#embedded_link ⇒ Object
Whether messages carry links. Auto-derived from the samples when omitted, so the declaration matches what the reviewer reads.
47 48 49 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 47 def @embedded_link end |
#embedded_phone ⇒ Object
Whether messages carry phone numbers. Auto-derived from the samples when omitted.
50 51 52 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 50 def @embedded_phone end |
#help_keywords ⇒ Object
Returns the value of attribute help_keywords.
44 45 46 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 44 def help_keywords @help_keywords end |
#help_message ⇒ Object
Returns the value of attribute help_message.
34 35 36 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 34 def @help_message end |
#message_flow ⇒ Object
How a recipient ends up receiving your messages (the opt-in flow). Include a link to the page or form where they opt in — carrier reviewers reject campaigns whose consent they can't verify.
27 28 29 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 27 def @message_flow end |
#number_pool ⇒ Object
Returns the value of attribute number_pool.
52 53 54 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 52 def number_pool @number_pool end |
#optin_keywords ⇒ Object
Returns the value of attribute optin_keywords.
36 37 38 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 36 def optin_keywords @optin_keywords end |
#optin_message ⇒ Object
Returns the value of attribute optin_message.
38 39 40 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 38 def @optin_message end |
#optout_keywords ⇒ Object
Returns the value of attribute optout_keywords.
40 41 42 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 40 def optout_keywords @optout_keywords end |
#optout_message ⇒ Object
Returns the value of attribute optout_message.
42 43 44 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 42 def @optout_message end |
#privacy_policy_link ⇒ Object
Link to your privacy policy. Recommended: reviewers check that it says mobile information is not sold or shared with third parties for promotional purposes. A bare domain is normalized to https://.
59 60 61 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 59 def privacy_policy_link @privacy_policy_link end |
#sample1 ⇒ Object
Returns the value of attribute sample1.
29 30 31 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 29 def sample1 @sample1 end |
#sample2 ⇒ Object
Second example message; carriers require two distinct samples, so it must differ from sample1.
32 33 34 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 32 def sample2 @sample2 end |
#sub_usecases ⇒ Object
The concrete kinds of messages a MIXED campaign sends (the carrier registry requires 2-5, and reviewers match them against the sample messages). Omitted: a default pair is applied for MIXED.
22 23 24 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 22 def sub_usecases @sub_usecases end |
#terms_and_conditions_link ⇒ Object
Link to your terms & conditions. A bare domain is normalized to https://.
62 63 64 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 62 def terms_and_conditions_link @terms_and_conditions_link end |
#usecase ⇒ Object
Returns the value of attribute usecase.
19 20 21 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 19 def usecase @usecase end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
112 113 114 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 112 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
117 118 119 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 117 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 87 def self.attribute_map { :'usecase' => :'usecase', :'sub_usecases' => :'subUsecases', :'description' => :'description', :'message_flow' => :'messageFlow', :'sample1' => :'sample1', :'sample2' => :'sample2', :'help_message' => :'helpMessage', :'optin_keywords' => :'optinKeywords', :'optin_message' => :'optinMessage', :'optout_keywords' => :'optoutKeywords', :'optout_message' => :'optoutMessage', :'help_keywords' => :'helpKeywords', :'embedded_link' => :'embeddedLink', :'embedded_phone' => :'embeddedPhone', :'number_pool' => :'numberPool', :'age_gated' => :'ageGated', :'direct_lending' => :'directLending', :'privacy_policy_link' => :'privacyPolicyLink', :'terms_and_conditions_link' => :'termsAndConditionsLink' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 587 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
147 148 149 150 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 147 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 122 def self.openapi_types { :'usecase' => :'String', :'sub_usecases' => :'Array<String>', :'description' => :'String', :'message_flow' => :'String', :'sample1' => :'String', :'sample2' => :'String', :'help_message' => :'String', :'optin_keywords' => :'String', :'optin_message' => :'String', :'optout_keywords' => :'String', :'optout_message' => :'String', :'help_keywords' => :'String', :'embedded_link' => :'Boolean', :'embedded_phone' => :'Boolean', :'number_pool' => :'Boolean', :'age_gated' => :'Boolean', :'direct_lending' => :'Boolean', :'privacy_policy_link' => :'String', :'terms_and_conditions_link' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 548 def ==(o) return true if self.equal?(o) self.class == o.class && usecase == o.usecase && sub_usecases == o.sub_usecases && description == o.description && == o. && sample1 == o.sample1 && sample2 == o.sample2 && == o. && optin_keywords == o.optin_keywords && == o. && optout_keywords == o.optout_keywords && == o. && help_keywords == o.help_keywords && == o. && == o. && number_pool == o.number_pool && age_gated == o.age_gated && direct_lending == o.direct_lending && privacy_policy_link == o.privacy_policy_link && terms_and_conditions_link == o.terms_and_conditions_link end |
#eql?(o) ⇒ Boolean
574 575 576 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 574 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
580 581 582 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 580 def hash [usecase, sub_usecases, description, , sample1, sample2, , optin_keywords, , optout_keywords, , help_keywords, , , number_pool, age_gated, direct_lending, privacy_policy_link, terms_and_conditions_link].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
265 266 267 268 269 270 271 272 273 274 275 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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 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 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 265 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @usecase.nil? invalid_properties.push('invalid value for "usecase", usecase cannot be nil.') end if !@sub_usecases.nil? && @sub_usecases.length > 5 invalid_properties.push('invalid value for "sub_usecases", number of items must be less than or equal to 5.') end if !@sub_usecases.nil? && @sub_usecases.length < 2 invalid_properties.push('invalid value for "sub_usecases", number of items must be greater than or equal to 2.') end if @description.nil? invalid_properties.push('invalid value for "description", description cannot be nil.') end if @description.to_s.length > 4096 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 4096.') end if @description.to_s.length < 40 invalid_properties.push('invalid value for "description", the character length must be greater than or equal to 40.') end if @message_flow.nil? invalid_properties.push('invalid value for "message_flow", message_flow cannot be nil.') end if @message_flow.to_s.length > 2048 invalid_properties.push('invalid value for "message_flow", the character length must be smaller than or equal to 2048.') end if @message_flow.to_s.length < 40 invalid_properties.push('invalid value for "message_flow", the character length must be greater than or equal to 40.') end if @sample1.nil? invalid_properties.push('invalid value for "sample1", sample1 cannot be nil.') end if @sample1.to_s.length < 20 invalid_properties.push('invalid value for "sample1", the character length must be greater than or equal to 20.') end if @sample2.nil? invalid_properties.push('invalid value for "sample2", sample2 cannot be nil.') end if @sample2.to_s.length < 20 invalid_properties.push('invalid value for "sample2", the character length must be greater than or equal to 20.') end if !@help_message.nil? && @help_message.to_s.length > 320 invalid_properties.push('invalid value for "help_message", the character length must be smaller than or equal to 320.') end if !@help_message.nil? && @help_message.to_s.length < 20 invalid_properties.push('invalid value for "help_message", the character length must be greater than or equal to 20.') end if @optin_keywords.nil? invalid_properties.push('invalid value for "optin_keywords", optin_keywords cannot be nil.') end if !@optin_message.nil? && @optin_message.to_s.length > 320 invalid_properties.push('invalid value for "optin_message", the character length must be smaller than or equal to 320.') end if !@optin_message.nil? && @optin_message.to_s.length < 20 invalid_properties.push('invalid value for "optin_message", the character length must be greater than or equal to 20.') end if @optout_keywords.nil? invalid_properties.push('invalid value for "optout_keywords", optout_keywords cannot be nil.') end if !@optout_message.nil? && @optout_message.to_s.length > 320 invalid_properties.push('invalid value for "optout_message", the character length must be smaller than or equal to 320.') end if !@optout_message.nil? && @optout_message.to_s.length < 20 invalid_properties.push('invalid value for "optout_message", the character length must be greater than or equal to 20.') end if @help_keywords.nil? invalid_properties.push('invalid value for "help_keywords", help_keywords cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 609 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/zernio-sdk/models/start_sms_registration_request_campaign.rb', line 361 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @usecase.nil? return false if !@sub_usecases.nil? && @sub_usecases.length > 5 return false if !@sub_usecases.nil? && @sub_usecases.length < 2 return false if @description.nil? return false if @description.to_s.length > 4096 return false if @description.to_s.length < 40 return false if @message_flow.nil? return false if @message_flow.to_s.length > 2048 return false if @message_flow.to_s.length < 40 return false if @sample1.nil? return false if @sample1.to_s.length < 20 return false if @sample2.nil? return false if @sample2.to_s.length < 20 return false if !@help_message.nil? && @help_message.to_s.length > 320 return false if !@help_message.nil? && @help_message.to_s.length < 20 return false if @optin_keywords.nil? return false if !@optin_message.nil? && @optin_message.to_s.length > 320 return false if !@optin_message.nil? && @optin_message.to_s.length < 20 return false if @optout_keywords.nil? return false if !@optout_message.nil? && @optout_message.to_s.length > 320 return false if !@optout_message.nil? && @optout_message.to_s.length < 20 return false if @help_keywords.nil? true end |