Class: Line::Bot::V2::MessagingApi::NarrowcastProgressResponse
- Inherits:
-
Object
- Object
- Line::Bot::V2::MessagingApi::NarrowcastProgressResponse
- Defined in:
- lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb
Overview
Instance Attribute Summary collapse
-
#accepted_time ⇒ String
Narrowcast message request accepted time in milliseconds.
-
#completed_time ⇒ String?
Processing of narrowcast message request completion time in milliseconds.
-
#error_code ⇒ Integer?
Error summary.
-
#failed_description ⇒ String?
The reason the message failed to be sent.
-
#failure_count ⇒ Integer?
The number of users who failed to send the message.
-
#phase ⇒ String
(‘waiting’|‘sending’|‘succeeded’|‘failed’) The current status.
-
#success_count ⇒ Integer?
The number of users who successfully received the message.
-
#target_count ⇒ Integer?
The number of intended recipients of the message.
Class Method Summary collapse
-
.create(args) ⇒ Line::Bot::V2::MessagingApi::NarrowcastProgressResponse
Create an instance of the class from a hash.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
True if the objects are equal, false otherwise.
-
#hash ⇒ Integer
Hash code of the object.
-
#initialize(phase:, success_count: nil, failure_count: nil, target_count: nil, failed_description: nil, error_code: nil, accepted_time:, completed_time: nil, **dynamic_attributes) ⇒ NarrowcastProgressResponse
constructor
A new instance of NarrowcastProgressResponse.
Constructor Details
#initialize(phase:, success_count: nil, failure_count: nil, target_count: nil, failed_description: nil, error_code: nil, accepted_time:, completed_time: nil, **dynamic_attributes) ⇒ NarrowcastProgressResponse
Returns a new instance of NarrowcastProgressResponse.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 49 def initialize( phase:, success_count: nil, failure_count: nil, target_count: nil, failed_description: nil, error_code: nil, accepted_time:, completed_time: nil, **dynamic_attributes ) @phase = phase @success_count = success_count @failure_count = failure_count @target_count = target_count @failed_description = failed_description @error_code = error_code @accepted_time = accepted_time @completed_time = completed_time dynamic_attributes.each do |key, value| self.class.attr_accessor key if value.is_a?(Hash) struct_klass = Struct.new(*value.keys.map(&:to_sym)) struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v } instance_variable_set("@#{key}", struct_klass.new(*struct_values)) else instance_variable_set("@#{key}", value) end end end |
Instance Attribute Details
#accepted_time ⇒ String
Returns Narrowcast message request accepted time in milliseconds. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC.
36 37 38 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 36 def accepted_time @accepted_time end |
#completed_time ⇒ String?
Returns Processing of narrowcast message request completion time in milliseconds. Returned when the phase property is succeeded or failed. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC.
39 40 41 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 39 def completed_time @completed_time end |
#error_code ⇒ Integer?
Returns Error summary. This is only included with a phase property value of failed. One of: ‘1`: An internal error occurred. `2`: An error occurred because there weren’t enough recipients. ‘3`: A conflict error of requests occurs because a request that has already been accepted is retried. `4`: An audience of less than 50 recipients is included as a condition of sending.
33 34 35 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 33 def error_code @error_code end |
#failed_description ⇒ String?
Returns The reason the message failed to be sent. This is only included with a ‘phase` property value of `failed`.
30 31 32 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 30 def failed_description @failed_description end |
#failure_count ⇒ Integer?
Returns The number of users who failed to send the message.
24 25 26 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 24 def failure_count @failure_count end |
#phase ⇒ String
Returns (‘waiting’|‘sending’|‘succeeded’|‘failed’) The current status. One of: ‘waiting`: Messages are not yet ready to be sent. They are currently being filtered or processed in some way. `sending`: Messages are currently being sent. `succeeded`: Messages were sent successfully. This may not mean the messages were successfully received. `failed`: Messages failed to be sent. Use the failedDescription property to find the cause of the failure.
18 19 20 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 18 def phase @phase end |
#success_count ⇒ Integer?
Returns The number of users who successfully received the message.
21 22 23 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 21 def success_count @success_count end |
#target_count ⇒ Integer?
Returns The number of intended recipients of the message.
27 28 29 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 27 def target_count @target_count end |
Class Method Details
.create(args) ⇒ Line::Bot::V2::MessagingApi::NarrowcastProgressResponse
Create an instance of the class from a hash
86 87 88 89 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 86 def self.create(args) # steep:ignore symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args) return new(**symbolized_args) # steep:ignore end |
Instance Method Details
#==(other) ⇒ Boolean
Returns true if the objects are equal, false otherwise.
93 94 95 96 97 98 99 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 93 def ==(other) return false unless self.class == other.class instance_variables.all? do |var| instance_variable_get(var) == other.instance_variable_get(var) end end |
#hash ⇒ Integer
Returns Hash code of the object.
102 103 104 |
# File 'lib/line/bot/v2/messaging_api/model/narrowcast_progress_response.rb', line 102 def hash [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash end |