Class: ConstantContactClient::PlanTiersObject
- Inherits:
-
Object
- Object
- ConstantContactClient::PlanTiersObject
- Defined in:
- lib/constant_contact_client/models/plan_tiers_object.rb
Overview
Specifies client billing plan details including the type of plan, the plan tiers used, the current billing status, and the day of the month that the client is billed. When a client account is first provisioned, the ‘plan_type` defaults to a `Trial` account. After you change an account `billing_status` from `Trial` to any other `billing_status`, you cannot change it back to a `Trial` account.
Instance Attribute Summary collapse
-
#billing_day_of_month ⇒ Object
This property is required when an account is not set up to use single billing.
-
#billing_status ⇒ Object
The client’s account billing status.
-
#current_tiers ⇒ Object
Lists the billing plan tiers that are currently associated with a client account.
-
#plan_type ⇒ Object
The billing plan that is associated with a client’s Constant Contact account.
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 = {}) ⇒ PlanTiersObject
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 = {}) ⇒ PlanTiersObject
Initializes the object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 64 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `ConstantContactClient::PlanTiersObject` 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::PlanTiersObject`. 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?(:'plan_type') self.plan_type = attributes[:'plan_type'] end if attributes.key?(:'current_tiers') if (value = attributes[:'current_tiers']).is_a?(Array) self.current_tiers = value end end if attributes.key?(:'billing_status') self.billing_status = attributes[:'billing_status'] end if attributes.key?(:'billing_day_of_month') self.billing_day_of_month = attributes[:'billing_day_of_month'] end end |
Instance Attribute Details
#billing_day_of_month ⇒ Object
This property is required when an account is not set up to use single billing. For trial accounts, the value is initially set to null. The value can only be changed when changing the plan_type from a trial account to a different type of plan, otherwise the value you enter is ignored. You can choose to enter a specific day of month or except the default value, which is the day that the plan_type value changes from a trial account plan to a different plan. Valid billing_day_of_month values include 1 through and including 31.
29 30 31 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 29 def billing_day_of_month @billing_day_of_month end |
#billing_status ⇒ Object
The client’s account billing status. When you first create a client account the billing_status defaults to Trial. Billing status values include: <ul> <li>Trial - A non-paying trial client account (default value).</li> <li>Open - An active and paying client account.</li> <li>Canceled - A canceled client account.</li> <li>Trial End - The trial period has ended for this client account.</li> </ul>
26 27 28 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 26 def billing_status @billing_status end |
#current_tiers ⇒ Object
Lists the billing plan tiers that are currently associated with a client account.
23 24 25 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 23 def current_tiers @current_tiers end |
#plan_type ⇒ Object
The billing plan that is associated with a client’s Constant Contact account. The billing plan determines which Constant Contact product features that the client account can access. If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older billing plans and plan_type enum values will continue to be supported. <ul> <li>TRIAL: Provides limited product features for a non-billed account and the account has an expiration date.</li> <li>BRONZE: Billable plan that provides basic email and marketing tools.</li> <li>SILVER: Billable plan that provides all features available in the BRONZE plan, and adds some additional email campaign to features, such as contact segmentation and social media ads integration.</li> <li>GOLD: Billable plan that provides all available product features.</li> </ul>
20 21 22 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 20 def plan_type @plan_type end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 161 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
42 43 44 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 42 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
32 33 34 35 36 37 38 39 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 32 def self.attribute_map { :'plan_type' => :'plan_type', :'current_tiers' => :'current_tiers', :'billing_status' => :'billing_status', :'billing_day_of_month' => :'billing_day_of_month' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 137 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
57 58 59 60 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 57 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
47 48 49 50 51 52 53 54 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 47 def self.openapi_types { :'plan_type' => :'String', :'current_tiers' => :'Array<PlanTiersObjectCurrentTiersInner>', :'billing_status' => :'String', :'billing_day_of_month' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
113 114 115 116 117 118 119 120 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 113 def ==(o) return true if self.equal?(o) self.class == o.class && plan_type == o.plan_type && current_tiers == o.current_tiers && billing_status == o.billing_status && billing_day_of_month == o.billing_day_of_month end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 232 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
124 125 126 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 124 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
130 131 132 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 130 def hash [plan_type, current_tiers, billing_status, billing_day_of_month].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
98 99 100 101 102 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 98 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
208 209 210 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 208 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 214 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
202 203 204 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 202 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
106 107 108 109 |
# File 'lib/constant_contact_client/models/plan_tiers_object.rb', line 106 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |