Skip to content

Commit 7e52a51

Browse files
github-actions[bot]github-actionsYang-33
authored
Remove obsolete feature: Audience Match (#744)
line/line-openapi#80 The Audience Match feature (/bot/ad/multicast/phone) was sunset in October 2023. This change removes it as it's no longer necessary to include it in line-openapi. --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Yuta Kasai <[email protected]>
1 parent da5613a commit 7e52a51

7 files changed

+3
-456
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,6 @@ tmp/
105105
*.iml
106106

107107
.openapi-generator
108+
109+
# github workflow
110+
pr_info.json

linebot/v3/messaging/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
from linebot.v3.messaging.models.app_type_demographic_filter import AppTypeDemographicFilter
4545
from linebot.v3.messaging.models.area_demographic import AreaDemographic
4646
from linebot.v3.messaging.models.area_demographic_filter import AreaDemographicFilter
47-
from linebot.v3.messaging.models.audience_match_messages_request import AudienceMatchMessagesRequest
4847
from linebot.v3.messaging.models.audience_recipient import AudienceRecipient
4948
from linebot.v3.messaging.models.audio_message import AudioMessage
5049
from linebot.v3.messaging.models.bot_info_response import BotInfoResponse

linebot/v3/messaging/api/async_messaging_api.py

-153
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
from typing import Any, Dict, Optional
2626

27-
from linebot.v3.messaging.models.audience_match_messages_request import AudienceMatchMessagesRequest
2827
from linebot.v3.messaging.models.bot_info_response import BotInfoResponse
2928
from linebot.v3.messaging.models.broadcast_request import BroadcastRequest
3029
from linebot.v3.messaging.models.create_rich_menu_alias_request import CreateRichMenuAliasRequest
@@ -93,158 +92,6 @@ def __init__(self, api_client=None):
9392
self.line_base_path = "https://api.line.me"
9493

9594

96-
@overload
97-
async def audience_match(self, audience_match_messages_request : AudienceMatchMessagesRequest, **kwargs) -> None: # noqa: E501
98-
...
99-
100-
@overload
101-
def audience_match(self, audience_match_messages_request : AudienceMatchMessagesRequest, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501
102-
...
103-
104-
@validate_arguments
105-
def audience_match(self, audience_match_messages_request : AudienceMatchMessagesRequest, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501
106-
"""audience_match # noqa: E501
107-
108-
Send a message using phone number # noqa: E501
109-
This method makes a synchronous HTTP request by default. To make an
110-
asynchronous HTTP request, please pass async_req=True
111-
112-
>>> thread = api.audience_match(audience_match_messages_request, async_req=True)
113-
>>> result = thread.get()
114-
115-
:param audience_match_messages_request: (required)
116-
:type audience_match_messages_request: AudienceMatchMessagesRequest
117-
:param async_req: Whether to execute the request asynchronously.
118-
:type async_req: bool, optional
119-
:param _request_timeout: timeout setting for this request. If one
120-
number provided, it will be total request
121-
timeout. It can also be a pair (tuple) of
122-
(connection, read) timeouts.
123-
:return: Returns the result object.
124-
If the method is called asynchronously,
125-
returns the request thread.
126-
:rtype: None
127-
"""
128-
kwargs['_return_http_data_only'] = True
129-
if '_preload_content' in kwargs:
130-
raise ValueError("Error! Please call the audience_match_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
131-
if async_req is not None:
132-
kwargs['async_req'] = async_req
133-
return self.audience_match_with_http_info(audience_match_messages_request, **kwargs) # noqa: E501
134-
135-
@validate_arguments
136-
def audience_match_with_http_info(self, audience_match_messages_request : AudienceMatchMessagesRequest, **kwargs) -> ApiResponse: # noqa: E501
137-
"""audience_match # noqa: E501
138-
139-
Send a message using phone number # noqa: E501
140-
This method makes a synchronous HTTP request by default. To make an
141-
asynchronous HTTP request, please pass async_req=True
142-
143-
>>> thread = api.audience_match_with_http_info(audience_match_messages_request, async_req=True)
144-
>>> result = thread.get()
145-
146-
:param audience_match_messages_request: (required)
147-
:type audience_match_messages_request: AudienceMatchMessagesRequest
148-
:param async_req: Whether to execute the request asynchronously.
149-
:type async_req: bool, optional
150-
:param _preload_content: if False, the ApiResponse.data will
151-
be set to none and raw_data will store the
152-
HTTP response body without reading/decoding.
153-
Default is True.
154-
:type _preload_content: bool, optional
155-
:param _return_http_data_only: response data instead of ApiResponse
156-
object with status code, headers, etc
157-
:type _return_http_data_only: bool, optional
158-
:param _request_timeout: timeout setting for this request. If one
159-
number provided, it will be total request
160-
timeout. It can also be a pair (tuple) of
161-
(connection, read) timeouts.
162-
:param _request_auth: set to override the auth_settings for an a single
163-
request; this effectively ignores the authentication
164-
in the spec for a single request.
165-
:type _request_auth: dict, optional
166-
:type _content_type: string, optional: force content-type for the request
167-
:return: Returns the result object.
168-
If the method is called asynchronously,
169-
returns the request thread.
170-
:rtype: None
171-
"""
172-
173-
_host = self.line_base_path
174-
_params = locals()
175-
176-
_all_params = [
177-
'audience_match_messages_request'
178-
]
179-
_all_params.extend(
180-
[
181-
'async_req',
182-
'_return_http_data_only',
183-
'_preload_content',
184-
'_request_timeout',
185-
'_request_auth',
186-
'_content_type',
187-
'_headers'
188-
]
189-
)
190-
191-
# validate the arguments
192-
for _key, _val in _params['kwargs'].items():
193-
if _key not in _all_params:
194-
raise ApiTypeError(
195-
"Got an unexpected keyword argument '%s'"
196-
" to method audience_match" % _key
197-
)
198-
_params[_key] = _val
199-
del _params['kwargs']
200-
201-
_collection_formats = {}
202-
203-
# process the path parameters
204-
_path_params = {}
205-
206-
# process the query parameters
207-
_query_params = []
208-
# process the header parameters
209-
_header_params = dict(_params.get('_headers', {}))
210-
# process the form parameters
211-
_form_params = []
212-
_files = {}
213-
# process the body parameter
214-
_body_params = None
215-
if _params['audience_match_messages_request'] is not None:
216-
_body_params = _params['audience_match_messages_request']
217-
218-
# set the HTTP header `Content-Type`
219-
_content_types_list = _params.get('_content_type',
220-
self.api_client.select_header_content_type(
221-
['application/json']))
222-
if _content_types_list:
223-
_header_params['Content-Type'] = _content_types_list
224-
225-
# authentication setting
226-
_auth_settings = ['Bearer'] # noqa: E501
227-
228-
_response_types_map = {}
229-
230-
return self.api_client.call_api(
231-
'/bot/ad/multicast/phone', 'POST',
232-
_path_params,
233-
_query_params,
234-
_header_params,
235-
body=_body_params,
236-
post_params=_form_params,
237-
files=_files,
238-
response_types_map=_response_types_map,
239-
auth_settings=_auth_settings,
240-
async_req=_params.get('async_req'),
241-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
242-
_preload_content=_params.get('_preload_content', True),
243-
_request_timeout=_params.get('_request_timeout'),
244-
_host=_host,
245-
collection_formats=_collection_formats,
246-
_request_auth=_params.get('_request_auth'))
247-
24895
@overload
24996
async def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501
25097
...

linebot/v3/messaging/api/messaging_api.py

-143
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
from typing import Any, Dict, Optional
2424

25-
from linebot.v3.messaging.models.audience_match_messages_request import AudienceMatchMessagesRequest
2625
from linebot.v3.messaging.models.bot_info_response import BotInfoResponse
2726
from linebot.v3.messaging.models.broadcast_request import BroadcastRequest
2827
from linebot.v3.messaging.models.create_rich_menu_alias_request import CreateRichMenuAliasRequest
@@ -91,148 +90,6 @@ def __init__(self, api_client=None):
9190
self.line_base_path = "https://api.line.me"
9291

9392

94-
@validate_arguments
95-
def audience_match(self, audience_match_messages_request : AudienceMatchMessagesRequest, **kwargs) -> None: # noqa: E501
96-
"""audience_match # noqa: E501
97-
98-
Send a message using phone number # noqa: E501
99-
This method makes a synchronous HTTP request by default. To make an
100-
asynchronous HTTP request, please pass async_req=True
101-
102-
>>> thread = api.audience_match(audience_match_messages_request, async_req=True)
103-
>>> result = thread.get()
104-
105-
:param audience_match_messages_request: (required)
106-
:type audience_match_messages_request: AudienceMatchMessagesRequest
107-
:param async_req: Whether to execute the request asynchronously.
108-
:type async_req: bool, optional
109-
:param _request_timeout: timeout setting for this request. If one
110-
number provided, it will be total request
111-
timeout. It can also be a pair (tuple) of
112-
(connection, read) timeouts.
113-
:return: Returns the result object.
114-
If the method is called asynchronously,
115-
returns the request thread.
116-
:rtype: None
117-
"""
118-
kwargs['_return_http_data_only'] = True
119-
if '_preload_content' in kwargs:
120-
raise ValueError("Error! Please call the audience_match_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
121-
return self.audience_match_with_http_info(audience_match_messages_request, **kwargs) # noqa: E501
122-
123-
@validate_arguments
124-
def audience_match_with_http_info(self, audience_match_messages_request : AudienceMatchMessagesRequest, **kwargs) -> ApiResponse: # noqa: E501
125-
"""audience_match # noqa: E501
126-
127-
Send a message using phone number # noqa: E501
128-
This method makes a synchronous HTTP request by default. To make an
129-
asynchronous HTTP request, please pass async_req=True
130-
131-
>>> thread = api.audience_match_with_http_info(audience_match_messages_request, async_req=True)
132-
>>> result = thread.get()
133-
134-
:param audience_match_messages_request: (required)
135-
:type audience_match_messages_request: AudienceMatchMessagesRequest
136-
:param async_req: Whether to execute the request asynchronously.
137-
:type async_req: bool, optional
138-
:param _preload_content: if False, the ApiResponse.data will
139-
be set to none and raw_data will store the
140-
HTTP response body without reading/decoding.
141-
Default is True.
142-
:type _preload_content: bool, optional
143-
:param _return_http_data_only: response data instead of ApiResponse
144-
object with status code, headers, etc
145-
:type _return_http_data_only: bool, optional
146-
:param _request_timeout: timeout setting for this request. If one
147-
number provided, it will be total request
148-
timeout. It can also be a pair (tuple) of
149-
(connection, read) timeouts.
150-
:param _request_auth: set to override the auth_settings for an a single
151-
request; this effectively ignores the authentication
152-
in the spec for a single request.
153-
:type _request_auth: dict, optional
154-
:type _content_type: string, optional: force content-type for the request
155-
:return: Returns the result object.
156-
If the method is called asynchronously,
157-
returns the request thread.
158-
:rtype: None
159-
"""
160-
161-
_host = self.line_base_path
162-
_params = locals()
163-
164-
_all_params = [
165-
'audience_match_messages_request'
166-
]
167-
_all_params.extend(
168-
[
169-
'async_req',
170-
'_return_http_data_only',
171-
'_preload_content',
172-
'_request_timeout',
173-
'_request_auth',
174-
'_content_type',
175-
'_headers'
176-
]
177-
)
178-
179-
# validate the arguments
180-
for _key, _val in _params['kwargs'].items():
181-
if _key not in _all_params:
182-
raise ApiTypeError(
183-
"Got an unexpected keyword argument '%s'"
184-
" to method audience_match" % _key
185-
)
186-
_params[_key] = _val
187-
del _params['kwargs']
188-
189-
_collection_formats = {}
190-
191-
# process the path parameters
192-
_path_params = {}
193-
194-
# process the query parameters
195-
_query_params = []
196-
# process the header parameters
197-
_header_params = dict(_params.get('_headers', {}))
198-
# process the form parameters
199-
_form_params = []
200-
_files = {}
201-
# process the body parameter
202-
_body_params = None
203-
if _params['audience_match_messages_request'] is not None:
204-
_body_params = _params['audience_match_messages_request']
205-
206-
# set the HTTP header `Content-Type`
207-
_content_types_list = _params.get('_content_type',
208-
self.api_client.select_header_content_type(
209-
['application/json']))
210-
if _content_types_list:
211-
_header_params['Content-Type'] = _content_types_list
212-
213-
# authentication setting
214-
_auth_settings = ['Bearer'] # noqa: E501
215-
216-
_response_types_map = {}
217-
218-
return self.api_client.call_api(
219-
'/bot/ad/multicast/phone', 'POST',
220-
_path_params,
221-
_query_params,
222-
_header_params,
223-
body=_body_params,
224-
post_params=_form_params,
225-
files=_files,
226-
response_types_map=_response_types_map,
227-
auth_settings=_auth_settings,
228-
async_req=_params.get('async_req'),
229-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
230-
_preload_content=_params.get('_preload_content', True),
231-
_request_timeout=_params.get('_request_timeout'),
232-
_host=_host,
233-
collection_formats=_collection_formats,
234-
_request_auth=_params.get('_request_auth'))
235-
23693
@validate_arguments
23794
def broadcast(self, broadcast_request : BroadcastRequest, x_line_retry_key : Annotated[Optional[StrictStr], Field(description="Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. ")] = None, **kwargs) -> object: # noqa: E501
23895
"""broadcast # noqa: E501

0 commit comments

Comments
 (0)