Skip to content

Commit c2731f5

Browse files
authored
Generate missing code (line#425)
These are the changes to the Messaging API over the past two months. Additionally, this change fixes failing test. line@40213a7
1 parent a9dab20 commit c2731f5

39 files changed

+920
-170
lines changed

lib/line/bot/v2/manage_audience/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
api/manage_audience_blob_client.rb
33
api/manage_audience_client.rb
44
core.rb
5+
model/adaccount.rb
56
model/add_audience_to_audience_group_request.rb
67
model/audience.rb
78
model/audience_group.rb
@@ -21,10 +22,13 @@ model/create_click_based_audience_group_request.rb
2122
model/create_click_based_audience_group_response.rb
2223
model/create_imp_based_audience_group_request.rb
2324
model/create_imp_based_audience_group_response.rb
25+
model/detailed_owner.rb
2426
model/error_detail.rb
2527
model/error_response.rb
2628
model/get_audience_data_response.rb
2729
model/get_audience_group_authority_level_response.rb
2830
model/get_audience_groups_response.rb
31+
model/get_shared_audience_data_response.rb
32+
model/get_shared_audience_groups_response.rb
2933
model/update_audience_group_authority_level_request.rb
3034
model/update_audience_group_description_request.rb

lib/line/bot/v2/manage_audience/api/manage_audience_blob_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def create_audience_for_uploading_user_ids_with_http_info(
110110
)
111111

112112
body = case response.code.to_i
113-
when 200
113+
when 202
114114
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
115115
json.transform_keys! do |key|
116116
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key

lib/line/bot/v2/manage_audience/api/manage_audience_client.rb

Lines changed: 121 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def add_audience_to_audience_group_with_http_info(
8181
)
8282

8383
body = case response.code.to_i
84-
when 200
84+
when 202
8585
response.body
8686
else
8787
response.body
@@ -119,7 +119,7 @@ def create_audience_group_with_http_info(
119119
)
120120

121121
body = case response.code.to_i
122-
when 200
122+
when 202
123123
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
124124
json.transform_keys! do |key|
125125
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
@@ -161,7 +161,7 @@ def create_click_based_audience_group_with_http_info(
161161
)
162162

163163
body = case response.code.to_i
164-
when 200
164+
when 202
165165
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
166166
json.transform_keys! do |key|
167167
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
@@ -203,7 +203,7 @@ def create_imp_based_audience_group_with_http_info(
203203
)
204204

205205
body = case response.code.to_i
206-
when 200
206+
when 202
207207
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
208208
json.transform_keys! do |key|
209209
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
@@ -427,6 +427,123 @@ def get_audience_groups(
427427
body
428428
end
429429

430+
# Gets audience data.
431+
#
432+
# @param audience_group_id The audience ID.
433+
# @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience
434+
def get_shared_audience_data_with_http_info(
435+
audience_group_id:
436+
)
437+
path = "/v2/bot/audienceGroup/shared/{audienceGroupId}"
438+
.gsub(/{audienceGroupId}/, audience_group_id)
439+
440+
response = @http_client.get(
441+
path: path,
442+
)
443+
444+
body = case response.code.to_i
445+
when 200
446+
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
447+
json.transform_keys! do |key|
448+
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
449+
end
450+
Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse.new(**json)
451+
when 400
452+
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
453+
json.transform_keys! do |key|
454+
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
455+
end
456+
Line::Bot::V2::ManageAudience::ErrorResponse.new(**json)
457+
else
458+
response.body
459+
end
460+
461+
[body, response.code.to_i, response.each_header.to_h]
462+
end
463+
464+
# Gets audience data.
465+
#
466+
# @param audience_group_id The audience ID.
467+
# @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience
468+
def get_shared_audience_data(
469+
audience_group_id:
470+
)
471+
body, _status_code, _headers = get_shared_audience_data_with_http_info(
472+
audience_group_id: audience_group_id
473+
)
474+
475+
body
476+
end
477+
478+
# Gets data for more than one audience, including those shared by the Business Manager.
479+
#
480+
# @param page The page to return when getting (paginated) results. Must be 1 or higher.
481+
# @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
482+
# @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
483+
# @param size The number of audiences per page. Default: 20 Max: 40
484+
# @param create_route How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
485+
# @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list
486+
def get_shared_audience_groups_with_http_info(
487+
page:,
488+
description: nil,
489+
status: nil,
490+
size: nil,
491+
create_route: nil
492+
)
493+
path = "/v2/bot/audienceGroup/shared/list"
494+
query_params = {
495+
"page": page,
496+
"description": description,
497+
"status": status,
498+
"size": size,
499+
"createRoute": create_route
500+
}.compact
501+
502+
response = @http_client.get(
503+
path: path,
504+
query_params: query_params,
505+
)
506+
507+
body = case response.code.to_i
508+
when 200
509+
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
510+
json.transform_keys! do |key|
511+
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
512+
end
513+
Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse.new(**json)
514+
else
515+
response.body
516+
end
517+
518+
[body, response.code.to_i, response.each_header.to_h]
519+
end
520+
521+
# Gets data for more than one audience, including those shared by the Business Manager.
522+
#
523+
# @param page The page to return when getting (paginated) results. Must be 1 or higher.
524+
# @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
525+
# @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
526+
# @param size The number of audiences per page. Default: 20 Max: 40
527+
# @param create_route How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
528+
# @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list
529+
def get_shared_audience_groups(
530+
page:,
531+
description: nil,
532+
status: nil,
533+
size: nil,
534+
create_route: nil
535+
)
536+
body, _status_code, _headers = get_shared_audience_groups_with_http_info(
537+
page: page,
538+
description: description,
539+
status: status,
540+
size: size,
541+
create_route: create_route
542+
)
543+
544+
body
545+
end
546+
430547
# Change the authority level of the audience
431548
#
432549
# @param update_audience_group_authority_level_request

lib/line/bot/v2/manage_audience/core.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Do not edit the class manually.
1010

1111
# Models
12+
require_relative './model/adaccount'
1213
require_relative './model/add_audience_to_audience_group_request'
1314
require_relative './model/audience'
1415
require_relative './model/audience_group'
@@ -28,11 +29,14 @@
2829
require_relative './model/create_click_based_audience_group_response'
2930
require_relative './model/create_imp_based_audience_group_request'
3031
require_relative './model/create_imp_based_audience_group_response'
32+
require_relative './model/detailed_owner'
3133
require_relative './model/error_detail'
3234
require_relative './model/error_response'
3335
require_relative './model/get_audience_data_response'
3436
require_relative './model/get_audience_group_authority_level_response'
3537
require_relative './model/get_audience_groups_response'
38+
require_relative './model/get_shared_audience_data_response'
39+
require_relative './model/get_shared_audience_groups_response'
3640
require_relative './model/update_audience_group_authority_level_request'
3741
require_relative './model/update_audience_group_description_request'
3842

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# LINE Messaging API
2+
# This document describes LINE Messaging API.
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+
# Adaccount
11+
module Line
12+
module Bot
13+
module V2
14+
module ManageAudience
15+
class Adaccount
16+
attr_accessor :name # Ad account name.
17+
18+
def initialize(
19+
name: nil
20+
)
21+
22+
@name = name
23+
end
24+
end
25+
end
26+
end
27+
end
28+
end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# LINE Messaging API
2+
# This document describes LINE Messaging API.
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+
# Owner of this audience group.
11+
module Line
12+
module Bot
13+
module V2
14+
module ManageAudience
15+
class DetailedOwner
16+
attr_accessor :service_type # Service name where the audience group has been created.
17+
attr_accessor :id # Owner ID in the service.
18+
attr_accessor :name # Owner account name.
19+
20+
def initialize(
21+
service_type: nil,
22+
id: nil,
23+
name: nil
24+
)
25+
26+
@service_type = service_type
27+
@id = id
28+
@name = name
29+
end
30+
end
31+
end
32+
end
33+
end
34+
end

lib/line/bot/v2/manage_audience/model/get_audience_data_response.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ module ManageAudience
1616
class GetAudienceDataResponse
1717
attr_accessor :audience_group
1818
attr_accessor :jobs # An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs. Empty array is returned for any other type of audience. Max: 50
19+
attr_accessor :adaccount
1920

2021
def initialize(
2122
audience_group: nil,
22-
jobs: nil
23+
jobs: nil,
24+
adaccount: nil
2325
)
2426

2527
@audience_group = audience_group
2628
@jobs = jobs
29+
@adaccount = adaccount
2730
end
2831
end
2932
end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# LINE Messaging API
2+
# This document describes LINE Messaging API.
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+
# Get audience data
11+
# @see https://developers.line.biz/en/reference/messaging-api/#get-audience-group
12+
module Line
13+
module Bot
14+
module V2
15+
module ManageAudience
16+
class GetSharedAudienceDataResponse
17+
attr_accessor :audience_group
18+
attr_accessor :jobs # An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs. Empty array is returned for any other type of audience. Max: 50
19+
attr_accessor :owner
20+
21+
def initialize(
22+
audience_group: nil,
23+
jobs: nil,
24+
owner: nil
25+
)
26+
27+
@audience_group = audience_group
28+
@jobs = jobs
29+
@owner = owner
30+
end
31+
end
32+
end
33+
end
34+
end
35+
end
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# LINE Messaging API
2+
# This document describes LINE Messaging API.
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+
# Gets data for more than one audience.
11+
# @see https://developers.line.biz/en/reference/messaging-api/#get-audience-groups
12+
module Line
13+
module Bot
14+
module V2
15+
module ManageAudience
16+
class GetSharedAudienceGroupsResponse
17+
attr_accessor :audience_groups # An array of audience data. If there are no audiences that match the specified filter, an empty array will be returned.
18+
attr_accessor :has_next_page # true when this is not the last page.
19+
attr_accessor :total_count # The total number of audiences that can be returned with the specified filter.
20+
attr_accessor :read_write_audience_group_total_count # Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE.
21+
attr_accessor :page # The current page number.
22+
attr_accessor :size # The maximum number of audiences on the current page.
23+
24+
def initialize(
25+
audience_groups: nil,
26+
has_next_page: nil,
27+
total_count: nil,
28+
read_write_audience_group_total_count: nil,
29+
page: nil,
30+
size: nil
31+
)
32+
33+
@audience_groups = audience_groups
34+
@has_next_page = has_next_page
35+
@total_count = total_count
36+
@read_write_audience_group_total_count = read_write_audience_group_total_count
37+
@page = page
38+
@size = size
39+
end
40+
end
41+
end
42+
end
43+
end
44+
end

lib/line/bot/v2/messaging_api/.openapi-generator/FILES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ model/app_type_demographic.rb
1111
model/app_type_demographic_filter.rb
1212
model/area_demographic.rb
1313
model/area_demographic_filter.rb
14-
model/audience_match_messages_request.rb
1514
model/audience_recipient.rb
1615
model/audio_message.rb
1716
model/bot_info_response.rb
@@ -66,6 +65,7 @@ model/gender_demographic_filter.rb
6665
model/get_aggregation_unit_name_list_response.rb
6766
model/get_aggregation_unit_usage_response.rb
6867
model/get_followers_response.rb
68+
model/get_joined_membership_users_response.rb
6969
model/get_membership_subscription_response.rb
7070
model/get_message_content_transcoding_response.rb
7171
model/get_webhook_endpoint_response.rb

0 commit comments

Comments
 (0)