Class: Line::Bot::V2::ManageAudience::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/line/bot/v2/manage_audience/api/manage_audience_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url: nil, channel_access_token:, http_options: {}) ⇒ ApiClient

Initializes a new Line::Bot::V2::ManageAudience::ApiClient instance.

Examples:

@client ||= Line::Bot::V2::ManageAudience::ApiClient.new(
  channel_access_token: "YOUR_CHANNEL_ACCESS_TOKEN",
  http_options: {
    open_timeout: 5,
    read_timeout: 5,
  }
)

Parameters:

  • base_url (String) (defaults to: nil)

    The base URL for requests (optional). Defaults to ‘api.line.me’ if none is provided. You can override this for testing or to use a mock server.

  • channel_access_token (String)

    The channel access token for authorization.

  • http_options (Hash) (defaults to: {})

    HTTP options (same as Net::HTTP options). See: docs.ruby-lang.org/en/3.4/Net/HTTP.html to understand the options.



38
39
40
41
42
43
44
45
46
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 38

def initialize(base_url: nil, channel_access_token:, http_options: {})
  @http_client = HttpClient.new(
    base_url: base_url || 'https://api.line.me',
    http_headers: {
      Authorization: "Bearer #{channel_access_token}"
    },
    http_options: http_options
  )
end

Instance Method Details

#add_audience_to_audience_group(add_audience_to_audience_group_request:) ⇒ String?

Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload When you want to get HTTP status code or response headers, use #add_audience_to_audience_group_with_http_info instead of this.

Parameters:

Returns:

  • (String, nil)

    when HTTP status code is 202

  • (String, nil)

    when other HTTP status code is returned. This String is HTTP response body itself.

See Also:



82
83
84
85
86
87
88
89
90
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 82

def add_audience_to_audience_group(
  add_audience_to_audience_group_request:
)
  response_body, _status_code, _headers = add_audience_to_audience_group_with_http_info(
    add_audience_to_audience_group_request: add_audience_to_audience_group_request
  )

  response_body
end

#add_audience_to_audience_group_with_http_info(add_audience_to_audience_group_request:) ⇒ Array((String|nil), Integer, Hash{String => String})

Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

Returns:

  • (Array((String|nil), Integer, Hash{String => String}))

    when HTTP status code is 202

  • (Array((String|nil), Integer, Hash{String => String}))

    when other HTTP status code is returned. String is HTTP response body itself.

See Also:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 56

def add_audience_to_audience_group_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  add_audience_to_audience_group_request:
)
  path = "/v2/bot/audienceGroup/upload"

  response = @http_client.put(
    path: path,
    body_params: add_audience_to_audience_group_request,
  )

  case response.code.to_i
  when 202
    [response.body, 202, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#create_audience_group(create_audience_group_request:) ⇒ Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, ...

Create audience for uploading user IDs (by JSON) This requests to POST https://api.line.me/v2/bot/audienceGroup/upload When you want to get HTTP status code or response headers, use #create_audience_group_with_http_info instead of this.

Parameters:

Returns:

See Also:



131
132
133
134
135
136
137
138
139
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 131

def create_audience_group(
  create_audience_group_request:
)
  response_body, _status_code, _headers = create_audience_group_with_http_info(
    create_audience_group_request: create_audience_group_request
  )

  response_body
end

#create_audience_group_with_http_info(create_audience_group_request:) ⇒ Array(Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Create audience for uploading user IDs (by JSON) This requests to POST https://api.line.me/v2/bot/audienceGroup/upload This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

Returns:

See Also:



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 100

def create_audience_group_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  create_audience_group_request:
)
  path = "/v2/bot/audienceGroup/upload"

  response = @http_client.post(
    path: path,
    body_params: create_audience_group_request,
  )

  case response.code.to_i
  when 202
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 202, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#create_click_based_audience_group(create_click_based_audience_group_request:) ⇒ Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse, ...

Create audience for click-based retargeting This requests to POST https://api.line.me/v2/bot/audienceGroup/click When you want to get HTTP status code or response headers, use #create_click_based_audience_group_with_http_info instead of this.

Parameters:

Returns:

See Also:



180
181
182
183
184
185
186
187
188
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 180

def create_click_based_audience_group(
  create_click_based_audience_group_request:
)
  response_body, _status_code, _headers = create_click_based_audience_group_with_http_info(
    create_click_based_audience_group_request: create_click_based_audience_group_request
  )

  response_body
end

#create_click_based_audience_group_with_http_info(create_click_based_audience_group_request:) ⇒ Array(Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Create audience for click-based retargeting This requests to POST https://api.line.me/v2/bot/audienceGroup/click This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

Returns:

See Also:



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 149

def create_click_based_audience_group_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  create_click_based_audience_group_request:
)
  path = "/v2/bot/audienceGroup/click"

  response = @http_client.post(
    path: path,
    body_params: create_click_based_audience_group_request,
  )

  case response.code.to_i
  when 202
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 202, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#create_imp_based_audience_group(create_imp_based_audience_group_request:) ⇒ Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse, ...

Create audience for impression-based retargeting This requests to POST https://api.line.me/v2/bot/audienceGroup/imp When you want to get HTTP status code or response headers, use #create_imp_based_audience_group_with_http_info instead of this.

Parameters:

Returns:

See Also:



229
230
231
232
233
234
235
236
237
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 229

def create_imp_based_audience_group(
  create_imp_based_audience_group_request:
)
  response_body, _status_code, _headers = create_imp_based_audience_group_with_http_info(
    create_imp_based_audience_group_request: create_imp_based_audience_group_request
  )

  response_body
end

#create_imp_based_audience_group_with_http_info(create_imp_based_audience_group_request:) ⇒ Array(Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Create audience for impression-based retargeting This requests to POST https://api.line.me/v2/bot/audienceGroup/imp This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

Returns:

See Also:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 198

def create_imp_based_audience_group_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  create_imp_based_audience_group_request:
)
  path = "/v2/bot/audienceGroup/imp"

  response = @http_client.post(
    path: path,
    body_params: create_imp_based_audience_group_request,
  )

  case response.code.to_i
  when 202
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 202, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#delete_audience_group(audience_group_id:) ⇒ String?

Delete audience This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} When you want to get HTTP status code or response headers, use #delete_audience_group_with_http_info instead of this.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

  • (String, nil)

    when HTTP status code is 200

  • (String, nil)

    when other HTTP status code is returned. This String is HTTP response body itself.

See Also:



273
274
275
276
277
278
279
280
281
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 273

def delete_audience_group(
  audience_group_id:
)
  response_body, _status_code, _headers = delete_audience_group_with_http_info(
    audience_group_id: audience_group_id
  )

  response_body
end

#delete_audience_group_with_http_info(audience_group_id:) ⇒ Array((String|nil), Integer, Hash{String => String})

Delete audience This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

  • (Array((String|nil), Integer, Hash{String => String}))

    when HTTP status code is 200

  • (Array((String|nil), Integer, Hash{String => String}))

    when other HTTP status code is returned. String is HTTP response body itself.

See Also:



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 247

def delete_audience_group_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  audience_group_id:
)
  path = "/v2/bot/audienceGroup/{audienceGroupId}"
    .gsub(/{audienceGroupId}/, audience_group_id.to_s)

  response = @http_client.delete(
    path: path,
  )

  case response.code.to_i
  when 200
    [response.body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#get_audience_data(audience_group_id:) ⇒ Line::Bot::V2::ManageAudience::GetAudienceDataResponse, ...

Gets audience data. This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} When you want to get HTTP status code or response headers, use #get_audience_data_with_http_info instead of this.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

See Also:



331
332
333
334
335
336
337
338
339
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 331

def get_audience_data(
  audience_group_id:
)
  response_body, _status_code, _headers = get_audience_data_with_http_info(
    audience_group_id: audience_group_id
  )

  response_body
end

#get_audience_data_with_http_info(audience_group_id:) ⇒ Array(Line::Bot::V2::ManageAudience::GetAudienceDataResponse, Integer, Hash{String => String}), ...

Gets audience data. This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

See Also:



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 292

def get_audience_data_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  audience_group_id:
)
  path = "/v2/bot/audienceGroup/{audienceGroupId}"
    .gsub(/{audienceGroupId}/, audience_group_id.to_s)

  response = @http_client.get(
    path: path,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::GetAudienceDataResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  when 400
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 400, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#get_audience_groups(page:, description: nil, status: nil, size: nil, includes_external_public_groups: nil, create_route: nil) ⇒ Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse, ...

Gets data for more than one audience. This requests to GET https://api.line.me/v2/bot/audienceGroup/list When you want to get HTTP status code or response headers, use #get_audience_groups_with_http_info instead of this.

Parameters:

  • page (Integer)

    The page to return when getting (paginated) results. Must be 1 or higher.

  • description (String, nil) (defaults to: nil)

    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.

  • status (AudienceGroupStatus, nil) (defaults to: nil)

    The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

  • size (Integer, nil) (defaults to: nil)

    The number of audiences per page. Default: 20 Max: 40

  • includes_external_public_groups (Boolean, nil) (defaults to: nil)

    true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.

  • create_route (AudienceGroupCreateRoute, nil) (defaults to: nil)

    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.

Returns:

See Also:



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 403

def get_audience_groups(
  page:,
  description: nil,
  status: nil,
  size: nil,
  includes_external_public_groups: nil,
  create_route: nil
)
  response_body, _status_code, _headers = get_audience_groups_with_http_info(
    page: page,
    description: description,
    status: status,
    size: size,
    includes_external_public_groups: includes_external_public_groups,
    create_route: create_route
  )

  response_body
end

#get_audience_groups_with_http_info(page:, description: nil, status: nil, size: nil, includes_external_public_groups: nil, create_route: nil) ⇒ Array(Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Gets data for more than one audience. This requests to GET https://api.line.me/v2/bot/audienceGroup/list This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • page (Integer)

    The page to return when getting (paginated) results. Must be 1 or higher.

  • description (String, nil) (defaults to: nil)

    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.

  • status (AudienceGroupStatus, nil) (defaults to: nil)

    The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

  • size (Integer, nil) (defaults to: nil)

    The number of audiences per page. Default: 20 Max: 40

  • includes_external_public_groups (Boolean, nil) (defaults to: nil)

    true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.

  • create_route (AudienceGroupCreateRoute, nil) (defaults to: nil)

    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.

Returns:

See Also:



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 354

def get_audience_groups_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  page:, 
  description: nil, 
  status: nil, 
  size: nil, 
  includes_external_public_groups: nil, 
  create_route: nil
)
  path = "/v2/bot/audienceGroup/list"
  query_params = {
    "page": page,
    "description": description,
    "status": status,
    "size": size,
    "includesExternalPublicGroups": includes_external_public_groups,
    "createRoute": create_route
  }.compact

  response = @http_client.get(
    path: path,
    query_params: query_params,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#get_shared_audience_data(audience_group_id:) ⇒ Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse, ...

Gets audience data. This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} When you want to get HTTP status code or response headers, use #get_shared_audience_data_with_http_info instead of this.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

See Also:



471
472
473
474
475
476
477
478
479
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 471

def get_shared_audience_data(
  audience_group_id:
)
  response_body, _status_code, _headers = get_shared_audience_data_with_http_info(
    audience_group_id: audience_group_id
  )

  response_body
end

#get_shared_audience_data_with_http_info(audience_group_id:) ⇒ Array(Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse, Integer, Hash{String => String}), ...

Gets audience data. This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • audience_group_id (Integer)

    The audience ID.

Returns:

See Also:



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 432

def get_shared_audience_data_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  audience_group_id:
)
  path = "/v2/bot/audienceGroup/shared/{audienceGroupId}"
    .gsub(/{audienceGroupId}/, audience_group_id.to_s)

  response = @http_client.get(
    path: path,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  when 400
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 400, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#get_shared_audience_groups(page:, description: nil, status: nil, size: nil, create_route: nil, includes_owned_audience_groups: nil) ⇒ Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse, ...

Gets data for more than one audience, including those shared by the Business Manager. This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list When you want to get HTTP status code or response headers, use #get_shared_audience_groups_with_http_info instead of this.

Parameters:

  • page (Integer)

    The page to return when getting (paginated) results. Must be 1 or higher.

  • description (String, nil) (defaults to: nil)

    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.

  • status (AudienceGroupStatus, nil) (defaults to: nil)

    The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

  • size (Integer, nil) (defaults to: nil)

    The number of audiences per page. Default: 20 Max: 40

  • create_route (AudienceGroupCreateRoute, nil) (defaults to: nil)

    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.

  • includes_owned_audience_groups (Boolean, nil) (defaults to: nil)

    true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager

Returns:

See Also:



543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 543

def get_shared_audience_groups(
  page:,
  description: nil,
  status: nil,
  size: nil,
  create_route: nil,
  includes_owned_audience_groups: nil
)
  response_body, _status_code, _headers = get_shared_audience_groups_with_http_info(
    page: page,
    description: description,
    status: status,
    size: size,
    create_route: create_route,
    includes_owned_audience_groups: includes_owned_audience_groups
  )

  response_body
end

#get_shared_audience_groups_with_http_info(page:, description: nil, status: nil, size: nil, create_route: nil, includes_owned_audience_groups: nil) ⇒ Array(Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Gets data for more than one audience, including those shared by the Business Manager. This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • page (Integer)

    The page to return when getting (paginated) results. Must be 1 or higher.

  • description (String, nil) (defaults to: nil)

    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.

  • status (AudienceGroupStatus, nil) (defaults to: nil)

    The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

  • size (Integer, nil) (defaults to: nil)

    The number of audiences per page. Default: 20 Max: 40

  • create_route (AudienceGroupCreateRoute, nil) (defaults to: nil)

    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.

  • includes_owned_audience_groups (Boolean, nil) (defaults to: nil)

    true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager

Returns:

See Also:



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 494

def get_shared_audience_groups_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  page:, 
  description: nil, 
  status: nil, 
  size: nil, 
  create_route: nil, 
  includes_owned_audience_groups: nil
)
  path = "/v2/bot/audienceGroup/shared/list"
  query_params = {
    "page": page,
    "description": description,
    "status": status,
    "size": size,
    "createRoute": create_route,
    "includesOwnedAudienceGroups": includes_owned_audience_groups
  }.compact

  response = @http_client.get(
    path: path,
    query_params: query_params,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end

#update_audience_group_description(audience_group_id:, update_audience_group_description_request:) ⇒ String?

Renames an existing audience. This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription When you want to get HTTP status code or response headers, use #update_audience_group_description_with_http_info instead of this.

Parameters:

Returns:

  • (String, nil)

    when HTTP status code is 200

  • (String, nil)

    when other HTTP status code is returned. This String is HTTP response body itself.

See Also:



601
602
603
604
605
606
607
608
609
610
611
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 601

def update_audience_group_description(
  audience_group_id:,
  update_audience_group_description_request:
)
  response_body, _status_code, _headers = update_audience_group_description_with_http_info(
    audience_group_id: audience_group_id,
    update_audience_group_description_request: update_audience_group_description_request
  )

  response_body
end

#update_audience_group_description_with_http_info(audience_group_id:, update_audience_group_description_request:) ⇒ Array((String|nil), Integer, Hash{String => String})

Renames an existing audience. This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

Returns:

  • (Array((String|nil), Integer, Hash{String => String}))

    when HTTP status code is 200

  • (Array((String|nil), Integer, Hash{String => String}))

    when other HTTP status code is returned. String is HTTP response body itself.

See Also:



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/line/bot/v2/manage_audience/api/manage_audience_client.rb', line 572

def update_audience_group_description_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  audience_group_id:, 
  update_audience_group_description_request:
)
  path = "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription"
    .gsub(/{audienceGroupId}/, audience_group_id.to_s)

  response = @http_client.put(
    path: path,
    body_params: update_audience_group_description_request,
  )

  case response.code.to_i
  when 200
    [response.body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end