From 39639c9ef561e01acd0525f902e0418dd45ef4e0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Apr 2025 07:36:21 +0000 Subject: [PATCH] Code are generated by openapi generator --- line-openapi | 2 +- linebot/v3/audience/__init__.py | 3 - .../v3/audience/api/async_manage_audience.py | 466 +----------------- linebot/v3/audience/api/manage_audience.py | 432 +--------------- linebot/v3/audience/docs/ManageAudience.md | 225 +-------- linebot/v3/audience/models/__init__.py | 3 - .../models/audience_group_authority_level.py | 40 -- ...audience_group_authority_level_response.py | 73 --- ..._audience_group_authority_level_request.py | 73 --- 9 files changed, 35 insertions(+), 1282 deletions(-) delete mode 100644 linebot/v3/audience/models/audience_group_authority_level.py delete mode 100644 linebot/v3/audience/models/get_audience_group_authority_level_response.py delete mode 100644 linebot/v3/audience/models/update_audience_group_authority_level_request.py diff --git a/line-openapi b/line-openapi index 2f3805813..bc181f4c5 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 2f38058136b8f9237feafe34ea86a4be98455fb3 +Subproject commit bc181f4c552508ff67e33d74d996ebf624014938 diff --git a/linebot/v3/audience/__init__.py b/linebot/v3/audience/__init__.py index 431a83f7a..d6e44a065 100644 --- a/linebot/v3/audience/__init__.py +++ b/linebot/v3/audience/__init__.py @@ -39,7 +39,6 @@ from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience import Audience from linebot.v3.audience.models.audience_group import AudienceGroup -from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute from linebot.v3.audience.models.audience_group_failed_type import AudienceGroupFailedType from linebot.v3.audience.models.audience_group_job import AudienceGroupJob @@ -59,9 +58,7 @@ from linebot.v3.audience.models.error_detail import ErrorDetail from linebot.v3.audience.models.error_response import ErrorResponse from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse -from linebot.v3.audience.models.get_audience_group_authority_level_response import GetAudienceGroupAuthorityLevelResponse from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse -from linebot.v3.audience.models.update_audience_group_authority_level_request import UpdateAudienceGroupAuthorityLevelRequest from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest diff --git a/linebot/v3/audience/api/async_manage_audience.py b/linebot/v3/audience/api/async_manage_audience.py index 52b649f31..83c0b27d8 100644 --- a/linebot/v3/audience/api/async_manage_audience.py +++ b/linebot/v3/audience/api/async_manage_audience.py @@ -34,11 +34,9 @@ from linebot.v3.audience.models.create_imp_based_audience_group_request import CreateImpBasedAudienceGroupRequest from linebot.v3.audience.models.create_imp_based_audience_group_response import CreateImpBasedAudienceGroupResponse from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse -from linebot.v3.audience.models.get_audience_group_authority_level_response import GetAudienceGroupAuthorityLevelResponse from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse -from linebot.v3.audience.models.update_audience_group_authority_level_request import UpdateAudienceGroupAuthorityLevelRequest from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest from linebot.v3.audience.async_api_client import AsyncApiClient @@ -63,151 +61,6 @@ def __init__(self, api_client=None): self.line_base_path = "https://api.line.me" - @overload - async def activate_audience_group(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], **kwargs) -> None: # noqa: E501 - ... - - @overload - def activate_audience_group(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 - ... - - @validate_arguments - def activate_audience_group(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 - """activate_audience_group # noqa: E501 - - Activate audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.activate_audience_group(audience_group_id, async_req=True) - >>> result = thread.get() - - :param audience_group_id: The audience ID. (required) - :type audience_group_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the activate_audience_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - if async_req is not None: - kwargs['async_req'] = async_req - return self.activate_audience_group_with_http_info(audience_group_id, **kwargs) # noqa: E501 - - @validate_arguments - def activate_audience_group_with_http_info(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], **kwargs) -> ApiResponse: # noqa: E501 - """activate_audience_group # noqa: E501 - - Activate audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.activate_audience_group_with_http_info(audience_group_id, async_req=True) - >>> result = thread.get() - - :param audience_group_id: The audience ID. (required) - :type audience_group_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - 'audience_group_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method activate_audience_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['audience_group_id']: - _path_params['audienceGroupId'] = _params['audience_group_id'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/v2/bot/audienceGroup/{audienceGroupId}/activate', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @overload async def add_audience_to_audience_group(self, add_audience_to_audience_group_request : AddAudienceToAudienceGroupRequest, **kwargs) -> None: # noqa: E501 ... @@ -1131,149 +984,6 @@ def get_audience_data_with_http_info(self, audience_group_id : Annotated[StrictI collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @overload - async def get_audience_group_authority_level(self, **kwargs) -> GetAudienceGroupAuthorityLevelResponse: # noqa: E501 - ... - - @overload - def get_audience_group_authority_level(self, async_req: Optional[bool]=True, **kwargs) -> GetAudienceGroupAuthorityLevelResponse: # noqa: E501 - ... - - @validate_arguments - def get_audience_group_authority_level(self, async_req: Optional[bool]=None, **kwargs) -> Union[GetAudienceGroupAuthorityLevelResponse, Awaitable[GetAudienceGroupAuthorityLevelResponse]]: # noqa: E501 - """get_audience_group_authority_level # noqa: E501 - - Get the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_audience_group_authority_level(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GetAudienceGroupAuthorityLevelResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_audience_group_authority_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - if async_req is not None: - kwargs['async_req'] = async_req - return self.get_audience_group_authority_level_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_audience_group_authority_level_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get_audience_group_authority_level # noqa: E501 - - Get the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_audience_group_authority_level_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GetAudienceGroupAuthorityLevelResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_audience_group_authority_level" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = { - '200': "GetAudienceGroupAuthorityLevelResponse", - } - - return self.api_client.call_api( - '/v2/bot/audienceGroup/authorityLevel', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @overload async def get_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, includes_external_public_groups : Annotated[Optional[StrictBool], Field(description="true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> GetAudienceGroupsResponse: # noqa: E501 ... @@ -1618,22 +1328,22 @@ def get_shared_audience_data_with_http_info(self, audience_group_id : Annotated[ _request_auth=_params.get('_request_auth')) @overload - async def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 + async def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 ... @overload - def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, async_req: Optional[bool]=True, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 + def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, async_req: Optional[bool]=True, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 ... @validate_arguments - def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[GetSharedAudienceGroupsResponse, Awaitable[GetSharedAudienceGroupsResponse]]: # noqa: E501 + def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[GetSharedAudienceGroupsResponse, Awaitable[GetSharedAudienceGroupsResponse]]: # noqa: E501 """get_shared_audience_groups # noqa: E501 Gets data for more than one audience, including those shared by the Business Manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_shared_audience_groups(page, description, status, size, create_route, async_req=True) + >>> thread = api.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups, async_req=True) >>> result = thread.get() :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -1646,6 +1356,8 @@ def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), :type size: int :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. :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -1662,17 +1374,17 @@ def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), raise ValueError("Error! Please call the get_shared_audience_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") if async_req is not None: kwargs['async_req'] = async_req - return self.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, **kwargs) # noqa: E501 + return self.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups, **kwargs) # noqa: E501 @validate_arguments - def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 + def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, **kwargs) -> ApiResponse: # noqa: E501 """get_shared_audience_groups # noqa: E501 Gets data for more than one audience, including those shared by the Business Manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, async_req=True) + >>> thread = api.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups, async_req=True) >>> result = thread.get() :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -1685,6 +1397,8 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri :type size: int :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. :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1718,7 +1432,8 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri 'description', 'status', 'size', - 'create_route' + 'create_route', + 'includes_owned_audience_groups' ] _all_params.extend( [ @@ -1764,6 +1479,9 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri if _params.get('create_route') is not None: # noqa: E501 _query_params.append(('createRoute', _params['create_route'].value)) + if _params.get('includes_owned_audience_groups') is not None: # noqa: E501 + _query_params.append(('includesOwnedAudienceGroups', _params['includes_owned_audience_groups'])) + # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -1800,158 +1518,6 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @overload - async def update_audience_group_authority_level(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, **kwargs) -> None: # noqa: E501 - ... - - @overload - def update_audience_group_authority_level(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 - ... - - @validate_arguments - def update_audience_group_authority_level(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 - """update_audience_group_authority_level # noqa: E501 - - Change the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_audience_group_authority_level(update_audience_group_authority_level_request, async_req=True) - >>> result = thread.get() - - :param update_audience_group_authority_level_request: (required) - :type update_audience_group_authority_level_request: UpdateAudienceGroupAuthorityLevelRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_audience_group_authority_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - if async_req is not None: - kwargs['async_req'] = async_req - return self.update_audience_group_authority_level_with_http_info(update_audience_group_authority_level_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_audience_group_authority_level_with_http_info(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, **kwargs) -> ApiResponse: # noqa: E501 - """update_audience_group_authority_level # noqa: E501 - - Change the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_audience_group_authority_level_with_http_info(update_audience_group_authority_level_request, async_req=True) - >>> result = thread.get() - - :param update_audience_group_authority_level_request: (required) - :type update_audience_group_authority_level_request: UpdateAudienceGroupAuthorityLevelRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - 'update_audience_group_authority_level_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_audience_group_authority_level" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['update_audience_group_authority_level_request'] is not None: - _body_params = _params['update_audience_group_authority_level_request'] - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/v2/bot/audienceGroup/authorityLevel', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @overload async def update_audience_group_description(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], update_audience_group_description_request : UpdateAudienceGroupDescriptionRequest, **kwargs) -> None: # noqa: E501 ... diff --git a/linebot/v3/audience/api/manage_audience.py b/linebot/v3/audience/api/manage_audience.py index c9b77778b..3888f4146 100644 --- a/linebot/v3/audience/api/manage_audience.py +++ b/linebot/v3/audience/api/manage_audience.py @@ -32,11 +32,9 @@ from linebot.v3.audience.models.create_imp_based_audience_group_request import CreateImpBasedAudienceGroupRequest from linebot.v3.audience.models.create_imp_based_audience_group_response import CreateImpBasedAudienceGroupResponse from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse -from linebot.v3.audience.models.get_audience_group_authority_level_response import GetAudienceGroupAuthorityLevelResponse from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse -from linebot.v3.audience.models.update_audience_group_authority_level_request import UpdateAudienceGroupAuthorityLevelRequest from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest from linebot.v3.audience.api_client import ApiClient @@ -61,141 +59,6 @@ def __init__(self, api_client=None): self.line_base_path = "https://api.line.me" - @validate_arguments - def activate_audience_group(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], **kwargs) -> None: # noqa: E501 - """activate_audience_group # noqa: E501 - - Activate audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.activate_audience_group(audience_group_id, async_req=True) - >>> result = thread.get() - - :param audience_group_id: The audience ID. (required) - :type audience_group_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the activate_audience_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.activate_audience_group_with_http_info(audience_group_id, **kwargs) # noqa: E501 - - @validate_arguments - def activate_audience_group_with_http_info(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], **kwargs) -> ApiResponse: # noqa: E501 - """activate_audience_group # noqa: E501 - - Activate audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.activate_audience_group_with_http_info(audience_group_id, async_req=True) - >>> result = thread.get() - - :param audience_group_id: The audience ID. (required) - :type audience_group_id: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - 'audience_group_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method activate_audience_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['audience_group_id']: - _path_params['audienceGroupId'] = _params['audience_group_id'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/v2/bot/audienceGroup/{audienceGroupId}/activate', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @validate_arguments def add_audience_to_audience_group(self, add_audience_to_audience_group_request : AddAudienceToAudienceGroupRequest, **kwargs) -> None: # noqa: E501 """add_audience_to_audience_group # noqa: E501 @@ -1059,139 +922,6 @@ def get_audience_data_with_http_info(self, audience_group_id : Annotated[StrictI collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments - def get_audience_group_authority_level(self, **kwargs) -> GetAudienceGroupAuthorityLevelResponse: # noqa: E501 - """get_audience_group_authority_level # noqa: E501 - - Get the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_audience_group_authority_level(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GetAudienceGroupAuthorityLevelResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_audience_group_authority_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_audience_group_authority_level_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_audience_group_authority_level_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get_audience_group_authority_level # noqa: E501 - - Get the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_audience_group_authority_level_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GetAudienceGroupAuthorityLevelResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_audience_group_authority_level" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = { - '200': "GetAudienceGroupAuthorityLevelResponse", - } - - return self.api_client.call_api( - '/v2/bot/audienceGroup/authorityLevel', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @validate_arguments def get_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, includes_external_public_groups : Annotated[Optional[StrictBool], Field(description="true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> GetAudienceGroupsResponse: # noqa: E501 """get_audience_groups # noqa: E501 @@ -1516,14 +1246,14 @@ def get_shared_audience_data_with_http_info(self, audience_group_id : Annotated[ _request_auth=_params.get('_request_auth')) @validate_arguments - def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 + def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, **kwargs) -> GetSharedAudienceGroupsResponse: # noqa: E501 """get_shared_audience_groups # noqa: E501 Gets data for more than one audience, including those shared by the Business Manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_shared_audience_groups(page, description, status, size, create_route, async_req=True) + >>> thread = api.get_shared_audience_groups(page, description, status, size, create_route, includes_owned_audience_groups, async_req=True) >>> result = thread.get() :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -1536,6 +1266,8 @@ def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), :type size: int :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. :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -1550,17 +1282,17 @@ def get_shared_audience_groups(self, page : Annotated[conint(strict=True, ge=1), kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: raise ValueError("Error! Please call the get_shared_audience_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, **kwargs) # noqa: E501 + return self.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups, **kwargs) # noqa: E501 @validate_arguments - def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 + def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(strict=True, ge=1), Field(..., description="The page to return when getting (paginated) results. Must be 1 or higher.")], description : Annotated[Optional[StrictStr], Field(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. ")] = None, status : Annotated[Optional[AudienceGroupStatus], Field(description="The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. ")] = None, size : Annotated[Optional[conint(strict=True, le=40)], Field(description="The number of audiences per page. Default: 20 Max: 40 ")] = None, create_route : Annotated[Optional[AudienceGroupCreateRoute], Field(description="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. ")] = None, includes_owned_audience_groups : Annotated[Optional[StrictBool], Field(description="true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager ")] = None, **kwargs) -> ApiResponse: # noqa: E501 """get_shared_audience_groups # noqa: E501 Gets data for more than one audience, including those shared by the Business Manager. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, async_req=True) + >>> thread = api.get_shared_audience_groups_with_http_info(page, description, status, size, create_route, includes_owned_audience_groups, async_req=True) >>> result = thread.get() :param page: The page to return when getting (paginated) results. Must be 1 or higher. (required) @@ -1573,6 +1305,8 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri :type size: int :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. :type create_route: AudienceGroupCreateRoute + :param includes_owned_audience_groups: true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + :type includes_owned_audience_groups: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1606,7 +1340,8 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri 'description', 'status', 'size', - 'create_route' + 'create_route', + 'includes_owned_audience_groups' ] _all_params.extend( [ @@ -1652,6 +1387,9 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri if _params.get('create_route') is not None: # noqa: E501 _query_params.append(('createRoute', _params['create_route'].value)) + if _params.get('includes_owned_audience_groups') is not None: # noqa: E501 + _query_params.append(('includesOwnedAudienceGroups', _params['includes_owned_audience_groups'])) + # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -1688,148 +1426,6 @@ def get_shared_audience_groups_with_http_info(self, page : Annotated[conint(stri collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) - @validate_arguments - def update_audience_group_authority_level(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, **kwargs) -> None: # noqa: E501 - """update_audience_group_authority_level # noqa: E501 - - Change the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_audience_group_authority_level(update_audience_group_authority_level_request, async_req=True) - >>> result = thread.get() - - :param update_audience_group_authority_level_request: (required) - :type update_audience_group_authority_level_request: UpdateAudienceGroupAuthorityLevelRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_audience_group_authority_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.update_audience_group_authority_level_with_http_info(update_audience_group_authority_level_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_audience_group_authority_level_with_http_info(self, update_audience_group_authority_level_request : UpdateAudienceGroupAuthorityLevelRequest, **kwargs) -> ApiResponse: # noqa: E501 - """update_audience_group_authority_level # noqa: E501 - - Change the authority level of the audience # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_audience_group_authority_level_with_http_info(update_audience_group_authority_level_request, async_req=True) - >>> result = thread.get() - - :param update_audience_group_authority_level_request: (required) - :type update_audience_group_authority_level_request: UpdateAudienceGroupAuthorityLevelRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _host = self.line_base_path - _params = locals() - - _all_params = [ - 'update_audience_group_authority_level_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_audience_group_authority_level" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['update_audience_group_authority_level_request'] is not None: - _body_params = _params['update_audience_group_authority_level_request'] - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['Bearer'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/v2/bot/audienceGroup/authorityLevel', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - _host=_host, - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - @validate_arguments def update_audience_group_description(self, audience_group_id : Annotated[StrictInt, Field(..., description="The audience ID.")], update_audience_group_description_request : UpdateAudienceGroupDescriptionRequest, **kwargs) -> None: # noqa: E501 """update_audience_group_description # noqa: E501 diff --git a/linebot/v3/audience/docs/ManageAudience.md b/linebot/v3/audience/docs/ManageAudience.md index 61038d2b1..5c1d65b7a 100644 --- a/linebot/v3/audience/docs/ManageAudience.md +++ b/linebot/v3/audience/docs/ManageAudience.md @@ -4,93 +4,18 @@ All URIs are relative to *https://api.line.me* Method | HTTP request | Description ------------- | ------------- | ------------- -[**activate_audience_group**](ManageAudience.md#activate_audience_group) | **PUT** /v2/bot/audienceGroup/{audienceGroupId}/activate | [**add_audience_to_audience_group**](ManageAudience.md#add_audience_to_audience_group) | **PUT** /v2/bot/audienceGroup/upload | [**create_audience_group**](ManageAudience.md#create_audience_group) | **POST** /v2/bot/audienceGroup/upload | [**create_click_based_audience_group**](ManageAudience.md#create_click_based_audience_group) | **POST** /v2/bot/audienceGroup/click | [**create_imp_based_audience_group**](ManageAudience.md#create_imp_based_audience_group) | **POST** /v2/bot/audienceGroup/imp | [**delete_audience_group**](ManageAudience.md#delete_audience_group) | **DELETE** /v2/bot/audienceGroup/{audienceGroupId} | [**get_audience_data**](ManageAudience.md#get_audience_data) | **GET** /v2/bot/audienceGroup/{audienceGroupId} | -[**get_audience_group_authority_level**](ManageAudience.md#get_audience_group_authority_level) | **GET** /v2/bot/audienceGroup/authorityLevel | [**get_audience_groups**](ManageAudience.md#get_audience_groups) | **GET** /v2/bot/audienceGroup/list | [**get_shared_audience_data**](ManageAudience.md#get_shared_audience_data) | **GET** /v2/bot/audienceGroup/shared/{audienceGroupId} | [**get_shared_audience_groups**](ManageAudience.md#get_shared_audience_groups) | **GET** /v2/bot/audienceGroup/shared/list | -[**update_audience_group_authority_level**](ManageAudience.md#update_audience_group_authority_level) | **PUT** /v2/bot/audienceGroup/authorityLevel | [**update_audience_group_description**](ManageAudience.md#update_audience_group_description) | **PUT** /v2/bot/audienceGroup/{audienceGroupId}/updateDescription | -# **activate_audience_group** -> activate_audience_group(audience_group_id) - - - -Activate audience - -### Example - -* Bearer Authentication (Bearer): -```python -import time -import os -import linebot.v3.audience -from linebot.v3.audience.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.line.me -# See configuration.py for a list of all supported configuration parameters. -configuration = linebot.v3.audience.Configuration( - host = "https://api.line.me" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: Bearer -configuration = linebot.v3.audience.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with linebot.v3.audience.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = linebot.v3.audience.ManageAudience(api_client) - audience_group_id = 56 # int | The audience ID. - - try: - api_instance.activate_audience_group(audience_group_id) - except Exception as e: - print("Exception when calling ManageAudience->activate_audience_group: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **audience_group_id** | **int**| The audience ID. | - -### Return type - -void (empty response body) - -### Authorization - -[Bearer](../README.md#Bearer) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**202** | Accepted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **add_audience_to_audience_group** > add_audience_to_audience_group(add_audience_to_audience_group_request) @@ -540,77 +465,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_audience_group_authority_level** -> GetAudienceGroupAuthorityLevelResponse get_audience_group_authority_level() - - - -Get the authority level of the audience - -### Example - -* Bearer Authentication (Bearer): -```python -import time -import os -import linebot.v3.audience -from linebot.v3.audience.models.get_audience_group_authority_level_response import GetAudienceGroupAuthorityLevelResponse -from linebot.v3.audience.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.line.me -# See configuration.py for a list of all supported configuration parameters. -configuration = linebot.v3.audience.Configuration( - host = "https://api.line.me" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: Bearer -configuration = linebot.v3.audience.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with linebot.v3.audience.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = linebot.v3.audience.ManageAudience(api_client) - - try: - api_response = api_instance.get_audience_group_authority_level() - print("The response of ManageAudience->get_audience_group_authority_level:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ManageAudience->get_audience_group_authority_level: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**GetAudienceGroupAuthorityLevelResponse**](GetAudienceGroupAuthorityLevelResponse.md) - -### Authorization - -[Bearer](../README.md#Bearer) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **get_audience_groups** > GetAudienceGroupsResponse get_audience_groups(page, description=description, status=status, size=size, includes_external_public_groups=includes_external_public_groups, create_route=create_route) @@ -775,7 +629,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_shared_audience_groups** -> GetSharedAudienceGroupsResponse get_shared_audience_groups(page, description=description, status=status, size=size, create_route=create_route) +> GetSharedAudienceGroupsResponse get_shared_audience_groups(page, description=description, status=status, size=size, create_route=create_route, includes_owned_audience_groups=includes_owned_audience_groups) @@ -819,9 +673,10 @@ with linebot.v3.audience.ApiClient(configuration) as api_client: status = linebot.v3.audience.AudienceGroupStatus() # AudienceGroupStatus | The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. (optional) size = 20 # int | The number of audiences per page. Default: 20 Max: 40 (optional) create_route = linebot.v3.audience.AudienceGroupCreateRoute() # AudienceGroupCreateRoute | 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. (optional) + includes_owned_audience_groups = False # bool | true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager (optional) (default to False) try: - api_response = api_instance.get_shared_audience_groups(page, description=description, status=status, size=size, create_route=create_route) + api_response = api_instance.get_shared_audience_groups(page, description=description, status=status, size=size, create_route=create_route, includes_owned_audience_groups=includes_owned_audience_groups) print("The response of ManageAudience->get_shared_audience_groups:\n") pprint(api_response) except Exception as e: @@ -838,6 +693,7 @@ Name | Type | Description | Notes **status** | [**AudienceGroupStatus**](.md)| The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. | [optional] **size** | **int**| The number of audiences per page. Default: 20 Max: 40 | [optional] **create_route** | [**AudienceGroupCreateRoute**](.md)| 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. | [optional] + **includes_owned_audience_groups** | **bool**| true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager | [optional] [default to False] ### Return type @@ -859,79 +715,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_audience_group_authority_level** -> update_audience_group_authority_level(update_audience_group_authority_level_request) - - - -Change the authority level of the audience - -### Example - -* Bearer Authentication (Bearer): -```python -import time -import os -import linebot.v3.audience -from linebot.v3.audience.models.update_audience_group_authority_level_request import UpdateAudienceGroupAuthorityLevelRequest -from linebot.v3.audience.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.line.me -# See configuration.py for a list of all supported configuration parameters. -configuration = linebot.v3.audience.Configuration( - host = "https://api.line.me" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: Bearer -configuration = linebot.v3.audience.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with linebot.v3.audience.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = linebot.v3.audience.ManageAudience(api_client) - update_audience_group_authority_level_request = linebot.v3.audience.UpdateAudienceGroupAuthorityLevelRequest() # UpdateAudienceGroupAuthorityLevelRequest | - - try: - api_instance.update_audience_group_authority_level(update_audience_group_authority_level_request) - except Exception as e: - print("Exception when calling ManageAudience->update_audience_group_authority_level: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **update_audience_group_authority_level_request** | [**UpdateAudienceGroupAuthorityLevelRequest**](UpdateAudienceGroupAuthorityLevelRequest.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[Bearer](../README.md#Bearer) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **update_audience_group_description** > update_audience_group_description(audience_group_id, update_audience_group_description_request) diff --git a/linebot/v3/audience/models/__init__.py b/linebot/v3/audience/models/__init__.py index f215e2f2a..77cbe49b4 100644 --- a/linebot/v3/audience/models/__init__.py +++ b/linebot/v3/audience/models/__init__.py @@ -18,7 +18,6 @@ from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience import Audience from linebot.v3.audience.models.audience_group import AudienceGroup -from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute from linebot.v3.audience.models.audience_group_failed_type import AudienceGroupFailedType from linebot.v3.audience.models.audience_group_job import AudienceGroupJob @@ -38,9 +37,7 @@ from linebot.v3.audience.models.error_detail import ErrorDetail from linebot.v3.audience.models.error_response import ErrorResponse from linebot.v3.audience.models.get_audience_data_response import GetAudienceDataResponse -from linebot.v3.audience.models.get_audience_group_authority_level_response import GetAudienceGroupAuthorityLevelResponse from linebot.v3.audience.models.get_audience_groups_response import GetAudienceGroupsResponse from linebot.v3.audience.models.get_shared_audience_data_response import GetSharedAudienceDataResponse from linebot.v3.audience.models.get_shared_audience_groups_response import GetSharedAudienceGroupsResponse -from linebot.v3.audience.models.update_audience_group_authority_level_request import UpdateAudienceGroupAuthorityLevelRequest from linebot.v3.audience.models.update_audience_group_description_request import UpdateAudienceGroupDescriptionRequest diff --git a/linebot/v3/audience/models/audience_group_authority_level.py b/linebot/v3/audience/models/audience_group_authority_level.py deleted file mode 100644 index 1c65f2628..000000000 --- a/linebot/v3/audience/models/audience_group_authority_level.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - LINE Messaging API - - This document describes LINE Messaging API. # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - - - -class AudienceGroupAuthorityLevel(str, Enum): - """ - authority level - """ - - """ - allowed enum values - """ - PUBLIC = 'PUBLIC' - PRIVATE = 'PRIVATE' - - @classmethod - def from_json(cls, json_str: str) -> AudienceGroupAuthorityLevel: - """Create an instance of AudienceGroupAuthorityLevel from a JSON string""" - return AudienceGroupAuthorityLevel(json.loads(json_str)) - - diff --git a/linebot/v3/audience/models/get_audience_group_authority_level_response.py b/linebot/v3/audience/models/get_audience_group_authority_level_response.py deleted file mode 100644 index 0f45127a4..000000000 --- a/linebot/v3/audience/models/get_audience_group_authority_level_response.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding: utf-8 - -""" - LINE Messaging API - - This document describes LINE Messaging API. # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Optional -from pydantic.v1 import BaseModel, Field -from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel - -class GetAudienceGroupAuthorityLevelResponse(BaseModel): - """ - Get the authority level of the audience - https://developers.line.biz/en/reference/messaging-api/#get-authority-level - """ - authority_level: Optional[AudienceGroupAuthorityLevel] = Field(None, alias="authorityLevel") - - __properties = ["authorityLevel"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> GetAudienceGroupAuthorityLevelResponse: - """Create an instance of GetAudienceGroupAuthorityLevelResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> GetAudienceGroupAuthorityLevelResponse: - """Create an instance of GetAudienceGroupAuthorityLevelResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return GetAudienceGroupAuthorityLevelResponse.parse_obj(obj) - - _obj = GetAudienceGroupAuthorityLevelResponse.parse_obj({ - "authority_level": obj.get("authorityLevel") - }) - return _obj - diff --git a/linebot/v3/audience/models/update_audience_group_authority_level_request.py b/linebot/v3/audience/models/update_audience_group_authority_level_request.py deleted file mode 100644 index c7bc22d1d..000000000 --- a/linebot/v3/audience/models/update_audience_group_authority_level_request.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding: utf-8 - -""" - LINE Messaging API - - This document describes LINE Messaging API. # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Optional -from pydantic.v1 import BaseModel, Field -from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel - -class UpdateAudienceGroupAuthorityLevelRequest(BaseModel): - """ - Change the authority level of the audience - https://developers.line.biz/en/reference/messaging-api/#change-authority-level - """ - authority_level: Optional[AudienceGroupAuthorityLevel] = Field(None, alias="authorityLevel") - - __properties = ["authorityLevel"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> UpdateAudienceGroupAuthorityLevelRequest: - """Create an instance of UpdateAudienceGroupAuthorityLevelRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> UpdateAudienceGroupAuthorityLevelRequest: - """Create an instance of UpdateAudienceGroupAuthorityLevelRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return UpdateAudienceGroupAuthorityLevelRequest.parse_obj(obj) - - _obj = UpdateAudienceGroupAuthorityLevelRequest.parse_obj({ - "authority_level": obj.get("authorityLevel") - }) - return _obj -