line-bot-api 2.8.3 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/line/bot/v2/insight/api/insight_client.rb +166 -0
  3. data/lib/line/bot/v2/insight/core.rb +10 -0
  4. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_daily_response.rb +97 -0
  5. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_bounds.rb +85 -0
  6. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_click.rb +79 -0
  7. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_daily_metrics.rb +79 -0
  8. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_impression.rb +73 -0
  9. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_summary_response.rb +97 -0
  10. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_bounds.rb +85 -0
  11. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_click.rb +73 -0
  12. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_impression.rb +67 -0
  13. data/lib/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_metrics.rb +73 -0
  14. data/lib/line/bot/v2/manage_audience/model/audience_group.rb +2 -2
  15. data/lib/line/bot/version.rb +1 -1
  16. data/sig/line/bot/v2/insight/api/insight_client.rbs +92 -0
  17. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_daily_response.rbs +52 -0
  18. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_bounds.rbs +49 -0
  19. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_click.rbs +43 -0
  20. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_daily_metrics.rbs +46 -0
  21. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_daily_response_impression.rbs +40 -0
  22. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_summary_response.rbs +52 -0
  23. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_bounds.rbs +49 -0
  24. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_click.rbs +43 -0
  25. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_impression.rbs +40 -0
  26. data/sig/line/bot/v2/insight/model/get_rich_menu_insight_summary_response_metrics.rbs +43 -0
  27. data/sig/line/bot/v2/manage_audience/model/audience_group.rbs +3 -3
  28. metadata +21 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ab8cdcb8950bc7aeec772f0a9b9bf33ee9f88847a6e03cc6494e31f24f32269
4
- data.tar.gz: 850bff8627ff17a3eda76608481c95062511da1eafd0c2181735663628fcca74
3
+ metadata.gz: 591b6fa1640c88a50a6e09496245d4ba2732edb7ad997c7089c0821060b5875e
4
+ data.tar.gz: aab0b9c74007a7732f4e51d28e6caeb88c51a03559124556fe7d5dd6bb7dcff3
5
5
  SHA512:
6
- metadata.gz: 629ccf7854d4afb30029e2ff46dad7ed0089452874d3539c60dc1a47d4a10a22b23de9912588323e80eff8ee474898bdf5947be3ef4cada5fff4b04c8679cc00
7
- data.tar.gz: e2be6c4428ebab6071ef247623beb330ea7fda13e893c15c31adee66c1e28efba3ab3ef79365c3c3115ee251d07be9aff03d8a44171ae280e52d342003b23388
6
+ metadata.gz: f689ce6cd26aa001bde9006dab4988abcd5922d51e38554436ef9f4956031742e8f573b2f4e5423b802b760690d8a7699ab51fb0a77ede62ac1dce9e19d1f874
7
+ data.tar.gz: 1e2cbabf8ea11824b28c897d81705923629c75a50a7fe5ce2b0365cdd113011f4057865c4bf9d011ff471552f52a13c2f6dbdd2465eef49badf1a1fe02a26643
@@ -244,6 +244,172 @@ module Line
244
244
  response_body
245
245
  end
246
246
 
247
+ # Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted.
248
+ # This requests to <code>GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/daily</code>
249
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
250
+ #
251
+ # @param rich_menu_id [String] ID of the rich menu created via the Messaging API.
252
+ # @param from [String] Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
253
+ # @param to [String] End date of the aggregation period (inclusive). The end date can be specified for up to 99 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
254
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-daily
255
+ # @return [Array(Line::Bot::V2::Insight::GetRichMenuInsightDailyResponse, Integer, Hash{String => String})] when HTTP status code is 200
256
+ # @return [Array(Line::Bot::V2::Insight::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
257
+ # @return [Array(Line::Bot::V2::Insight::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404
258
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
259
+ def get_rich_menu_insight_daily_with_http_info(
260
+ rich_menu_id:,
261
+ from:,
262
+ to:
263
+ )
264
+ path = Line::Bot::V2::Utils.build_path("/v2/bot/insight/richmenu/{richMenuId}/daily", {
265
+ "richMenuId": rich_menu_id
266
+ })
267
+ query_params = {
268
+ "from": from,
269
+ "to": to
270
+ }.compact
271
+
272
+ response = @http_client.get(
273
+ path: path,
274
+ query_params: query_params,
275
+ )
276
+
277
+ case response.code.to_i
278
+ when 200
279
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
280
+ json.transform_keys! do |key|
281
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
282
+ end
283
+ response_body = Line::Bot::V2::Insight::GetRichMenuInsightDailyResponse.create(json)
284
+ [response_body, 200, response.each_header.to_h]
285
+ when 400
286
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
287
+ json.transform_keys! do |key|
288
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
289
+ end
290
+ response_body = Line::Bot::V2::Insight::ErrorResponse.create(json)
291
+ [response_body, 400, response.each_header.to_h]
292
+ when 404
293
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
294
+ json.transform_keys! do |key|
295
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
296
+ end
297
+ response_body = Line::Bot::V2::Insight::ErrorResponse.create(json)
298
+ [response_body, 404, response.each_header.to_h]
299
+ else
300
+ [response.body, response.code.to_i, response.each_header.to_h]
301
+ end
302
+ end
303
+
304
+ # Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted.
305
+ # This requests to <code>GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/daily</code>
306
+ # When you want to get HTTP status code or response headers, use {#get_rich_menu_insight_daily_with_http_info} instead of this.
307
+ #
308
+ # @param rich_menu_id [String] ID of the rich menu created via the Messaging API.
309
+ # @param from [String] Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
310
+ # @param to [String] End date of the aggregation period (inclusive). The end date can be specified for up to 99 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
311
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-daily
312
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponse] when HTTP status code is 200
313
+ # @return [Line::Bot::V2::Insight::ErrorResponse] when HTTP status code is 400
314
+ # @return [Line::Bot::V2::Insight::ErrorResponse] when HTTP status code is 404
315
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
316
+ def get_rich_menu_insight_daily(
317
+ rich_menu_id:,
318
+ from:,
319
+ to:
320
+ )
321
+ response_body, _status_code, _headers = get_rich_menu_insight_daily_with_http_info(
322
+ rich_menu_id: rich_menu_id,
323
+ from: from,
324
+ to: to
325
+ )
326
+
327
+ response_body
328
+ end
329
+
330
+ # Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted.
331
+ # This requests to <code>GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/summary</code>
332
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
333
+ #
334
+ # @param rich_menu_id [String] ID of the rich menu created via the Messaging API.
335
+ # @param from [String] Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
336
+ # @param to [String] End date of the aggregation period (inclusive). The end date can be specified for up to 396 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
337
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-summary
338
+ # @return [Array(Line::Bot::V2::Insight::GetRichMenuInsightSummaryResponse, Integer, Hash{String => String})] when HTTP status code is 200
339
+ # @return [Array(Line::Bot::V2::Insight::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
340
+ # @return [Array(Line::Bot::V2::Insight::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404
341
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
342
+ def get_rich_menu_insight_summary_with_http_info(
343
+ rich_menu_id:,
344
+ from:,
345
+ to:
346
+ )
347
+ path = Line::Bot::V2::Utils.build_path("/v2/bot/insight/richmenu/{richMenuId}/summary", {
348
+ "richMenuId": rich_menu_id
349
+ })
350
+ query_params = {
351
+ "from": from,
352
+ "to": to
353
+ }.compact
354
+
355
+ response = @http_client.get(
356
+ path: path,
357
+ query_params: query_params,
358
+ )
359
+
360
+ case response.code.to_i
361
+ when 200
362
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
363
+ json.transform_keys! do |key|
364
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
365
+ end
366
+ response_body = Line::Bot::V2::Insight::GetRichMenuInsightSummaryResponse.create(json)
367
+ [response_body, 200, response.each_header.to_h]
368
+ when 400
369
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
370
+ json.transform_keys! do |key|
371
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
372
+ end
373
+ response_body = Line::Bot::V2::Insight::ErrorResponse.create(json)
374
+ [response_body, 400, response.each_header.to_h]
375
+ when 404
376
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
377
+ json.transform_keys! do |key|
378
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
379
+ end
380
+ response_body = Line::Bot::V2::Insight::ErrorResponse.create(json)
381
+ [response_body, 404, response.each_header.to_h]
382
+ else
383
+ [response.body, response.code.to_i, response.each_header.to_h]
384
+ end
385
+ end
386
+
387
+ # Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted.
388
+ # This requests to <code>GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/summary</code>
389
+ # When you want to get HTTP status code or response headers, use {#get_rich_menu_insight_summary_with_http_info} instead of this.
390
+ #
391
+ # @param rich_menu_id [String] ID of the rich menu created via the Messaging API.
392
+ # @param from [String] Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
393
+ # @param to [String] End date of the aggregation period (inclusive). The end date can be specified for up to 396 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
394
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-summary
395
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightSummaryResponse] when HTTP status code is 200
396
+ # @return [Line::Bot::V2::Insight::ErrorResponse] when HTTP status code is 400
397
+ # @return [Line::Bot::V2::Insight::ErrorResponse] when HTTP status code is 404
398
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
399
+ def get_rich_menu_insight_summary(
400
+ rich_menu_id:,
401
+ from:,
402
+ to:
403
+ )
404
+ response_body, _status_code, _headers = get_rich_menu_insight_summary_with_http_info(
405
+ rich_menu_id: rich_menu_id,
406
+ from: from,
407
+ to: to
408
+ )
409
+
410
+ response_body
411
+ end
412
+
247
413
  # You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
248
414
  # This requests to <code>GET https://api.line.me/v2/bot/insight/message/event/aggregation</code>
249
415
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -22,6 +22,16 @@ require_relative './model/get_message_event_response_message'
22
22
  require_relative './model/get_message_event_response_overview'
23
23
  require_relative './model/get_number_of_followers_response'
24
24
  require_relative './model/get_number_of_message_deliveries_response'
25
+ require_relative './model/get_rich_menu_insight_daily_response'
26
+ require_relative './model/get_rich_menu_insight_daily_response_bounds'
27
+ require_relative './model/get_rich_menu_insight_daily_response_click'
28
+ require_relative './model/get_rich_menu_insight_daily_response_daily_metrics'
29
+ require_relative './model/get_rich_menu_insight_daily_response_impression'
30
+ require_relative './model/get_rich_menu_insight_summary_response'
31
+ require_relative './model/get_rich_menu_insight_summary_response_bounds'
32
+ require_relative './model/get_rich_menu_insight_summary_response_click'
33
+ require_relative './model/get_rich_menu_insight_summary_response_impression'
34
+ require_relative './model/get_rich_menu_insight_summary_response_metrics'
25
35
  require_relative './model/get_statistics_per_unit_response'
26
36
  require_relative './model/get_statistics_per_unit_response_click'
27
37
  require_relative './model/get_statistics_per_unit_response_message'
@@ -0,0 +1,97 @@
1
+ # LINE Messaging API(Insight)
2
+ # This document describes LINE Messaging API(Insight).
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module Insight
14
+ # Daily impression and click statistics for a rich menu created via the Messaging API.
15
+ class GetRichMenuInsightDailyResponse
16
+ # @!attribute [rw] rich_menu_id
17
+ # @return [String] Rich menu ID.
18
+ attr_accessor :rich_menu_id
19
+ # @!attribute [rw] metrics_from
20
+ # @return [String,nil] Start date (JST) of the period actually covered by the returned metrics. Format: yyyyMMdd (e.g. 20260213).
21
+ attr_accessor :metrics_from
22
+ # @!attribute [rw] metrics_to
23
+ # @return [String,nil] End date (JST) of the period actually covered by the returned metrics. Format: yyyyMMdd (e.g. 20260215).
24
+ attr_accessor :metrics_to
25
+ # @!attribute [rw] impression
26
+ # @return [GetRichMenuInsightDailyResponseImpression,nil]
27
+ attr_accessor :impression
28
+ # @!attribute [rw] clicks
29
+ # @return [Array[GetRichMenuInsightDailyResponseClick],nil] Daily click metrics for each tappable area of the rich menu.
30
+ attr_accessor :clicks
31
+
32
+ # @param rich_menu_id [String] Rich menu ID.
33
+ # @param metrics_from [String,nil] Start date (JST) of the period actually covered by the returned metrics. Format: yyyyMMdd (e.g. 20260213).
34
+ # @param metrics_to [String,nil] End date (JST) of the period actually covered by the returned metrics. Format: yyyyMMdd (e.g. 20260215).
35
+ # @param impression [GetRichMenuInsightDailyResponseImpression, Hash[Symbol, untyped], nil]
36
+ # @param clicks [Array[GetRichMenuInsightDailyResponseClick, Hash[Symbol, untyped]],nil] Daily click metrics for each tappable area of the rich menu.
37
+ def initialize(
38
+ rich_menu_id:,
39
+ metrics_from: nil,
40
+ metrics_to: nil,
41
+ impression: nil,
42
+ clicks: nil,
43
+ **dynamic_attributes
44
+ )
45
+
46
+ @rich_menu_id = rich_menu_id
47
+ @metrics_from = metrics_from
48
+ @metrics_to = metrics_to
49
+ @impression = impression.is_a?(Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseImpression) || impression.nil? ? impression : Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseImpression.create(**impression)
50
+ @clicks = clicks&.map do |item|
51
+ if item.is_a?(Hash)
52
+ Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseClick.create(**item)
53
+ else
54
+ item
55
+ end
56
+ end
57
+
58
+ dynamic_attributes.each do |key, value|
59
+ self.class.attr_accessor key
60
+
61
+ if value.is_a?(Hash)
62
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
63
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
64
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
65
+ else
66
+ instance_variable_set("@#{key}", value)
67
+ end
68
+ end
69
+ end
70
+
71
+ # Create an instance of the class from a hash
72
+ # @param args [Hash] Hash containing all the required attributes
73
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponse] Instance of the class
74
+ def self.create(args)
75
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
76
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
77
+ end
78
+
79
+ # @param other [Object] Object to compare
80
+ # @return [Boolean] true if the objects are equal, false otherwise
81
+ def ==(other)
82
+ return false unless self.class == other.class
83
+
84
+ instance_variables.all? do |var|
85
+ instance_variable_get(var) == other.instance_variable_get(var)
86
+ end
87
+ end
88
+
89
+ # @return [Integer] Hash code of the object
90
+ def hash
91
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,85 @@
1
+ # LINE Messaging API(Insight)
2
+ # This document describes LINE Messaging API(Insight).
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module Insight
14
+ # Target area of the metrics, represented by the top-left coordinate, width, and height.
15
+ class GetRichMenuInsightDailyResponseBounds
16
+ # @!attribute [rw] x
17
+ # @return [Integer] The x coordinate of the top-left corner of the target area.
18
+ attr_accessor :x
19
+ # @!attribute [rw] y
20
+ # @return [Integer] The y coordinate of the top-left corner of the target area.
21
+ attr_accessor :y
22
+ # @!attribute [rw] width
23
+ # @return [Integer] The width of the target area.
24
+ attr_accessor :width
25
+ # @!attribute [rw] height
26
+ # @return [Integer] The height of the target area.
27
+ attr_accessor :height
28
+
29
+ # @param x [Integer] The x coordinate of the top-left corner of the target area.
30
+ # @param y [Integer] The y coordinate of the top-left corner of the target area.
31
+ # @param width [Integer] The width of the target area.
32
+ # @param height [Integer] The height of the target area.
33
+ def initialize(
34
+ x:,
35
+ y:,
36
+ width:,
37
+ height:,
38
+ **dynamic_attributes
39
+ )
40
+
41
+ @x = x
42
+ @y = y
43
+ @width = width
44
+ @height = height
45
+
46
+ dynamic_attributes.each do |key, value|
47
+ self.class.attr_accessor key
48
+
49
+ if value.is_a?(Hash)
50
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
51
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
52
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
53
+ else
54
+ instance_variable_set("@#{key}", value)
55
+ end
56
+ end
57
+ end
58
+
59
+ # Create an instance of the class from a hash
60
+ # @param args [Hash] Hash containing all the required attributes
61
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseBounds] Instance of the class
62
+ def self.create(args)
63
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
64
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
65
+ end
66
+
67
+ # @param other [Object] Object to compare
68
+ # @return [Boolean] true if the objects are equal, false otherwise
69
+ def ==(other)
70
+ return false unless self.class == other.class
71
+
72
+ instance_variables.all? do |var|
73
+ instance_variable_get(var) == other.instance_variable_get(var)
74
+ end
75
+ end
76
+
77
+ # @return [Integer] Hash code of the object
78
+ def hash
79
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,79 @@
1
+ # LINE Messaging API(Insight)
2
+ # This document describes LINE Messaging API(Insight).
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module Insight
14
+ # Daily click metrics for a single tappable area of the rich menu.
15
+ class GetRichMenuInsightDailyResponseClick
16
+ # @!attribute [rw] bounds
17
+ # @return [GetRichMenuInsightDailyResponseBounds]
18
+ attr_accessor :bounds
19
+ # @!attribute [rw] metrics
20
+ # @return [Array[GetRichMenuInsightDailyResponseDailyMetrics]] Per-day click metrics for the target area.
21
+ attr_accessor :metrics
22
+
23
+ # @param bounds [GetRichMenuInsightDailyResponseBounds, Hash[Symbol, untyped]]
24
+ # @param metrics [Array[GetRichMenuInsightDailyResponseDailyMetrics, Hash[Symbol, untyped]]] Per-day click metrics for the target area.
25
+ def initialize(
26
+ bounds:,
27
+ metrics:,
28
+ **dynamic_attributes
29
+ )
30
+
31
+ @bounds = bounds.is_a?(Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseBounds) ? bounds : Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseBounds.create(**bounds)
32
+ @metrics = metrics.map do |item|
33
+ if item.is_a?(Hash)
34
+ Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseDailyMetrics.create(**item)
35
+ else
36
+ item
37
+ end
38
+ end
39
+
40
+ dynamic_attributes.each do |key, value|
41
+ self.class.attr_accessor key
42
+
43
+ if value.is_a?(Hash)
44
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
45
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
46
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
47
+ else
48
+ instance_variable_set("@#{key}", value)
49
+ end
50
+ end
51
+ end
52
+
53
+ # Create an instance of the class from a hash
54
+ # @param args [Hash] Hash containing all the required attributes
55
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseClick] Instance of the class
56
+ def self.create(args)
57
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
58
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
59
+ end
60
+
61
+ # @param other [Object] Object to compare
62
+ # @return [Boolean] true if the objects are equal, false otherwise
63
+ def ==(other)
64
+ return false unless self.class == other.class
65
+
66
+ instance_variables.all? do |var|
67
+ instance_variable_get(var) == other.instance_variable_get(var)
68
+ end
69
+ end
70
+
71
+ # @return [Integer] Hash code of the object
72
+ def hash
73
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,79 @@
1
+ # LINE Messaging API(Insight)
2
+ # This document describes LINE Messaging API(Insight).
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module Insight
14
+ # Aggregated number of events and unique users for a single day.
15
+ class GetRichMenuInsightDailyResponseDailyMetrics
16
+ # @!attribute [rw] date
17
+ # @return [String] The date (JST) of these metrics. Format: yyyyMMdd (e.g. 20260213).
18
+ attr_accessor :date
19
+ # @!attribute [rw] count
20
+ # @return [Integer] Number of impressions or clicks on this day.
21
+ attr_accessor :count
22
+ # @!attribute [rw] unique_users
23
+ # @return [Integer] Approximate number of unique users who triggered an impression or click on this day.
24
+ attr_accessor :unique_users
25
+
26
+ # @param date [String] The date (JST) of these metrics. Format: yyyyMMdd (e.g. 20260213).
27
+ # @param count [Integer] Number of impressions or clicks on this day.
28
+ # @param unique_users [Integer] Approximate number of unique users who triggered an impression or click on this day.
29
+ def initialize(
30
+ date:,
31
+ count:,
32
+ unique_users:,
33
+ **dynamic_attributes
34
+ )
35
+
36
+ @date = date
37
+ @count = count
38
+ @unique_users = unique_users
39
+
40
+ dynamic_attributes.each do |key, value|
41
+ self.class.attr_accessor key
42
+
43
+ if value.is_a?(Hash)
44
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
45
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
46
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
47
+ else
48
+ instance_variable_set("@#{key}", value)
49
+ end
50
+ end
51
+ end
52
+
53
+ # Create an instance of the class from a hash
54
+ # @param args [Hash] Hash containing all the required attributes
55
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseDailyMetrics] Instance of the class
56
+ def self.create(args)
57
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
58
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
59
+ end
60
+
61
+ # @param other [Object] Object to compare
62
+ # @return [Boolean] true if the objects are equal, false otherwise
63
+ def ==(other)
64
+ return false unless self.class == other.class
65
+
66
+ instance_variables.all? do |var|
67
+ instance_variable_get(var) == other.instance_variable_get(var)
68
+ end
69
+ end
70
+
71
+ # @return [Integer] Hash code of the object
72
+ def hash
73
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,73 @@
1
+ # LINE Messaging API(Insight)
2
+ # This document describes LINE Messaging API(Insight).
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module Insight
14
+ # Daily impression metrics for the whole rich menu.
15
+ class GetRichMenuInsightDailyResponseImpression
16
+ # @!attribute [rw] metrics
17
+ # @return [Array[GetRichMenuInsightDailyResponseDailyMetrics]] Per-day impression metrics.
18
+ attr_accessor :metrics
19
+
20
+ # @param metrics [Array[GetRichMenuInsightDailyResponseDailyMetrics, Hash[Symbol, untyped]]] Per-day impression metrics.
21
+ def initialize(
22
+ metrics:,
23
+ **dynamic_attributes
24
+ )
25
+
26
+ @metrics = metrics.map do |item|
27
+ if item.is_a?(Hash)
28
+ Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseDailyMetrics.create(**item)
29
+ else
30
+ item
31
+ end
32
+ end
33
+
34
+ dynamic_attributes.each do |key, value|
35
+ self.class.attr_accessor key
36
+
37
+ if value.is_a?(Hash)
38
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
39
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
40
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
41
+ else
42
+ instance_variable_set("@#{key}", value)
43
+ end
44
+ end
45
+ end
46
+
47
+ # Create an instance of the class from a hash
48
+ # @param args [Hash] Hash containing all the required attributes
49
+ # @return [Line::Bot::V2::Insight::GetRichMenuInsightDailyResponseImpression] Instance of the class
50
+ def self.create(args)
51
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
52
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
53
+ end
54
+
55
+ # @param other [Object] Object to compare
56
+ # @return [Boolean] true if the objects are equal, false otherwise
57
+ def ==(other)
58
+ return false unless self.class == other.class
59
+
60
+ instance_variables.all? do |var|
61
+ instance_variable_get(var) == other.instance_variable_get(var)
62
+ end
63
+ end
64
+
65
+ # @return [Integer] Hash code of the object
66
+ def hash
67
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end