Class: ConstantContactClient::Provision
- Inherits:
-
Object
- Object
- ConstantContactClient::Provision
- Defined in:
- lib/constant_contact_client/models/provision.rb
Instance Attribute Summary collapse
-
#billing_locale ⇒ Object
The currency to use when billing the client account.
-
#contact_email ⇒ Object
A valid email address to associate with the client account.
-
#contact_phone ⇒ Object
The contact phone number to associate with the client account.
-
#country_code ⇒ Object
The two-letter country code (ISO 3166-1 code) that specifies the country in which the client resides.
-
#enable_single_billing ⇒ Object
If a partner account is setup to allow for single billing and the
managed_site_owner
property is set totrue
, use this property to enable the single billing feature for the client account. -
#external_id ⇒ Object
The ID used to uniquely identify the client account for the external authenticator.
-
#external_provider ⇒ Object
The name of the provider who externally authenticates this customer.
-
#first_name ⇒ Object
The client account owner’s first name.
-
#gdpr_opt_out ⇒ Object
When creating accounts for users who have opted-out of any marketing communications, set the
gdpr_opt_out
totrue
so that Constant Contact does not send any marketing communications to the account. -
#last_name ⇒ Object
The client account owner’s last name.
-
#login_name ⇒ Object
A unique login name to associate with the client account.
-
#managed_site_owner ⇒ Object
By default, if the client account is setup as a managed account
managed_site_owner
is automatically set totrue
and attempting to override the setting withfalse
is ignored. -
#organization_name ⇒ Object
The name of organization that identifies the client account.
-
#organization_phone ⇒ Object
The organization phone number.
-
#partner_account_id ⇒ Object
The unique client account identifier that partners define and use for billing and reporting purposes.
-
#password ⇒ Object
Required if not using Single Sign On (SSO) or external authenticator.
-
#state_code ⇒ Object
The two-letter state code that represents the US state (
country_code
isUS
) or Canadian province (country_code
isCA
) where the client’s organization is physically located. -
#time_zone_id ⇒ Object
The offical time zone to use to represent the physical location associated with the client account.
-
#website ⇒ Object
The client’s website URL.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Provision
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Provision
Initializes the object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 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 |
# File 'lib/constant_contact_client/models/provision.rb', line 138 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `ConstantContactClient::Provision` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `ConstantContactClient::Provision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'contact_email') self.contact_email = attributes[:'contact_email'] else self.contact_email = nil end if attributes.key?(:'contact_phone') self.contact_phone = attributes[:'contact_phone'] end if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] else self.country_code = nil end if attributes.key?(:'organization_name') self.organization_name = attributes[:'organization_name'] end if attributes.key?(:'organization_phone') self.organization_phone = attributes[:'organization_phone'] end if attributes.key?(:'state_code') self.state_code = attributes[:'state_code'] else self.state_code = nil end if attributes.key?(:'time_zone_id') self.time_zone_id = attributes[:'time_zone_id'] end if attributes.key?(:'website') self.website = attributes[:'website'] end if attributes.key?(:'login_name') self.login_name = attributes[:'login_name'] else self.login_name = nil end if attributes.key?(:'password') self.password = attributes[:'password'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'partner_account_id') self.partner_account_id = attributes[:'partner_account_id'] end if attributes.key?(:'billing_locale') self.billing_locale = attributes[:'billing_locale'] end if attributes.key?(:'managed_site_owner') self.managed_site_owner = attributes[:'managed_site_owner'] end if attributes.key?(:'enable_single_billing') self.enable_single_billing = attributes[:'enable_single_billing'] end if attributes.key?(:'gdpr_opt_out') self.gdpr_opt_out = attributes[:'gdpr_opt_out'] end if attributes.key?(:'external_id') self.external_id = attributes[:'external_id'] end if attributes.key?(:'external_provider') self.external_provider = attributes[:'external_provider'] end end |
Instance Attribute Details
#billing_locale ⇒ Object
The currency to use when billing the client account. Valid values are: en_US
(default, US Dollars) or en_GB
(British Pounds).
58 59 60 |
# File 'lib/constant_contact_client/models/provision.rb', line 58 def billing_locale @billing_locale end |
#contact_email ⇒ Object
A valid email address to associate with the client account.
19 20 21 |
# File 'lib/constant_contact_client/models/provision.rb', line 19 def contact_email @contact_email end |
#contact_phone ⇒ Object
The contact phone number to associate with the client account.
22 23 24 |
# File 'lib/constant_contact_client/models/provision.rb', line 22 def contact_phone @contact_phone end |
#country_code ⇒ Object
The two-letter country code (ISO 3166-1 code) that specifies the country in which the client resides.
25 26 27 |
# File 'lib/constant_contact_client/models/provision.rb', line 25 def country_code @country_code end |
#enable_single_billing ⇒ Object
If a partner account is setup to allow for single billing and the managed_site_owner
property is set to true
, use this property to enable the single billing feature for the client account. See your account manager for more information.
64 65 66 |
# File 'lib/constant_contact_client/models/provision.rb', line 64 def enable_single_billing @enable_single_billing end |
#external_id ⇒ Object
The ID used to uniquely identify the client account for the external authenticator. Do not use the password
property when using an external authenticator.
70 71 72 |
# File 'lib/constant_contact_client/models/provision.rb', line 70 def external_id @external_id end |
#external_provider ⇒ Object
The name of the provider who externally authenticates this customer. For example, PayPal or Yahoo. Do not use the password
property when using an external authenticator.
73 74 75 |
# File 'lib/constant_contact_client/models/provision.rb', line 73 def external_provider @external_provider end |
#first_name ⇒ Object
The client account owner’s first name.
49 50 51 |
# File 'lib/constant_contact_client/models/provision.rb', line 49 def first_name @first_name end |
#gdpr_opt_out ⇒ Object
When creating accounts for users who have opted-out of any marketing communications, set the gdpr_opt_out
to true
so that Constant Contact does not send any marketing communications to the account.
67 68 69 |
# File 'lib/constant_contact_client/models/provision.rb', line 67 def gdpr_opt_out @gdpr_opt_out end |
#last_name ⇒ Object
The client account owner’s last name.
52 53 54 |
# File 'lib/constant_contact_client/models/provision.rb', line 52 def last_name @last_name end |
#login_name ⇒ Object
A unique login name to associate with the client account. The name must only contain alphanumeric characters and ‘-’, ‘_’, ‘@’,‘.’,‘+’.
43 44 45 |
# File 'lib/constant_contact_client/models/provision.rb', line 43 def login_name @login_name end |
#managed_site_owner ⇒ Object
By default, if the client account is setup as a managed account managed_site_owner
is automatically set to true
and attempting to override the setting with false
is ignored. This helps to avoid getting an account into an unknown state.
61 62 63 |
# File 'lib/constant_contact_client/models/provision.rb', line 61 def managed_site_owner @managed_site_owner end |
#organization_name ⇒ Object
The name of organization that identifies the client account.
28 29 30 |
# File 'lib/constant_contact_client/models/provision.rb', line 28 def organization_name @organization_name end |
#organization_phone ⇒ Object
The organization phone number. To set the organization phone number using the user interface, select My Settings and in the Organization Information section, select Edit Organization Information.
31 32 33 |
# File 'lib/constant_contact_client/models/provision.rb', line 31 def organization_phone @organization_phone end |
#partner_account_id ⇒ Object
The unique client account identifier that partners define and use for billing and reporting purposes.
55 56 57 |
# File 'lib/constant_contact_client/models/provision.rb', line 55 def partner_account_id @partner_account_id end |
#password ⇒ Object
Required if not using Single Sign On (SSO) or external authenticator. The password to associate with the client account. Passwords must be at least 8 characters and no more than 80 characters in length. Passwords can contain alphabetical letters (A-Z) and (a-z), numbers (0-9), special characters (! @ # $ etc.) and spaces. Passwords should not contain any part of your username and cannot be the same as your last password, or be listed on an industry database; we check for easily guessed or compromised passwords. Your new password is not returned in the response payload for security reasons. If using SSO authentication, use idp_provider
and idp_provider_id
instead of password
.
46 47 48 |
# File 'lib/constant_contact_client/models/provision.rb', line 46 def password @password end |
#state_code ⇒ Object
The two-letter state code that represents the US state (country_code
is US
) or Canadian province (country_code
is CA
) where the client’s organization is physically located. Leave the state_code
blank for non-US states and Canadian provinces.
34 35 36 |
# File 'lib/constant_contact_client/models/provision.rb', line 34 def state_code @state_code end |
#time_zone_id ⇒ Object
The offical time zone to use to represent the physical location associated with the client account.
37 38 39 |
# File 'lib/constant_contact_client/models/provision.rb', line 37 def time_zone_id @time_zone_id end |
#website ⇒ Object
The client’s website URL. Specifying the website URL eliminates the need for clients to provide that information. Requires a valid URL starting with http:// or https://.
40 41 42 |
# File 'lib/constant_contact_client/models/provision.rb', line 40 def website @website end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/constant_contact_client/models/provision.rb', line 636 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = ConstantContactClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
101 102 103 |
# File 'lib/constant_contact_client/models/provision.rb', line 101 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/constant_contact_client/models/provision.rb', line 76 def self.attribute_map { :'contact_email' => :'contact_email', :'contact_phone' => :'contact_phone', :'country_code' => :'country_code', :'organization_name' => :'organization_name', :'organization_phone' => :'organization_phone', :'state_code' => :'state_code', :'time_zone_id' => :'time_zone_id', :'website' => :'website', :'login_name' => :'login_name', :'password' => :'password', :'first_name' => :'first_name', :'last_name' => :'last_name', :'partner_account_id' => :'partner_account_id', :'billing_locale' => :'billing_locale', :'managed_site_owner' => :'managed_site_owner', :'enable_single_billing' => :'enable_single_billing', :'gdpr_opt_out' => :'gdpr_opt_out', :'external_id' => :'external_id', :'external_provider' => :'external_provider' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 |
# File 'lib/constant_contact_client/models/provision.rb', line 612 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
131 132 133 134 |
# File 'lib/constant_contact_client/models/provision.rb', line 131 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/constant_contact_client/models/provision.rb', line 106 def self.openapi_types { :'contact_email' => :'String', :'contact_phone' => :'String', :'country_code' => :'String', :'organization_name' => :'String', :'organization_phone' => :'String', :'state_code' => :'String', :'time_zone_id' => :'String', :'website' => :'String', :'login_name' => :'String', :'password' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'partner_account_id' => :'String', :'billing_locale' => :'String', :'managed_site_owner' => :'Boolean', :'enable_single_billing' => :'Boolean', :'gdpr_opt_out' => :'Boolean', :'external_id' => :'String', :'external_provider' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 |
# File 'lib/constant_contact_client/models/provision.rb', line 573 def ==(o) return true if self.equal?(o) self.class == o.class && contact_email == o.contact_email && contact_phone == o.contact_phone && country_code == o.country_code && organization_name == o.organization_name && organization_phone == o.organization_phone && state_code == o.state_code && time_zone_id == o.time_zone_id && website == o.website && login_name == o.login_name && password == o.password && first_name == o.first_name && last_name == o.last_name && partner_account_id == o.partner_account_id && billing_locale == o.billing_locale && managed_site_owner == o.managed_site_owner && enable_single_billing == o.enable_single_billing && gdpr_opt_out == o.gdpr_opt_out && external_id == o.external_id && external_provider == o.external_provider end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
707 708 709 710 711 712 713 714 715 716 717 718 719 |
# File 'lib/constant_contact_client/models/provision.rb', line 707 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
599 600 601 |
# File 'lib/constant_contact_client/models/provision.rb', line 599 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
605 606 607 |
# File 'lib/constant_contact_client/models/provision.rb', line 605 def hash [contact_email, contact_phone, country_code, organization_name, organization_phone, state_code, time_zone_id, website, login_name, password, first_name, last_name, partner_account_id, billing_locale, managed_site_owner, enable_single_billing, gdpr_opt_out, external_id, external_provider].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 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 |
# File 'lib/constant_contact_client/models/provision.rb', line 238 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @contact_email.nil? invalid_properties.push('invalid value for "contact_email", contact_email cannot be nil.') end if @contact_email.to_s.length > 80 invalid_properties.push('invalid value for "contact_email", the character length must be smaller than or equal to 80.') end if !@contact_phone.nil? && @contact_phone.to_s.length > 25 invalid_properties.push('invalid value for "contact_phone", the character length must be smaller than or equal to 25.') end if !@contact_phone.nil? && @contact_phone.to_s.length < 5 invalid_properties.push('invalid value for "contact_phone", the character length must be great than or equal to 5.') end if @country_code.nil? invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') end if @country_code.to_s.length > 3 invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 3.') end if @country_code.to_s.length < 2 invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 2.') end if !@organization_name.nil? && @organization_name.to_s.length > 50 invalid_properties.push('invalid value for "organization_name", the character length must be smaller than or equal to 50.') end if !@organization_name.nil? && @organization_name.to_s.length < 1 invalid_properties.push('invalid value for "organization_name", the character length must be great than or equal to 1.') end if !@organization_phone.nil? && @organization_phone.to_s.length > 25 invalid_properties.push('invalid value for "organization_phone", the character length must be smaller than or equal to 25.') end if !@organization_phone.nil? && @organization_phone.to_s.length < 5 invalid_properties.push('invalid value for "organization_phone", the character length must be great than or equal to 5.') end if @state_code.nil? invalid_properties.push('invalid value for "state_code", state_code cannot be nil.') end if @login_name.nil? invalid_properties.push('invalid value for "login_name", login_name cannot be nil.') end if @login_name.to_s.length > 50 invalid_properties.push('invalid value for "login_name", the character length must be smaller than or equal to 50.') end if @login_name.to_s.length < 6 invalid_properties.push('invalid value for "login_name", the character length must be great than or equal to 6.') end if !@password.nil? && @password.to_s.length > 80 invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 80.') end if !@password.nil? && @password.to_s.length < 8 invalid_properties.push('invalid value for "password", the character length must be great than or equal to 8.') end if !@first_name.nil? && @first_name.to_s.length > 80 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 80.') end if !@first_name.nil? && @first_name.to_s.length < 2 invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 2.') end if !@last_name.nil? && @last_name.to_s.length > 80 invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 80.') end if !@last_name.nil? && @last_name.to_s.length < 2 invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 2.') end if !@partner_account_id.nil? && @partner_account_id.to_s.length > 80 invalid_properties.push('invalid value for "partner_account_id", the character length must be smaller than or equal to 80.') end if !@external_id.nil? && @external_id.to_s.length > 255 invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end if !@external_provider.nil? && @external_provider.to_s.length > 80 invalid_properties.push('invalid value for "external_provider", the character length must be smaller than or equal to 80.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
683 684 685 |
# File 'lib/constant_contact_client/models/provision.rb', line 683 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
689 690 691 692 693 694 695 696 697 698 699 700 701 |
# File 'lib/constant_contact_client/models/provision.rb', line 689 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 |
#to_s ⇒ String
Returns the string representation of the object
677 678 679 |
# File 'lib/constant_contact_client/models/provision.rb', line 677 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
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 368 369 |
# File 'lib/constant_contact_client/models/provision.rb', line 342 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @contact_email.nil? return false if @contact_email.to_s.length > 80 return false if !@contact_phone.nil? && @contact_phone.to_s.length > 25 return false if !@contact_phone.nil? && @contact_phone.to_s.length < 5 return false if @country_code.nil? return false if @country_code.to_s.length > 3 return false if @country_code.to_s.length < 2 return false if !@organization_name.nil? && @organization_name.to_s.length > 50 return false if !@organization_name.nil? && @organization_name.to_s.length < 1 return false if !@organization_phone.nil? && @organization_phone.to_s.length > 25 return false if !@organization_phone.nil? && @organization_phone.to_s.length < 5 return false if @state_code.nil? return false if @login_name.nil? return false if @login_name.to_s.length > 50 return false if @login_name.to_s.length < 6 return false if !@password.nil? && @password.to_s.length > 80 return false if !@password.nil? && @password.to_s.length < 8 return false if !@first_name.nil? && @first_name.to_s.length > 80 return false if !@first_name.nil? && @first_name.to_s.length < 2 return false if !@last_name.nil? && @last_name.to_s.length > 80 return false if !@last_name.nil? && @last_name.to_s.length < 2 return false if !@partner_account_id.nil? && @partner_account_id.to_s.length > 80 return false if !@external_id.nil? && @external_id.to_s.length > 255 return false if !@external_provider.nil? && @external_provider.to_s.length > 80 true end |