Class: Norbelys::Program

Inherits:
Object
  • Object
show all
Defined in:
lib/norbelys/models/program.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Program

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/norbelys/models/program.rb', line 220

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Norbelys::Program` 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::Program`. 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.paused_meta = attributes[:'paused_meta']
  else
    self.paused_meta = 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
end

Instance Attribute Details

#active_daysObject

Returns the value of attribute active_days.



18
19
20
# File 'lib/norbelys/models/program.rb', line 18

def active_days
  @active_days
end

#add_unsubscribeObject

Attach RFC 8058 one-click unsubscribe headers + footer.



21
22
23
# File 'lib/norbelys/models/program.rb', line 21

def add_unsubscribe
  @add_unsubscribe
end

#archived_atObject

Returns the value of attribute archived_at.



23
24
25
# File 'lib/norbelys/models/program.rb', line 23

def archived_at
  @archived_at
end

#auto_pause_on_company_replyObject

Pause every lead at a company once one of them replies.



26
27
28
# File 'lib/norbelys/models/program.rb', line 26

def auto_pause_on_company_reply
  @auto_pause_on_company_reply
end

#bounce_pause_thresholdObject

Auto-pause when the bounce rate reaches this percent; 0 disables.



29
30
31
# File 'lib/norbelys/models/program.rb', line 29

def bounce_pause_threshold
  @bounce_pause_threshold
end

#created_atObject

Returns the value of attribute created_at.



31
32
33
# File 'lib/norbelys/models/program.rb', line 31

def created_at
  @created_at
end

#idObject

The program id.



34
35
36
# File 'lib/norbelys/models/program.rb', line 34

def id
  @id
end

#jitter_max_secondsObject

Random extra wait per send, upper bound (seconds).



37
38
39
# File 'lib/norbelys/models/program.rb', line 37

def jitter_max_seconds
  @jitter_max_seconds
end

#jitter_min_secondsObject

Random extra wait per send, lower bound (seconds).



40
41
42
# File 'lib/norbelys/models/program.rb', line 40

def jitter_min_seconds
  @jitter_min_seconds
end

#kindObject

Kind of sending; cold_sequence is the only kind today.



43
44
45
# File 'lib/norbelys/models/program.rb', line 43

def kind
  @kind
end

#nameObject

Display name.



46
47
48
# File 'lib/norbelys/models/program.rb', line 46

def name
  @name
end

#new_per_dayObject

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.rb', line 49

def new_per_day
  @new_per_day
end

#objectObject

Returns the value of attribute object.



51
52
53
# File 'lib/norbelys/models/program.rb', line 51

def object
  @object
end

#paused_atObject

Returns the value of attribute paused_at.



53
54
55
# File 'lib/norbelys/models/program.rb', line 53

def paused_at
  @paused_at
end

#paused_metaObject

Returns the value of attribute paused_meta.



55
56
57
# File 'lib/norbelys/models/program.rb', line 55

def paused_meta
  @paused_meta
end

#paused_reasonObject

Returns the value of attribute paused_reason.



57
58
59
# File 'lib/norbelys/models/program.rb', line 57

def paused_reason
  @paused_reason
end

#plain_text_modeObject

Send the body as plain text only: no HTML part, open pixel, or link tracking.



60
61
62
# File 'lib/norbelys/models/program.rb', line 60

def plain_text_mode
  @plain_text_mode
end

#send_interval_minutesObject

Minutes between sends from one mailbox.



63
64
65
# File 'lib/norbelys/models/program.rb', line 63

def send_interval_minutes
  @send_interval_minutes
end

#spam_pause_thresholdObject

Auto-pause when the spam-complaint rate reaches this percent; 0 disables.



66
67
68
# File 'lib/norbelys/models/program.rb', line 66

def spam_pause_threshold
  @spam_pause_threshold
end

#start_dateObject

Returns the value of attribute start_date.



68
69
70
# File 'lib/norbelys/models/program.rb', line 68

def start_date
  @start_date
end

#statusObject

Lifecycle status: draft, active, paused, done.



71
72
73
# File 'lib/norbelys/models/program.rb', line 71

def status
  @status
end

#stop_conditionObject

Engagement that pulls a lead out of the cadence: reply, click, open, none.



74
75
76
# File 'lib/norbelys/models/program.rb', line 74

def stop_condition
  @stop_condition
end

#timezoneObject

IANA timezone the window applies in.



77
78
79
# File 'lib/norbelys/models/program.rb', line 77

def timezone
  @timezone
end

#track_clicksObject

Rewrite links to track clicks.



80
81
82
# File 'lib/norbelys/models/program.rb', line 80

def track_clicks
  @track_clicks
end

#track_opensObject

Insert the open pixel.



85
86
87
# File 'lib/norbelys/models/program.rb', line 85

def track_opens
  @track_opens
end

#tracking_domain_idObject

Returns the value of attribute tracking_domain_id.



82
83
84
# File 'lib/norbelys/models/program.rb', line 82

def tracking_domain_id
  @tracking_domain_id
end

#unsubscribe_textObject

Returns the value of attribute unsubscribe_text.



87
88
89
# File 'lib/norbelys/models/program.rb', line 87

def unsubscribe_text
  @unsubscribe_text
end

#updated_atObject

Returns the value of attribute updated_at.



89
90
91
# File 'lib/norbelys/models/program.rb', line 89

def updated_at
  @updated_at
end

#variant_distributionObject

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.rb', line 92

def variant_distribution
  @variant_distribution
end

#window_fromObject

Returns the value of attribute window_from.



94
95
96
# File 'lib/norbelys/models/program.rb', line 94

def window_from
  @window_from
end

#window_toObject

Returns the value of attribute window_to.



96
97
98
# File 'lib/norbelys/models/program.rb', line 96

def window_to
  @window_to
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File 'lib/norbelys/models/program.rb', line 784

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_attributesObject

Returns all the JSON keys this model knows about



158
159
160
# File 'lib/norbelys/models/program.rb', line 158

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



121
122
123
124
125
126
127
128
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
# File 'lib/norbelys/models/program.rb', line 121

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'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/norbelys/models/program.rb', line 760

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_nullableObject

List of attributes with nullable: true



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/norbelys/models/program.rb', line 200

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_typesObject

Attribute type mapping.



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
# File 'lib/norbelys/models/program.rb', line 163

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'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/norbelys/models/program.rb', line 709

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 &&
      paused_meta == o.paused_meta &&
      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
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/norbelys/models/program.rb', line 855

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


747
748
749
# File 'lib/norbelys/models/program.rb', line 747

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



753
754
755
# File 'lib/norbelys/models/program.rb', line 753

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_meta, 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].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
441
442
443
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
# File 'lib/norbelys/models/program.rb', line 412

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

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



831
832
833
# File 'lib/norbelys/models/program.rb', line 831

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



837
838
839
840
841
842
843
844
845
846
847
848
849
# File 'lib/norbelys/models/program.rb', line 837

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



825
826
827
# File 'lib/norbelys/models/program.rb', line 825

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



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
557
558
559
560
561
562
563
# File 'lib/norbelys/models/program.rb', line 524

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)
  true
end