Class: Karaden::Param::Message::Bulk::BulkMessageCreateParams

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

Constant Summary

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

#initializeBulkMessageCreateParams

Returns a new instance of BulkMessageCreateParams.



8
9
10
11
# File 'lib/karaden/param/message/bulk/bulk_message_create_params.rb', line 8

def initialize()
  @bulk_file_id = nil
  super
end

Instance Attribute Details

#bulk_file_idObject

Returns the value of attribute bulk_file_id.



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

def bulk_file_id
  @bulk_file_id
end

Class Method Details

.new_builderObject



45
46
47
# File 'lib/karaden/param/message/bulk/bulk_message_create_params.rb', line 45

def self.new_builder
  BulkMessageCreateParamsBuilder.new
end

Instance Method Details

#to_dataObject



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

def to_data
  {
    bulk_file_id: @bulk_file_id
  }.reject { |_, value| value.nil? }
end

#to_pathObject



13
14
15
# File 'lib/karaden/param/message/bulk/bulk_message_create_params.rb', line 13

def to_path
  CONTEXT_PATH
end

#validateObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/karaden/param/message/bulk/bulk_message_create_params.rb', line 23

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

  messages = validate_bulk_file_id
  unless messages.empty?
    errors.set_property('bulk_file_id', 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