Class: Norbelys::ProgramDetail
- Inherits:
-
Object
- Object
- Norbelys::ProgramDetail
- Defined in:
- lib/norbelys/models/program_detail.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#active_days ⇒ Object
Returns the value of attribute active_days.
-
#add_unsubscribe ⇒ Object
Attach RFC 8058 one-click unsubscribe headers + footer.
-
#archived_at ⇒ Object
Returns the value of attribute archived_at.
-
#auto_pause_on_company_reply ⇒ Object
Pause every lead at a company once one of them replies.
-
#bounce_pause_threshold ⇒ Object
Auto-pause when the bounce rate reaches this percent; 0 disables.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
The program id.
-
#jitter_max_seconds ⇒ Object
Random extra wait per send, upper bound (seconds).
-
#jitter_min_seconds ⇒ Object
Random extra wait per send, lower bound (seconds).
-
#kind ⇒ Object
Kind of sending;
cold_sequenceis the only kind today. -
#name ⇒ Object
Display name.
-
#new_per_day ⇒ Object
New leads started per day for the WHOLE campaign, shared across all its mailboxes (follow-ups are not counted).
-
#object ⇒ Object
Returns the value of attribute object.
-
#paused_at ⇒ Object
Returns the value of attribute paused_at.
-
#paused_meta ⇒ Object
Returns the value of attribute paused_meta.
-
#paused_reason ⇒ Object
Returns the value of attribute paused_reason.
-
#plain_text_mode ⇒ Object
Send the body as plain text only: no HTML part, open pixel, or link tracking.
-
#send_interval_minutes ⇒ Object
Minutes between sends from one mailbox.
-
#senders ⇒ Object
The attached mailboxes — present when expand=senders.
-
#spam_pause_threshold ⇒ Object
Auto-pause when the spam-complaint rate reaches this percent; 0 disables.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#stats ⇒ Object
Returns the value of attribute stats.
-
#status ⇒ Object
Lifecycle status:
draft,active,paused,done. -
#steps ⇒ Object
The cadence with arms — present when expand=steps (always returned by create/update).
-
#stop_condition ⇒ Object
Engagement that pulls a lead out of the cadence:
reply,click,open,none. -
#timezone ⇒ Object
IANA timezone the window applies in.
-
#track_clicks ⇒ Object
Rewrite links to track clicks.
-
#track_opens ⇒ Object
Insert the open pixel.
-
#tracking_domain_id ⇒ Object
Returns the value of attribute tracking_domain_id.
-
#unsubscribe_text ⇒ Object
Returns the value of attribute unsubscribe_text.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#variant_distribution ⇒ Object
How A/B arms are spread across leads with no decided winner:
pattern(deterministic per-lead hash) orrandom(independent roll per lead). -
#window_from ⇒ Object
Returns the value of attribute window_from.
-
#window_to ⇒ Object
Returns the value of attribute window_to.
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 = {}) ⇒ ProgramDetail
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 = {}) ⇒ ProgramDetail
Initializes the object
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 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 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 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/norbelys/models/program_detail.rb', line 234 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Norbelys::ProgramDetail` 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 `Norbelys::ProgramDetail`. 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?(:'active_days') if (value = attributes[:'active_days']).is_a?(Array) self.active_days = value end else self.active_days = nil end if attributes.key?(:'add_unsubscribe') self.add_unsubscribe = attributes[:'add_unsubscribe'] else self.add_unsubscribe = nil end if attributes.key?(:'archived_at') self.archived_at = attributes[:'archived_at'] end if attributes.key?(:'auto_pause_on_company_reply') self.auto_pause_on_company_reply = attributes[:'auto_pause_on_company_reply'] else self.auto_pause_on_company_reply = nil end if attributes.key?(:'bounce_pause_threshold') self.bounce_pause_threshold = attributes[:'bounce_pause_threshold'] else self.bounce_pause_threshold = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'jitter_max_seconds') self.jitter_max_seconds = attributes[:'jitter_max_seconds'] else self.jitter_max_seconds = nil end if attributes.key?(:'jitter_min_seconds') self.jitter_min_seconds = attributes[:'jitter_min_seconds'] else self.jitter_min_seconds = nil end if attributes.key?(:'kind') self.kind = attributes[:'kind'] else self.kind = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'new_per_day') self.new_per_day = attributes[:'new_per_day'] else self.new_per_day = nil end if attributes.key?(:'object') self.object = attributes[:'object'] end if attributes.key?(:'paused_at') self.paused_at = attributes[:'paused_at'] end if attributes.key?(:'paused_meta') self. = attributes[:'paused_meta'] else self. = nil end if attributes.key?(:'paused_reason') self.paused_reason = attributes[:'paused_reason'] else self.paused_reason = nil end if attributes.key?(:'plain_text_mode') self.plain_text_mode = attributes[:'plain_text_mode'] else self.plain_text_mode = nil end if attributes.key?(:'send_interval_minutes') self.send_interval_minutes = attributes[:'send_interval_minutes'] else self.send_interval_minutes = nil end if attributes.key?(:'spam_pause_threshold') self.spam_pause_threshold = attributes[:'spam_pause_threshold'] else self.spam_pause_threshold = nil end if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'stop_condition') self.stop_condition = attributes[:'stop_condition'] else self.stop_condition = nil end if attributes.key?(:'timezone') self.timezone = attributes[:'timezone'] else self.timezone = nil end if attributes.key?(:'track_clicks') self.track_clicks = attributes[:'track_clicks'] else self.track_clicks = nil end if attributes.key?(:'tracking_domain_id') self.tracking_domain_id = attributes[:'tracking_domain_id'] else self.tracking_domain_id = nil end if attributes.key?(:'track_opens') self.track_opens = attributes[:'track_opens'] else self.track_opens = nil end if attributes.key?(:'unsubscribe_text') self.unsubscribe_text = attributes[:'unsubscribe_text'] else self.unsubscribe_text = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end if attributes.key?(:'variant_distribution') self.variant_distribution = attributes[:'variant_distribution'] else self.variant_distribution = nil end if attributes.key?(:'window_from') self.window_from = attributes[:'window_from'] else self.window_from = nil end if attributes.key?(:'window_to') self.window_to = attributes[:'window_to'] else self.window_to = nil end if attributes.key?(:'stats') self.stats = attributes[:'stats'] else self.stats = nil end if attributes.key?(:'senders') if (value = attributes[:'senders']).is_a?(Array) self.senders = value end end if attributes.key?(:'steps') if (value = attributes[:'steps']).is_a?(Array) self.steps = value end end end |
Instance Attribute Details
#active_days ⇒ Object
Returns the value of attribute active_days.
18 19 20 |
# File 'lib/norbelys/models/program_detail.rb', line 18 def active_days @active_days end |
#add_unsubscribe ⇒ Object
Attach RFC 8058 one-click unsubscribe headers + footer.
21 22 23 |
# File 'lib/norbelys/models/program_detail.rb', line 21 def add_unsubscribe @add_unsubscribe end |
#archived_at ⇒ Object
Returns the value of attribute archived_at.
23 24 25 |
# File 'lib/norbelys/models/program_detail.rb', line 23 def archived_at @archived_at end |
#auto_pause_on_company_reply ⇒ Object
Pause every lead at a company once one of them replies.
26 27 28 |
# File 'lib/norbelys/models/program_detail.rb', line 26 def auto_pause_on_company_reply @auto_pause_on_company_reply end |
#bounce_pause_threshold ⇒ Object
Auto-pause when the bounce rate reaches this percent; 0 disables.
29 30 31 |
# File 'lib/norbelys/models/program_detail.rb', line 29 def bounce_pause_threshold @bounce_pause_threshold end |
#created_at ⇒ Object
Returns the value of attribute created_at.
31 32 33 |
# File 'lib/norbelys/models/program_detail.rb', line 31 def created_at @created_at end |
#id ⇒ Object
The program id.
34 35 36 |
# File 'lib/norbelys/models/program_detail.rb', line 34 def id @id end |
#jitter_max_seconds ⇒ Object
Random extra wait per send, upper bound (seconds).
37 38 39 |
# File 'lib/norbelys/models/program_detail.rb', line 37 def jitter_max_seconds @jitter_max_seconds end |
#jitter_min_seconds ⇒ Object
Random extra wait per send, lower bound (seconds).
40 41 42 |
# File 'lib/norbelys/models/program_detail.rb', line 40 def jitter_min_seconds @jitter_min_seconds end |
#kind ⇒ Object
Kind of sending; cold_sequence is the only kind today.
43 44 45 |
# File 'lib/norbelys/models/program_detail.rb', line 43 def kind @kind end |
#name ⇒ Object
Display name.
46 47 48 |
# File 'lib/norbelys/models/program_detail.rb', line 46 def name @name end |
#new_per_day ⇒ Object
New leads started per day for the WHOLE campaign, shared across all its mailboxes (follow-ups are not counted). 0 = no daily cap — new leads flow at mailbox capacity. Real throughput is always bounded by the mailboxes' own daily limits.
49 50 51 |
# File 'lib/norbelys/models/program_detail.rb', line 49 def new_per_day @new_per_day end |
#object ⇒ Object
Returns the value of attribute object.
51 52 53 |
# File 'lib/norbelys/models/program_detail.rb', line 51 def object @object end |
#paused_at ⇒ Object
Returns the value of attribute paused_at.
53 54 55 |
# File 'lib/norbelys/models/program_detail.rb', line 53 def paused_at @paused_at end |
#paused_meta ⇒ Object
Returns the value of attribute paused_meta.
55 56 57 |
# File 'lib/norbelys/models/program_detail.rb', line 55 def @paused_meta end |
#paused_reason ⇒ Object
Returns the value of attribute paused_reason.
57 58 59 |
# File 'lib/norbelys/models/program_detail.rb', line 57 def paused_reason @paused_reason end |
#plain_text_mode ⇒ Object
Send the body as plain text only: no HTML part, open pixel, or link tracking.
60 61 62 |
# File 'lib/norbelys/models/program_detail.rb', line 60 def plain_text_mode @plain_text_mode end |
#send_interval_minutes ⇒ Object
Minutes between sends from one mailbox.
63 64 65 |
# File 'lib/norbelys/models/program_detail.rb', line 63 def send_interval_minutes @send_interval_minutes end |
#senders ⇒ Object
The attached mailboxes — present when expand=senders.
101 102 103 |
# File 'lib/norbelys/models/program_detail.rb', line 101 def senders @senders end |
#spam_pause_threshold ⇒ Object
Auto-pause when the spam-complaint rate reaches this percent; 0 disables.
66 67 68 |
# File 'lib/norbelys/models/program_detail.rb', line 66 def spam_pause_threshold @spam_pause_threshold end |
#start_date ⇒ Object
Returns the value of attribute start_date.
68 69 70 |
# File 'lib/norbelys/models/program_detail.rb', line 68 def start_date @start_date end |
#stats ⇒ Object
Returns the value of attribute stats.
98 99 100 |
# File 'lib/norbelys/models/program_detail.rb', line 98 def stats @stats end |
#status ⇒ Object
Lifecycle status: draft, active, paused, done.
71 72 73 |
# File 'lib/norbelys/models/program_detail.rb', line 71 def status @status end |
#steps ⇒ Object
The cadence with arms — present when expand=steps (always returned by create/update).
104 105 106 |
# File 'lib/norbelys/models/program_detail.rb', line 104 def steps @steps end |
#stop_condition ⇒ Object
Engagement that pulls a lead out of the cadence: reply, click, open, none.
74 75 76 |
# File 'lib/norbelys/models/program_detail.rb', line 74 def stop_condition @stop_condition end |
#timezone ⇒ Object
IANA timezone the window applies in.
77 78 79 |
# File 'lib/norbelys/models/program_detail.rb', line 77 def timezone @timezone end |
#track_clicks ⇒ Object
Rewrite links to track clicks.
80 81 82 |
# File 'lib/norbelys/models/program_detail.rb', line 80 def track_clicks @track_clicks end |
#track_opens ⇒ Object
Insert the open pixel.
85 86 87 |
# File 'lib/norbelys/models/program_detail.rb', line 85 def track_opens @track_opens end |
#tracking_domain_id ⇒ Object
Returns the value of attribute tracking_domain_id.
82 83 84 |
# File 'lib/norbelys/models/program_detail.rb', line 82 def tracking_domain_id @tracking_domain_id end |
#unsubscribe_text ⇒ Object
Returns the value of attribute unsubscribe_text.
87 88 89 |
# File 'lib/norbelys/models/program_detail.rb', line 87 def unsubscribe_text @unsubscribe_text end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
89 90 91 |
# File 'lib/norbelys/models/program_detail.rb', line 89 def updated_at @updated_at end |
#variant_distribution ⇒ Object
How A/B arms are spread across leads with no decided winner: pattern (deterministic per-lead hash) or random (independent roll per lead).
92 93 94 |
# File 'lib/norbelys/models/program_detail.rb', line 92 def variant_distribution @variant_distribution end |
#window_from ⇒ Object
Returns the value of attribute window_from.
94 95 96 |
# File 'lib/norbelys/models/program_detail.rb', line 94 def window_from @window_from end |
#window_to ⇒ Object
Returns the value of attribute window_to.
96 97 98 |
# File 'lib/norbelys/models/program_detail.rb', line 96 def window_to @window_to end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 |
# File 'lib/norbelys/models/program_detail.rb', line 824 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 = Norbelys.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
169 170 171 |
# File 'lib/norbelys/models/program_detail.rb', line 169 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
129 130 131 132 133 134 135 136 137 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 |
# File 'lib/norbelys/models/program_detail.rb', line 129 def self.attribute_map { :'active_days' => :'activeDays', :'add_unsubscribe' => :'addUnsubscribe', :'archived_at' => :'archivedAt', :'auto_pause_on_company_reply' => :'autoPauseOnCompanyReply', :'bounce_pause_threshold' => :'bouncePauseThreshold', :'created_at' => :'createdAt', :'id' => :'id', :'jitter_max_seconds' => :'jitterMaxSeconds', :'jitter_min_seconds' => :'jitterMinSeconds', :'kind' => :'kind', :'name' => :'name', :'new_per_day' => :'newPerDay', :'object' => :'object', :'paused_at' => :'pausedAt', :'paused_meta' => :'pausedMeta', :'paused_reason' => :'pausedReason', :'plain_text_mode' => :'plainTextMode', :'send_interval_minutes' => :'sendIntervalMinutes', :'spam_pause_threshold' => :'spamPauseThreshold', :'start_date' => :'startDate', :'status' => :'status', :'stop_condition' => :'stopCondition', :'timezone' => :'timezone', :'track_clicks' => :'trackClicks', :'tracking_domain_id' => :'trackingDomainId', :'track_opens' => :'trackOpens', :'unsubscribe_text' => :'unsubscribeText', :'updated_at' => :'updatedAt', :'variant_distribution' => :'variantDistribution', :'window_from' => :'windowFrom', :'window_to' => :'windowTo', :'stats' => :'stats', :'senders' => :'senders', :'steps' => :'steps' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 |
# File 'lib/norbelys/models/program_detail.rb', line 800 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
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/norbelys/models/program_detail.rb', line 214 def self.openapi_nullable Set.new([ :'active_days', :'archived_at', :'created_at', :'object', :'paused_at', :'paused_meta', :'paused_reason', :'start_date', :'tracking_domain_id', :'unsubscribe_text', :'updated_at', :'window_from', :'window_to', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/norbelys/models/program_detail.rb', line 174 def self.openapi_types { :'active_days' => :'Array<Integer>', :'add_unsubscribe' => :'Boolean', :'archived_at' => :'Object', :'auto_pause_on_company_reply' => :'Boolean', :'bounce_pause_threshold' => :'Float', :'created_at' => :'Object', :'id' => :'String', :'jitter_max_seconds' => :'Integer', :'jitter_min_seconds' => :'Integer', :'kind' => :'String', :'name' => :'String', :'new_per_day' => :'Integer', :'object' => :'Object', :'paused_at' => :'Object', :'paused_meta' => :'ProgramPauseMeta', :'paused_reason' => :'String', :'plain_text_mode' => :'Boolean', :'send_interval_minutes' => :'Integer', :'spam_pause_threshold' => :'Float', :'start_date' => :'Object', :'status' => :'String', :'stop_condition' => :'String', :'timezone' => :'String', :'track_clicks' => :'Boolean', :'tracking_domain_id' => :'String', :'track_opens' => :'Boolean', :'unsubscribe_text' => :'String', :'updated_at' => :'Object', :'variant_distribution' => :'String', :'window_from' => :'String', :'window_to' => :'String', :'stats' => :'ProgramStats', :'senders' => :'Array<ProgramSenderRef>', :'steps' => :'Array<StepWithVariants>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
# File 'lib/norbelys/models/program_detail.rb', line 746 def ==(o) return true if self.equal?(o) self.class == o.class && active_days == o.active_days && add_unsubscribe == o.add_unsubscribe && archived_at == o.archived_at && auto_pause_on_company_reply == o.auto_pause_on_company_reply && bounce_pause_threshold == o.bounce_pause_threshold && created_at == o.created_at && id == o.id && jitter_max_seconds == o.jitter_max_seconds && jitter_min_seconds == o.jitter_min_seconds && kind == o.kind && name == o.name && new_per_day == o.new_per_day && object == o.object && paused_at == o.paused_at && == o. && paused_reason == o.paused_reason && plain_text_mode == o.plain_text_mode && send_interval_minutes == o.send_interval_minutes && spam_pause_threshold == o.spam_pause_threshold && start_date == o.start_date && status == o.status && stop_condition == o.stop_condition && timezone == o.timezone && track_clicks == o.track_clicks && tracking_domain_id == o.tracking_domain_id && track_opens == o.track_opens && unsubscribe_text == o.unsubscribe_text && updated_at == o.updated_at && variant_distribution == o.variant_distribution && window_from == o.window_from && window_to == o.window_to && stats == o.stats && senders == o.senders && steps == o.steps end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
895 896 897 898 899 900 901 902 903 904 905 906 907 |
# File 'lib/norbelys/models/program_detail.rb', line 895 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
787 788 789 |
# File 'lib/norbelys/models/program_detail.rb', line 787 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
793 794 795 |
# File 'lib/norbelys/models/program_detail.rb', line 793 def hash [active_days, add_unsubscribe, archived_at, auto_pause_on_company_reply, bounce_pause_threshold, created_at, id, jitter_max_seconds, jitter_min_seconds, kind, name, new_per_day, object, paused_at, , paused_reason, plain_text_mode, send_interval_minutes, spam_pause_threshold, start_date, status, stop_condition, timezone, track_clicks, tracking_domain_id, track_opens, unsubscribe_text, updated_at, variant_distribution, window_from, window_to, stats, senders, steps].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
# File 'lib/norbelys/models/program_detail.rb', line 444 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @add_unsubscribe.nil? invalid_properties.push('invalid value for "add_unsubscribe", add_unsubscribe cannot be nil.') end if @auto_pause_on_company_reply.nil? invalid_properties.push('invalid value for "auto_pause_on_company_reply", auto_pause_on_company_reply cannot be nil.') end if @bounce_pause_threshold.nil? invalid_properties.push('invalid value for "bounce_pause_threshold", bounce_pause_threshold cannot be nil.') end if @bounce_pause_threshold > 100 invalid_properties.push('invalid value for "bounce_pause_threshold", must be smaller than or equal to 100.') end if @bounce_pause_threshold < 0 invalid_properties.push('invalid value for "bounce_pause_threshold", must be greater than or equal to 0.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @jitter_max_seconds.nil? invalid_properties.push('invalid value for "jitter_max_seconds", jitter_max_seconds cannot be nil.') end if @jitter_max_seconds < 0 invalid_properties.push('invalid value for "jitter_max_seconds", must be greater than or equal to 0.') end if @jitter_min_seconds.nil? invalid_properties.push('invalid value for "jitter_min_seconds", jitter_min_seconds cannot be nil.') end if @jitter_min_seconds < 0 invalid_properties.push('invalid value for "jitter_min_seconds", must be greater than or equal to 0.') end if @kind.nil? invalid_properties.push('invalid value for "kind", kind cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @new_per_day.nil? invalid_properties.push('invalid value for "new_per_day", new_per_day cannot be nil.') end if @new_per_day < 0 invalid_properties.push('invalid value for "new_per_day", must be greater than or equal to 0.') end if @plain_text_mode.nil? invalid_properties.push('invalid value for "plain_text_mode", plain_text_mode cannot be nil.') end if @send_interval_minutes.nil? invalid_properties.push('invalid value for "send_interval_minutes", send_interval_minutes cannot be nil.') end if @send_interval_minutes < 0 invalid_properties.push('invalid value for "send_interval_minutes", must be greater than or equal to 0.') end if @spam_pause_threshold.nil? invalid_properties.push('invalid value for "spam_pause_threshold", spam_pause_threshold cannot be nil.') end if @spam_pause_threshold > 100 invalid_properties.push('invalid value for "spam_pause_threshold", must be smaller than or equal to 100.') end if @spam_pause_threshold < 0 invalid_properties.push('invalid value for "spam_pause_threshold", must be greater than or equal to 0.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @stop_condition.nil? invalid_properties.push('invalid value for "stop_condition", stop_condition cannot be nil.') end if @timezone.nil? invalid_properties.push('invalid value for "timezone", timezone cannot be nil.') end if @track_clicks.nil? invalid_properties.push('invalid value for "track_clicks", track_clicks cannot be nil.') end if @track_opens.nil? invalid_properties.push('invalid value for "track_opens", track_opens cannot be nil.') end if @variant_distribution.nil? invalid_properties.push('invalid value for "variant_distribution", variant_distribution cannot be nil.') end if @stats.nil? invalid_properties.push('invalid value for "stats", stats cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
871 872 873 |
# File 'lib/norbelys/models/program_detail.rb', line 871 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
877 878 879 880 881 882 883 884 885 886 887 888 889 |
# File 'lib/norbelys/models/program_detail.rb', line 877 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
865 866 867 |
# File 'lib/norbelys/models/program_detail.rb', line 865 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 |
# File 'lib/norbelys/models/program_detail.rb', line 560 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @add_unsubscribe.nil? return false if @auto_pause_on_company_reply.nil? return false if @bounce_pause_threshold.nil? return false if @bounce_pause_threshold > 100 return false if @bounce_pause_threshold < 0 return false if @id.nil? return false if @jitter_max_seconds.nil? return false if @jitter_max_seconds < 0 return false if @jitter_min_seconds.nil? return false if @jitter_min_seconds < 0 return false if @kind.nil? kind_validator = EnumAttributeValidator.new('String', ["cold_sequence"]) return false unless kind_validator.valid?(@kind) return false if @name.nil? return false if @new_per_day.nil? return false if @new_per_day < 0 paused_reason_validator = EnumAttributeValidator.new('String', ["manual", "bounce_rate", "spam_rate", "orphaned_sender"]) return false unless paused_reason_validator.valid?(@paused_reason) return false if @plain_text_mode.nil? return false if @send_interval_minutes.nil? return false if @send_interval_minutes < 0 return false if @spam_pause_threshold.nil? return false if @spam_pause_threshold > 100 return false if @spam_pause_threshold < 0 return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["draft", "active", "paused", "done"]) return false unless status_validator.valid?(@status) return false if @stop_condition.nil? stop_condition_validator = EnumAttributeValidator.new('String', ["reply", "click", "open", "none"]) return false unless stop_condition_validator.valid?(@stop_condition) return false if @timezone.nil? return false if @track_clicks.nil? return false if @track_opens.nil? return false if @variant_distribution.nil? variant_distribution_validator = EnumAttributeValidator.new('String', ["pattern", "random"]) return false unless variant_distribution_validator.valid?(@variant_distribution) return false if @stats.nil? true end |