Class: Karaden::Param::Message::Bulk::BulkMessageDownloadParams

Inherits:
BulkMessageParams show all
Defined in:
lib/karaden/param/message/bulk/bulk_message_download_params.rb

Constant Summary collapse

DEFAULT_MAX_RETRIES =
2
MAX_MAX_RETRIES =
5
MIN_MAX_RETRIES =
1
DEFAULT_RETRY_INTERVAL =
20
MAX_RETRY_INTERVAL =
60
MIN_RETRY_INTERVAL =
10

Constants inherited from BulkMessageParams

Karaden::Param::Message::Bulk::BulkMessageParams::CONTEXT_PATH

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBulkMessageDownloadParams

Returns a new instance of BulkMessageDownloadParams.



15
16
17
18
19
20
21
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 15

def initialize()
  @id = nil
  @directory_path = nil
  @max_retries = DEFAULT_MAX_RETRIES
  @retry_interval = DEFAULT_RETRY_INTERVAL
  super
end

Instance Attribute Details

#directory_pathObject

Returns the value of attribute directory_path.



6
7
8
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 6

def directory_path
  @directory_path
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 6

def id
  @id
end

#max_retriesObject

Returns the value of attribute max_retries.



6
7
8
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 6

def max_retries
  @max_retries
end

#retry_intervalObject

Returns the value of attribute retry_interval.



6
7
8
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 6

def retry_interval
  @retry_interval
end

Class Method Details

.new_builderObject



63
64
65
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 63

def self.new_builder
  BulkMessageDownloadParamsBuilder.new
end

Instance Method Details

#validateObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/karaden/param/message/bulk/bulk_message_download_params.rb', line 23

def validate
  errors = Karaden::Model::KaradenObject.new
  has_error = false

  messages = validate_id
  unless messages.empty?
    errors.set_property('id', messages)
    has_error = true
  end

  messages = validate_directory_path
  unless messages.empty?
    errors.set_property('directory_path', messages)
    has_error = true
  end

  messages = validate_max_retries
  unless messages.empty?
    errors.set_property('max_retries', messages)
    has_error = true
  end

  messages = validate_retry_interval
  unless messages.empty?
    errors.set_property('retry_interval', messages)
    has_error = true
  end

  if has_error
    e = Karaden::Exception::InvalidParamsException.new
    error = Karaden::Model::Error.new
    error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
    error.set_property('errors', errors)
    e.error = error
    raise e
  end

  self
end