diff --git a/generator/src/main/java/line/bot/generator/PythonNextgenCustomClientGenerator.java b/generator/src/main/java/line/bot/generator/PythonNextgenCustomClientGenerator.java index 7d840301b..098bbdd57 100644 --- a/generator/src/main/java/line/bot/generator/PythonNextgenCustomClientGenerator.java +++ b/generator/src/main/java/line/bot/generator/PythonNextgenCustomClientGenerator.java @@ -1055,7 +1055,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List item = new HashMap<>(); - item.put("import", String.format(Locale.ROOT, "from pydantic import %s\n", StringUtils.join(pydanticImports, ", "))); + item.put("import", String.format(Locale.ROOT, "from pydantic.v1 import %s\n", StringUtils.join(pydanticImports, ", "))); newImports.add(item); } diff --git a/generator/src/main/resources/python-nextgen-custom-client/api.mustache b/generator/src/main/resources/python-nextgen-custom-client/api.mustache index 9b1df65d9..52ca63b7d 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/api.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/api.mustache @@ -5,7 +5,7 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated{{#asyncio}} from typing import overload, Optional, Union, Awaitable{{/asyncio}} diff --git a/generator/src/main/resources/python-nextgen-custom-client/api_response.mustache b/generator/src/main/resources/python-nextgen-custom-client/api_response.mustache index d81c2ff58..5cc59478a 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/api_response.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/api_response.mustache @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache b/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache index 9f8bd3661..3930f5754 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/asyncio/async_api.mustache @@ -6,7 +6,7 @@ import re # noqa: F401 import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable diff --git a/generator/src/main/resources/python-nextgen-custom-client/model_anyof.mustache b/generator/src/main/resources/python-nextgen-custom-client/model_anyof.mustache index f963021e0..79a1e1ce1 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/model_anyof.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/model_anyof.mustache @@ -5,12 +5,12 @@ import pprint import re # noqa: F401 {{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} +{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic.v1 import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-model-imports}} {{{.}}} {{/vendorExtensions.x-py-model-imports}} from typing import Any, List -from pydantic import StrictStr, Field +from pydantic.v1 import StrictStr, Field {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] diff --git a/generator/src/main/resources/python-nextgen-custom-client/model_enum.mustache b/generator/src/main/resources/python-nextgen-custom-client/model_enum.mustache index 83f0552c7..d9348dc12 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/model_enum.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/model_enum.mustache @@ -4,7 +4,7 @@ import re # noqa: F401 from aenum import Enum, no_arg {{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} +{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic.v1 import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum): diff --git a/generator/src/main/resources/python-nextgen-custom-client/model_generic.mustache b/generator/src/main/resources/python-nextgen-custom-client/model_generic.mustache index 7d2b1d25f..448d1fc68 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/model_generic.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/model_generic.mustache @@ -10,7 +10,7 @@ import {{{modelPackage}}} {{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} +{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic.v1 import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-model-imports}} {{{.}}} {{/vendorExtensions.x-py-model-imports}} @@ -147,7 +147,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#isArray}} {{^items.isPrimitiveType}} {{^items.isEnumOrRef}} - # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in {{{name}}} (list) _items = [] if self.{{{name}}}: for _item in self.{{{name}}}: @@ -160,7 +160,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#isMap}} {{^items.isPrimitiveType}} {{^items.isEnumOrRef}} - # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict) + # override the default output from pydantic.v1 by calling `to_dict()` of each value in {{{name}}} (dict) _field_dict = {} if self.{{{name}}}: for _key in self.{{{name}}}: @@ -174,7 +174,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{^isContainer}} {{^isPrimitiveType}} {{^isEnumOrRef}} - # override the default output from pydantic by calling `to_dict()` of {{{name}}} + # override the default output from pydantic.v1 by calling `to_dict()` of {{{name}}} if self.{{{name}}}: _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict() {{/isEnumOrRef}} diff --git a/generator/src/main/resources/python-nextgen-custom-client/model_oneof.mustache b/generator/src/main/resources/python-nextgen-custom-client/model_oneof.mustache index 9bba34bad..15f8bdeaf 100644 --- a/generator/src/main/resources/python-nextgen-custom-client/model_oneof.mustache +++ b/generator/src/main/resources/python-nextgen-custom-client/model_oneof.mustache @@ -5,12 +5,12 @@ import pprint import re # noqa: F401 {{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} +{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic.v1 import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-model-imports}} {{{.}}} {{/vendorExtensions.x-py-model-imports}} from typing import Any, List -from pydantic import StrictStr, Field +from pydantic.v1 import StrictStr, Field {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] diff --git a/linebot/v3/audience/api/async_manage_audience.py b/linebot/v3/audience/api/async_manage_audience.py index 865d3b77b..ffe023095 100644 --- a/linebot/v3/audience/api/async_manage_audience.py +++ b/linebot/v3/audience/api/async_manage_audience.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictBool, StrictInt, StrictStr, conint +from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr, conint from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute diff --git a/linebot/v3/audience/api/async_manage_audience_blob.py b/linebot/v3/audience/api/async_manage_audience_blob.py index 81fc3435f..d62761ab4 100644 --- a/linebot/v3/audience/api/async_manage_audience_blob.py +++ b/linebot/v3/audience/api/async_manage_audience_blob.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, constr +from pydantic.v1 import Field, StrictBool, StrictBytes, StrictInt, StrictStr, constr from typing import Optional, Union diff --git a/linebot/v3/audience/api/manage_audience.py b/linebot/v3/audience/api/manage_audience.py index 189d923b0..c3fa9efc5 100644 --- a/linebot/v3/audience/api/manage_audience.py +++ b/linebot/v3/audience/api/manage_audience.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, conint +from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr, conint from linebot.v3.audience.models.add_audience_to_audience_group_request import AddAudienceToAudienceGroupRequest from linebot.v3.audience.models.audience_group_create_route import AudienceGroupCreateRoute diff --git a/linebot/v3/audience/api/manage_audience_blob.py b/linebot/v3/audience/api/manage_audience_blob.py index d678c3070..14335a5de 100644 --- a/linebot/v3/audience/api/manage_audience_blob.py +++ b/linebot/v3/audience/api/manage_audience_blob.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, constr +from pydantic.v1 import Field, StrictBool, StrictBytes, StrictInt, StrictStr, constr from typing import Optional, Union diff --git a/linebot/v3/audience/api_response.py b/linebot/v3/audience/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/audience/api_response.py +++ b/linebot/v3/audience/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/audience/models/add_audience_to_audience_group_request.py b/linebot/v3/audience/models/add_audience_to_audience_group_request.py index 1c908f457..5d6e3941d 100644 --- a/linebot/v3/audience/models/add_audience_to_audience_group_request.py +++ b/linebot/v3/audience/models/add_audience_to_audience_group_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist from linebot.v3.audience.models.audience import Audience class AddAudienceToAudienceGroupRequest(BaseModel): @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in audiences (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in audiences (list) _items = [] if self.audiences: for _item in self.audiences: diff --git a/linebot/v3/audience/models/audience.py b/linebot/v3/audience/models/audience.py index 91e939efb..613350ff0 100644 --- a/linebot/v3/audience/models/audience.py +++ b/linebot/v3/audience/models/audience.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class Audience(BaseModel): """ diff --git a/linebot/v3/audience/models/audience_group.py b/linebot/v3/audience/models/audience_group.py index 457737bcc..dce160971 100644 --- a/linebot/v3/audience/models/audience_group.py +++ b/linebot/v3/audience/models/audience_group.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr 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_permission import AudienceGroupPermission diff --git a/linebot/v3/audience/models/audience_group_job.py b/linebot/v3/audience/models/audience_group_job.py index 355f07b07..5c4ee0f93 100644 --- a/linebot/v3/audience/models/audience_group_job.py +++ b/linebot/v3/audience/models/audience_group_job.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.audience.models.audience_group_job_failed_type import AudienceGroupJobFailedType from linebot.v3.audience.models.audience_group_job_status import AudienceGroupJobStatus from linebot.v3.audience.models.audience_group_job_type import AudienceGroupJobType diff --git a/linebot/v3/audience/models/create_audience_group_request.py b/linebot/v3/audience/models/create_audience_group_request.py index 2c880364c..3d855e668 100644 --- a/linebot/v3/audience/models/create_audience_group_request.py +++ b/linebot/v3/audience/models/create_audience_group_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist, constr from linebot.v3.audience.models.audience import Audience class CreateAudienceGroupRequest(BaseModel): @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in audiences (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in audiences (list) _items = [] if self.audiences: for _item in self.audiences: diff --git a/linebot/v3/audience/models/create_audience_group_response.py b/linebot/v3/audience/models/create_audience_group_response.py index 67ccb8614..485fdac22 100644 --- a/linebot/v3/audience/models/create_audience_group_response.py +++ b/linebot/v3/audience/models/create_audience_group_response.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, validator from linebot.v3.audience.models.audience_group_type import AudienceGroupType class CreateAudienceGroupResponse(BaseModel): diff --git a/linebot/v3/audience/models/create_click_based_audience_group_request.py b/linebot/v3/audience/models/create_click_based_audience_group_request.py index dcc29517e..e758ca59a 100644 --- a/linebot/v3/audience/models/create_click_based_audience_group_request.py +++ b/linebot/v3/audience/models/create_click_based_audience_group_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic.v1 import BaseModel, Field, StrictStr, constr class CreateClickBasedAudienceGroupRequest(BaseModel): """ diff --git a/linebot/v3/audience/models/create_click_based_audience_group_response.py b/linebot/v3/audience/models/create_click_based_audience_group_response.py index 462292a95..0a6e41cc4 100644 --- a/linebot/v3/audience/models/create_click_based_audience_group_response.py +++ b/linebot/v3/audience/models/create_click_based_audience_group_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator from linebot.v3.audience.models.audience_group_type import AudienceGroupType class CreateClickBasedAudienceGroupResponse(BaseModel): diff --git a/linebot/v3/audience/models/create_imp_based_audience_group_request.py b/linebot/v3/audience/models/create_imp_based_audience_group_request.py index b0b818e66..f0262465f 100644 --- a/linebot/v3/audience/models/create_imp_based_audience_group_request.py +++ b/linebot/v3/audience/models/create_imp_based_audience_group_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic.v1 import BaseModel, Field, StrictStr, constr class CreateImpBasedAudienceGroupRequest(BaseModel): """ diff --git a/linebot/v3/audience/models/create_imp_based_audience_group_response.py b/linebot/v3/audience/models/create_imp_based_audience_group_response.py index da89817ad..bdd8d1fd0 100644 --- a/linebot/v3/audience/models/create_imp_based_audience_group_response.py +++ b/linebot/v3/audience/models/create_imp_based_audience_group_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.audience.models.audience_group_type import AudienceGroupType class CreateImpBasedAudienceGroupResponse(BaseModel): diff --git a/linebot/v3/audience/models/error_detail.py b/linebot/v3/audience/models/error_detail.py index 3cd416562..d36626e4d 100644 --- a/linebot/v3/audience/models/error_detail.py +++ b/linebot/v3/audience/models/error_detail.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ErrorDetail(BaseModel): """ diff --git a/linebot/v3/audience/models/error_response.py b/linebot/v3/audience/models/error_response.py index 3ec529223..bb4e17936 100644 --- a/linebot/v3/audience/models/error_response.py +++ b/linebot/v3/audience/models/error_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.audience.models.error_detail import ErrorDetail class ErrorResponse(BaseModel): @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in details (list) _items = [] if self.details: for _item in self.details: diff --git a/linebot/v3/audience/models/get_audience_data_response.py b/linebot/v3/audience/models/get_audience_data_response.py index 9dbc4f705..81b9d962f 100644 --- a/linebot/v3/audience/models/get_audience_data_response.py +++ b/linebot/v3/audience/models/get_audience_data_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.audience.models.audience_group import AudienceGroup from linebot.v3.audience.models.audience_group_job import AudienceGroupJob @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of audience_group + # override the default output from pydantic.v1 by calling `to_dict()` of audience_group if self.audience_group: _dict['audienceGroup'] = self.audience_group.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: for _item in self.jobs: 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 index 802bc2fa0..0f45127a4 100644 --- a/linebot/v3/audience/models/get_audience_group_authority_level_response.py +++ b/linebot/v3/audience/models/get_audience_group_authority_level_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel class GetAudienceGroupAuthorityLevelResponse(BaseModel): diff --git a/linebot/v3/audience/models/get_audience_groups_response.py b/linebot/v3/audience/models/get_audience_groups_response.py index b33cdb4fb..a4ff35bfc 100644 --- a/linebot/v3/audience/models/get_audience_groups_response.py +++ b/linebot/v3/audience/models/get_audience_groups_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, conlist from linebot.v3.audience.models.audience_group import AudienceGroup class GetAudienceGroupsResponse(BaseModel): @@ -60,7 +60,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in audience_groups (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in audience_groups (list) _items = [] if self.audience_groups: for _item in self.audience_groups: 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 index a61d8fafe..c7bc22d1d 100644 --- a/linebot/v3/audience/models/update_audience_group_authority_level_request.py +++ b/linebot/v3/audience/models/update_audience_group_authority_level_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.audience.models.audience_group_authority_level import AudienceGroupAuthorityLevel class UpdateAudienceGroupAuthorityLevelRequest(BaseModel): diff --git a/linebot/v3/audience/models/update_audience_group_description_request.py b/linebot/v3/audience/models/update_audience_group_description_request.py index f1a7cdbb1..5f30375f9 100644 --- a/linebot/v3/audience/models/update_audience_group_description_request.py +++ b/linebot/v3/audience/models/update_audience_group_description_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic.v1 import BaseModel, Field, constr class UpdateAudienceGroupDescriptionRequest(BaseModel): """ diff --git a/linebot/v3/insight/api/async_insight.py b/linebot/v3/insight/api/async_insight.py index 5aba89104..0a74ac31f 100644 --- a/linebot/v3/insight/api/async_insight.py +++ b/linebot/v3/insight/api/async_insight.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, constr, validator +from pydantic.v1 import Field, constr, validator from typing import Optional diff --git a/linebot/v3/insight/api/insight.py b/linebot/v3/insight/api/insight.py index 983e7ceeb..7cb1f70fe 100644 --- a/linebot/v3/insight/api/insight.py +++ b/linebot/v3/insight/api/insight.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, constr, validator +from pydantic.v1 import Field, constr, validator from typing import Optional diff --git a/linebot/v3/insight/api_response.py b/linebot/v3/insight/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/insight/api_response.py +++ b/linebot/v3/insight/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/insight/models/age_tile.py b/linebot/v3/insight/models/age_tile.py index e7e69a4f3..9378cc811 100644 --- a/linebot/v3/insight/models/age_tile.py +++ b/linebot/v3/insight/models/age_tile.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator class AgeTile(BaseModel): """ diff --git a/linebot/v3/insight/models/app_type_tile.py b/linebot/v3/insight/models/app_type_tile.py index 20ee81467..45f2e5c14 100644 --- a/linebot/v3/insight/models/app_type_tile.py +++ b/linebot/v3/insight/models/app_type_tile.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator class AppTypeTile(BaseModel): """ diff --git a/linebot/v3/insight/models/area_tile.py b/linebot/v3/insight/models/area_tile.py index a20bd9d32..ddc930374 100644 --- a/linebot/v3/insight/models/area_tile.py +++ b/linebot/v3/insight/models/area_tile.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr class AreaTile(BaseModel): """ diff --git a/linebot/v3/insight/models/error_detail.py b/linebot/v3/insight/models/error_detail.py index 21c63f8a5..badd22c53 100644 --- a/linebot/v3/insight/models/error_detail.py +++ b/linebot/v3/insight/models/error_detail.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ErrorDetail(BaseModel): """ diff --git a/linebot/v3/insight/models/error_response.py b/linebot/v3/insight/models/error_response.py index 2d3352b26..5a80e17c0 100644 --- a/linebot/v3/insight/models/error_response.py +++ b/linebot/v3/insight/models/error_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.insight.models.error_detail import ErrorDetail class ErrorResponse(BaseModel): @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in details (list) _items = [] if self.details: for _item in self.details: diff --git a/linebot/v3/insight/models/gender_tile.py b/linebot/v3/insight/models/gender_tile.py index f4a0f68e5..ea18a0c91 100644 --- a/linebot/v3/insight/models/gender_tile.py +++ b/linebot/v3/insight/models/gender_tile.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator class GenderTile(BaseModel): """ diff --git a/linebot/v3/insight/models/get_friends_demographics_response.py b/linebot/v3/insight/models/get_friends_demographics_response.py index 8f1906640..eafcc5120 100644 --- a/linebot/v3/insight/models/get_friends_demographics_response.py +++ b/linebot/v3/insight/models/get_friends_demographics_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, conlist from linebot.v3.insight.models.age_tile import AgeTile from linebot.v3.insight.models.app_type_tile import AppTypeTile from linebot.v3.insight.models.area_tile import AreaTile @@ -64,35 +64,35 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in genders (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in genders (list) _items = [] if self.genders: for _item in self.genders: if _item: _items.append(_item.to_dict()) _dict['genders'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in ages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in ages (list) _items = [] if self.ages: for _item in self.ages: if _item: _items.append(_item.to_dict()) _dict['ages'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in areas (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in areas (list) _items = [] if self.areas: for _item in self.areas: if _item: _items.append(_item.to_dict()) _dict['areas'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in app_types (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in app_types (list) _items = [] if self.app_types: for _item in self.app_types: if _item: _items.append(_item.to_dict()) _dict['appTypes'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in subscription_periods (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in subscription_periods (list) _items = [] if self.subscription_periods: for _item in self.subscription_periods: diff --git a/linebot/v3/insight/models/get_message_event_response.py b/linebot/v3/insight/models/get_message_event_response.py index 228098434..f9cf41f4e 100644 --- a/linebot/v3/insight/models/get_message_event_response.py +++ b/linebot/v3/insight/models/get_message_event_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.insight.models.get_message_event_response_click import GetMessageEventResponseClick from linebot.v3.insight.models.get_message_event_response_message import GetMessageEventResponseMessage from linebot.v3.insight.models.get_message_event_response_overview import GetMessageEventResponseOverview @@ -59,17 +59,17 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of overview + # override the default output from pydantic.v1 by calling `to_dict()` of overview if self.overview: _dict['overview'] = self.overview.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: if _item: _items.append(_item.to_dict()) _dict['messages'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in clicks (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in clicks (list) _items = [] if self.clicks: for _item in self.clicks: diff --git a/linebot/v3/insight/models/get_message_event_response_click.py b/linebot/v3/insight/models/get_message_event_response_click.py index 0c57c20b9..3fd0866fc 100644 --- a/linebot/v3/insight/models/get_message_event_response_click.py +++ b/linebot/v3/insight/models/get_message_event_response_click.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class GetMessageEventResponseClick(BaseModel): """ diff --git a/linebot/v3/insight/models/get_message_event_response_message.py b/linebot/v3/insight/models/get_message_event_response_message.py index 675bfe740..a6227c615 100644 --- a/linebot/v3/insight/models/get_message_event_response_message.py +++ b/linebot/v3/insight/models/get_message_event_response_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class GetMessageEventResponseMessage(BaseModel): """ diff --git a/linebot/v3/insight/models/get_message_event_response_overview.py b/linebot/v3/insight/models/get_message_event_response_overview.py index 0533f21dd..477293f5b 100644 --- a/linebot/v3/insight/models/get_message_event_response_overview.py +++ b/linebot/v3/insight/models/get_message_event_response_overview.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class GetMessageEventResponseOverview(BaseModel): """ diff --git a/linebot/v3/insight/models/get_number_of_followers_response.py b/linebot/v3/insight/models/get_number_of_followers_response.py index c3eeb967d..8673a4985 100644 --- a/linebot/v3/insight/models/get_number_of_followers_response.py +++ b/linebot/v3/insight/models/get_number_of_followers_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator class GetNumberOfFollowersResponse(BaseModel): """ diff --git a/linebot/v3/insight/models/get_number_of_message_deliveries_response.py b/linebot/v3/insight/models/get_number_of_message_deliveries_response.py index 4151d3254..2db0a2ea5 100644 --- a/linebot/v3/insight/models/get_number_of_message_deliveries_response.py +++ b/linebot/v3/insight/models/get_number_of_message_deliveries_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator class GetNumberOfMessageDeliveriesResponse(BaseModel): """ diff --git a/linebot/v3/insight/models/get_statistics_per_unit_response.py b/linebot/v3/insight/models/get_statistics_per_unit_response.py index 189e9392c..4032cb178 100644 --- a/linebot/v3/insight/models/get_statistics_per_unit_response.py +++ b/linebot/v3/insight/models/get_statistics_per_unit_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.insight.models.get_statistics_per_unit_response_click import GetStatisticsPerUnitResponseClick from linebot.v3.insight.models.get_statistics_per_unit_response_message import GetStatisticsPerUnitResponseMessage from linebot.v3.insight.models.get_statistics_per_unit_response_overview import GetStatisticsPerUnitResponseOverview @@ -59,17 +59,17 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of overview + # override the default output from pydantic.v1 by calling `to_dict()` of overview if self.overview: _dict['overview'] = self.overview.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: if _item: _items.append(_item.to_dict()) _dict['messages'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in clicks (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in clicks (list) _items = [] if self.clicks: for _item in self.clicks: diff --git a/linebot/v3/insight/models/get_statistics_per_unit_response_click.py b/linebot/v3/insight/models/get_statistics_per_unit_response_click.py index 71b412aba..6b5eb445b 100644 --- a/linebot/v3/insight/models/get_statistics_per_unit_response_click.py +++ b/linebot/v3/insight/models/get_statistics_per_unit_response_click.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class GetStatisticsPerUnitResponseClick(BaseModel): """ diff --git a/linebot/v3/insight/models/get_statistics_per_unit_response_message.py b/linebot/v3/insight/models/get_statistics_per_unit_response_message.py index 626b71afd..b766d42e8 100644 --- a/linebot/v3/insight/models/get_statistics_per_unit_response_message.py +++ b/linebot/v3/insight/models/get_statistics_per_unit_response_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class GetStatisticsPerUnitResponseMessage(BaseModel): """ diff --git a/linebot/v3/insight/models/get_statistics_per_unit_response_overview.py b/linebot/v3/insight/models/get_statistics_per_unit_response_overview.py index 033de633c..8dead06a2 100644 --- a/linebot/v3/insight/models/get_statistics_per_unit_response_overview.py +++ b/linebot/v3/insight/models/get_statistics_per_unit_response_overview.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class GetStatisticsPerUnitResponseOverview(BaseModel): """ diff --git a/linebot/v3/insight/models/subscription_period_tile.py b/linebot/v3/insight/models/subscription_period_tile.py index d892c6050..2106cb359 100644 --- a/linebot/v3/insight/models/subscription_period_tile.py +++ b/linebot/v3/insight/models/subscription_period_tile.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator class SubscriptionPeriodTile(BaseModel): """ diff --git a/linebot/v3/liff/api/async_liff.py b/linebot/v3/liff/api/async_liff.py index d06be1163..611a77d4c 100644 --- a/linebot/v3/liff/api/async_liff.py +++ b/linebot/v3/liff/api/async_liff.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from linebot.v3.liff.models.add_liff_app_request import AddLiffAppRequest from linebot.v3.liff.models.add_liff_app_response import AddLiffAppResponse diff --git a/linebot/v3/liff/api/liff.py b/linebot/v3/liff/api/liff.py index 6a5309052..00139da00 100644 --- a/linebot/v3/liff/api/liff.py +++ b/linebot/v3/liff/api/liff.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from linebot.v3.liff.models.add_liff_app_request import AddLiffAppRequest from linebot.v3.liff.models.add_liff_app_response import AddLiffAppResponse diff --git a/linebot/v3/liff/api_response.py b/linebot/v3/liff/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/liff/api_response.py +++ b/linebot/v3/liff/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/liff/models/add_liff_app_request.py b/linebot/v3/liff/models/add_liff_app_request.py index f1b446892..0004cad2b 100644 --- a/linebot/v3/liff/models/add_liff_app_request.py +++ b/linebot/v3/liff/models/add_liff_app_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.liff.models.liff_bot_prompt import LiffBotPrompt from linebot.v3.liff.models.liff_features import LiffFeatures from linebot.v3.liff.models.liff_scope import LiffScope @@ -63,10 +63,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of view + # override the default output from pydantic.v1 by calling `to_dict()` of view if self.view: _dict['view'] = self.view.to_dict() - # override the default output from pydantic by calling `to_dict()` of features + # override the default output from pydantic.v1 by calling `to_dict()` of features if self.features: _dict['features'] = self.features.to_dict() return _dict diff --git a/linebot/v3/liff/models/add_liff_app_response.py b/linebot/v3/liff/models/add_liff_app_response.py index fc69f9161..215335396 100644 --- a/linebot/v3/liff/models/add_liff_app_response.py +++ b/linebot/v3/liff/models/add_liff_app_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class AddLiffAppResponse(BaseModel): """ diff --git a/linebot/v3/liff/models/get_all_liff_apps_response.py b/linebot/v3/liff/models/get_all_liff_apps_response.py index 4104f9626..4fb446ad2 100644 --- a/linebot/v3/liff/models/get_all_liff_apps_response.py +++ b/linebot/v3/liff/models/get_all_liff_apps_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic.v1 import BaseModel, conlist from linebot.v3.liff.models.liff_app import LiffApp class GetAllLiffAppsResponse(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in apps (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in apps (list) _items = [] if self.apps: for _item in self.apps: diff --git a/linebot/v3/liff/models/liff_app.py b/linebot/v3/liff/models/liff_app.py index 528a22826..693c98e03 100644 --- a/linebot/v3/liff/models/liff_app.py +++ b/linebot/v3/liff/models/liff_app.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.liff.models.liff_bot_prompt import LiffBotPrompt from linebot.v3.liff.models.liff_features import LiffFeatures from linebot.v3.liff.models.liff_scope import LiffScope @@ -63,10 +63,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of view + # override the default output from pydantic.v1 by calling `to_dict()` of view if self.view: _dict['view'] = self.view.to_dict() - # override the default output from pydantic by calling `to_dict()` of features + # override the default output from pydantic.v1 by calling `to_dict()` of features if self.features: _dict['features'] = self.features.to_dict() return _dict diff --git a/linebot/v3/liff/models/liff_features.py b/linebot/v3/liff/models/liff_features.py index 8372d68a8..b12666969 100644 --- a/linebot/v3/liff/models/liff_features.py +++ b/linebot/v3/liff/models/liff_features.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool +from pydantic.v1 import BaseModel, Field, StrictBool class LiffFeatures(BaseModel): """ diff --git a/linebot/v3/liff/models/liff_view.py b/linebot/v3/liff/models/liff_view.py index 40f894f7e..761986c92 100644 --- a/linebot/v3/liff/models/liff_view.py +++ b/linebot/v3/liff/models/liff_view.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator class LiffView(BaseModel): """ diff --git a/linebot/v3/liff/models/update_liff_app_request.py b/linebot/v3/liff/models/update_liff_app_request.py index e41269f95..88f676eb3 100644 --- a/linebot/v3/liff/models/update_liff_app_request.py +++ b/linebot/v3/liff/models/update_liff_app_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.liff.models.liff_bot_prompt import LiffBotPrompt from linebot.v3.liff.models.liff_features import LiffFeatures from linebot.v3.liff.models.liff_scope import LiffScope @@ -63,10 +63,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of view + # override the default output from pydantic.v1 by calling `to_dict()` of view if self.view: _dict['view'] = self.view.to_dict() - # override the default output from pydantic by calling `to_dict()` of features + # override the default output from pydantic.v1 by calling `to_dict()` of features if self.features: _dict['features'] = self.features.to_dict() return _dict diff --git a/linebot/v3/messaging/api/async_messaging_api.py b/linebot/v3/messaging/api/async_messaging_api.py index fa29b8f0c..e74f51541 100644 --- a/linebot/v3/messaging/api/async_messaging_api.py +++ b/linebot/v3/messaging/api/async_messaging_api.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr, conint, constr, validator +from pydantic.v1 import Field, StrictStr, conint, constr, validator from typing import Optional diff --git a/linebot/v3/messaging/api/async_messaging_api_blob.py b/linebot/v3/messaging/api/async_messaging_api_blob.py index c6b0c99d7..8154e4134 100644 --- a/linebot/v3/messaging/api/async_messaging_api_blob.py +++ b/linebot/v3/messaging/api/async_messaging_api_blob.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictBytes, StrictStr +from pydantic.v1 import Field, StrictBytes, StrictStr from typing import Optional, Union diff --git a/linebot/v3/messaging/api/messaging_api.py b/linebot/v3/messaging/api/messaging_api.py index 93ee973a8..b9fbc285a 100644 --- a/linebot/v3/messaging/api/messaging_api.py +++ b/linebot/v3/messaging/api/messaging_api.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint, constr, validator +from pydantic.v1 import Field, StrictStr, conint, constr, validator from typing import Optional diff --git a/linebot/v3/messaging/api/messaging_api_blob.py b/linebot/v3/messaging/api/messaging_api_blob.py index 1d9ea4e3c..d30dc25a6 100644 --- a/linebot/v3/messaging/api/messaging_api_blob.py +++ b/linebot/v3/messaging/api/messaging_api_blob.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBytes, StrictStr +from pydantic.v1 import Field, StrictBytes, StrictStr from typing import Optional, Union diff --git a/linebot/v3/messaging/api_response.py b/linebot/v3/messaging/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/messaging/api_response.py +++ b/linebot/v3/messaging/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/messaging/models/action.py b/linebot/v3/messaging/models/action.py index 39a0207c6..8a9ffa7c8 100644 --- a/linebot/v3/messaging/models/action.py +++ b/linebot/v3/messaging/models/action.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class Action(BaseModel): """ diff --git a/linebot/v3/messaging/models/age_demographic_filter.py b/linebot/v3/messaging/models/age_demographic_filter.py index 1adaf27fa..a5f2a344b 100644 --- a/linebot/v3/messaging/models/age_demographic_filter.py +++ b/linebot/v3/messaging/models/age_demographic_filter.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.age_demographic import AgeDemographic from linebot.v3.messaging.models.demographic_filter import DemographicFilter diff --git a/linebot/v3/messaging/models/alt_uri.py b/linebot/v3/messaging/models/alt_uri.py index 0e6843baf..028a9920c 100644 --- a/linebot/v3/messaging/models/alt_uri.py +++ b/linebot/v3/messaging/models/alt_uri.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, constr +from pydantic.v1 import BaseModel, constr class AltUri(BaseModel): """ diff --git a/linebot/v3/messaging/models/app_type_demographic_filter.py b/linebot/v3/messaging/models/app_type_demographic_filter.py index 37f0bf6dc..65c283215 100644 --- a/linebot/v3/messaging/models/app_type_demographic_filter.py +++ b/linebot/v3/messaging/models/app_type_demographic_filter.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.app_type_demographic import AppTypeDemographic from linebot.v3.messaging.models.demographic_filter import DemographicFilter diff --git a/linebot/v3/messaging/models/area_demographic_filter.py b/linebot/v3/messaging/models/area_demographic_filter.py index 0ae07d39e..41ed8126b 100644 --- a/linebot/v3/messaging/models/area_demographic_filter.py +++ b/linebot/v3/messaging/models/area_demographic_filter.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.area_demographic import AreaDemographic from linebot.v3.messaging.models.demographic_filter import DemographicFilter diff --git a/linebot/v3/messaging/models/audience_match_messages_request.py b/linebot/v3/messaging/models/audience_match_messages_request.py index 190785ba0..f7927c2b5 100644 --- a/linebot/v3/messaging/models/audience_match_messages_request.py +++ b/linebot/v3/messaging/models/audience_match_messages_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist from linebot.v3.messaging.models.message import Message class AudienceMatchMessagesRequest(BaseModel): @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/audience_recipient.py b/linebot/v3/messaging/models/audience_recipient.py index bdc94df50..8fb2a15fa 100644 --- a/linebot/v3/messaging/models/audience_recipient.py +++ b/linebot/v3/messaging/models/audience_recipient.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt from linebot.v3.messaging.models.recipient import Recipient class AudienceRecipient(Recipient): diff --git a/linebot/v3/messaging/models/audio_message.py b/linebot/v3/messaging/models/audio_message.py index 1fc351534..788275971 100644 --- a/linebot/v3/messaging/models/audio_message.py +++ b/linebot/v3/messaging/models/audio_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/messaging/models/bot_info_response.py b/linebot/v3/messaging/models/bot_info_response.py index 494cc12b3..9035aeed9 100644 --- a/linebot/v3/messaging/models/bot_info_response.py +++ b/linebot/v3/messaging/models/bot_info_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class BotInfoResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/broadcast_request.py b/linebot/v3/messaging/models/broadcast_request.py index 18b1fde9b..cf5feb984 100644 --- a/linebot/v3/messaging/models/broadcast_request.py +++ b/linebot/v3/messaging/models/broadcast_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, conlist from linebot.v3.messaging.models.message import Message class BroadcastRequest(BaseModel): @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/buttons_template.py b/linebot/v3/messaging/models/buttons_template.py index bc52dbc06..99da9aec3 100644 --- a/linebot/v3/messaging/models/buttons_template.py +++ b/linebot/v3/messaging/models/buttons_template.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.template import Template @@ -63,10 +63,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of default_action + # override the default output from pydantic.v1 by calling `to_dict()` of default_action if self.default_action: _dict['defaultAction'] = self.default_action.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in actions (list) _items = [] if self.actions: for _item in self.actions: diff --git a/linebot/v3/messaging/models/camera_action.py b/linebot/v3/messaging/models/camera_action.py index 5e9dbcc57..8bfda9247 100644 --- a/linebot/v3/messaging/models/camera_action.py +++ b/linebot/v3/messaging/models/camera_action.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.action import Action class CameraAction(Action): diff --git a/linebot/v3/messaging/models/camera_roll_action.py b/linebot/v3/messaging/models/camera_roll_action.py index 9fdb34551..523c8813d 100644 --- a/linebot/v3/messaging/models/camera_roll_action.py +++ b/linebot/v3/messaging/models/camera_roll_action.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.action import Action class CameraRollAction(Action): diff --git a/linebot/v3/messaging/models/carousel_column.py b/linebot/v3/messaging/models/carousel_column.py index f8e1b199d..fb78867f2 100644 --- a/linebot/v3/messaging/models/carousel_column.py +++ b/linebot/v3/messaging/models/carousel_column.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.messaging.models.action import Action class CarouselColumn(BaseModel): @@ -59,10 +59,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of default_action + # override the default output from pydantic.v1 by calling `to_dict()` of default_action if self.default_action: _dict['defaultAction'] = self.default_action.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in actions (list) _items = [] if self.actions: for _item in self.actions: diff --git a/linebot/v3/messaging/models/carousel_template.py b/linebot/v3/messaging/models/carousel_template.py index 236ebfd47..77a794b2f 100644 --- a/linebot/v3/messaging/models/carousel_template.py +++ b/linebot/v3/messaging/models/carousel_template.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.messaging.models.carousel_column import CarouselColumn from linebot.v3.messaging.models.template import Template @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in columns (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in columns (list) _items = [] if self.columns: for _item in self.columns: diff --git a/linebot/v3/messaging/models/chat_reference.py b/linebot/v3/messaging/models/chat_reference.py index bd869293b..35a0ae3eb 100644 --- a/linebot/v3/messaging/models/chat_reference.py +++ b/linebot/v3/messaging/models/chat_reference.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ChatReference(BaseModel): """ diff --git a/linebot/v3/messaging/models/confirm_template.py b/linebot/v3/messaging/models/confirm_template.py index f5846569a..2e517c63d 100644 --- a/linebot/v3/messaging/models/confirm_template.py +++ b/linebot/v3/messaging/models/confirm_template.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, StrictStr, conlist +from pydantic.v1 import BaseModel, StrictStr, conlist from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.template import Template @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in actions (list) _items = [] if self.actions: for _item in self.actions: diff --git a/linebot/v3/messaging/models/create_rich_menu_alias_request.py b/linebot/v3/messaging/models/create_rich_menu_alias_request.py index 92e1bad47..1b5d6966b 100644 --- a/linebot/v3/messaging/models/create_rich_menu_alias_request.py +++ b/linebot/v3/messaging/models/create_rich_menu_alias_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr, constr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, constr, validator class CreateRichMenuAliasRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/datetime_picker_action.py b/linebot/v3/messaging/models/datetime_picker_action.py index e6eda55cf..b70433bd8 100644 --- a/linebot/v3/messaging/models/datetime_picker_action.py +++ b/linebot/v3/messaging/models/datetime_picker_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr, constr, validator +from pydantic.v1 import BaseModel, StrictStr, constr, validator from linebot.v3.messaging.models.action import Action class DatetimePickerAction(Action): diff --git a/linebot/v3/messaging/models/demographic_filter.py b/linebot/v3/messaging/models/demographic_filter.py index 30b80e6f6..d07550de9 100644 --- a/linebot/v3/messaging/models/demographic_filter.py +++ b/linebot/v3/messaging/models/demographic_filter.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class DemographicFilter(BaseModel): """ diff --git a/linebot/v3/messaging/models/emoji.py b/linebot/v3/messaging/models/emoji.py index 1e39fbd5b..f13beef81 100644 --- a/linebot/v3/messaging/models/emoji.py +++ b/linebot/v3/messaging/models/emoji.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class Emoji(BaseModel): """ diff --git a/linebot/v3/messaging/models/error_detail.py b/linebot/v3/messaging/models/error_detail.py index 3cd416562..d36626e4d 100644 --- a/linebot/v3/messaging/models/error_detail.py +++ b/linebot/v3/messaging/models/error_detail.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ErrorDetail(BaseModel): """ diff --git a/linebot/v3/messaging/models/error_response.py b/linebot/v3/messaging/models/error_response.py index 40c247012..4e7737788 100644 --- a/linebot/v3/messaging/models/error_response.py +++ b/linebot/v3/messaging/models/error_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.messaging.models.error_detail import ErrorDetail class ErrorResponse(BaseModel): @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in details (list) _items = [] if self.details: for _item in self.details: diff --git a/linebot/v3/messaging/models/filter.py b/linebot/v3/messaging/models/filter.py index 9e3521548..3bbdc0828 100644 --- a/linebot/v3/messaging/models/filter.py +++ b/linebot/v3/messaging/models/filter.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.demographic_filter import DemographicFilter class Filter(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of demographic + # override the default output from pydantic.v1 by calling `to_dict()` of demographic if self.demographic: _dict['demographic'] = self.demographic.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_block_style.py b/linebot/v3/messaging/models/flex_block_style.py index 08b30814a..de738cf33 100644 --- a/linebot/v3/messaging/models/flex_block_style.py +++ b/linebot/v3/messaging/models/flex_block_style.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr class FlexBlockStyle(BaseModel): """ diff --git a/linebot/v3/messaging/models/flex_box.py b/linebot/v3/messaging/models/flex_box.py index 8ec725dd7..3955a2a55 100644 --- a/linebot/v3/messaging/models/flex_box.py +++ b/linebot/v3/messaging/models/flex_box.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist, validator from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_box_background import FlexBoxBackground from linebot.v3.messaging.models.flex_component import FlexComponent @@ -123,17 +123,17 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in contents (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in contents (list) _items = [] if self.contents: for _item in self.contents: if _item: _items.append(_item.to_dict()) _dict['contents'] = _items - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() - # override the default output from pydantic by calling `to_dict()` of background + # override the default output from pydantic.v1 by calling `to_dict()` of background if self.background: _dict['background'] = self.background.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_box_background.py b/linebot/v3/messaging/models/flex_box_background.py index a42d3ca6f..017b06fb5 100644 --- a/linebot/v3/messaging/models/flex_box_background.py +++ b/linebot/v3/messaging/models/flex_box_background.py @@ -20,7 +20,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class FlexBoxBackground(BaseModel): """ diff --git a/linebot/v3/messaging/models/flex_box_linear_gradient.py b/linebot/v3/messaging/models/flex_box_linear_gradient.py index 0fd410112..a0c120817 100644 --- a/linebot/v3/messaging/models/flex_box_linear_gradient.py +++ b/linebot/v3/messaging/models/flex_box_linear_gradient.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.flex_box_background import FlexBoxBackground class FlexBoxLinearGradient(FlexBoxBackground): diff --git a/linebot/v3/messaging/models/flex_bubble.py b/linebot/v3/messaging/models/flex_bubble.py index 21b0cbcee..250c725ac 100644 --- a/linebot/v3/messaging/models/flex_bubble.py +++ b/linebot/v3/messaging/models/flex_bubble.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr, validator +from pydantic.v1 import BaseModel, StrictStr, validator from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_box import FlexBox from linebot.v3.messaging.models.flex_bubble_styles import FlexBubbleStyles @@ -86,22 +86,22 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of styles + # override the default output from pydantic.v1 by calling `to_dict()` of styles if self.styles: _dict['styles'] = self.styles.to_dict() - # override the default output from pydantic by calling `to_dict()` of header + # override the default output from pydantic.v1 by calling `to_dict()` of header if self.header: _dict['header'] = self.header.to_dict() - # override the default output from pydantic by calling `to_dict()` of hero + # override the default output from pydantic.v1 by calling `to_dict()` of hero if self.hero: _dict['hero'] = self.hero.to_dict() - # override the default output from pydantic by calling `to_dict()` of body + # override the default output from pydantic.v1 by calling `to_dict()` of body if self.body: _dict['body'] = self.body.to_dict() - # override the default output from pydantic by calling `to_dict()` of footer + # override the default output from pydantic.v1 by calling `to_dict()` of footer if self.footer: _dict['footer'] = self.footer.to_dict() - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_bubble_styles.py b/linebot/v3/messaging/models/flex_bubble_styles.py index f8a289888..e66d10d8b 100644 --- a/linebot/v3/messaging/models/flex_bubble_styles.py +++ b/linebot/v3/messaging/models/flex_bubble_styles.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.flex_block_style import FlexBlockStyle class FlexBubbleStyles(BaseModel): @@ -57,16 +57,16 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of header + # override the default output from pydantic.v1 by calling `to_dict()` of header if self.header: _dict['header'] = self.header.to_dict() - # override the default output from pydantic by calling `to_dict()` of hero + # override the default output from pydantic.v1 by calling `to_dict()` of hero if self.hero: _dict['hero'] = self.hero.to_dict() - # override the default output from pydantic by calling `to_dict()` of body + # override the default output from pydantic.v1 by calling `to_dict()` of body if self.body: _dict['body'] = self.body.to_dict() - # override the default output from pydantic by calling `to_dict()` of footer + # override the default output from pydantic.v1 by calling `to_dict()` of footer if self.footer: _dict['footer'] = self.footer.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_button.py b/linebot/v3/messaging/models/flex_button.py index 2cc03543c..04fadb63b 100644 --- a/linebot/v3/messaging/models/flex_button.py +++ b/linebot/v3/messaging/models/flex_button.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_component import FlexComponent @@ -119,7 +119,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_carousel.py b/linebot/v3/messaging/models/flex_carousel.py index 201018537..1b4e35332 100644 --- a/linebot/v3/messaging/models/flex_carousel.py +++ b/linebot/v3/messaging/models/flex_carousel.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic.v1 import BaseModel, conlist from linebot.v3.messaging.models.flex_bubble import FlexBubble from linebot.v3.messaging.models.flex_container import FlexContainer @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in contents (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in contents (list) _items = [] if self.contents: for _item in self.contents: diff --git a/linebot/v3/messaging/models/flex_component.py b/linebot/v3/messaging/models/flex_component.py index 6ebc4ab93..20eaa5b61 100644 --- a/linebot/v3/messaging/models/flex_component.py +++ b/linebot/v3/messaging/models/flex_component.py @@ -20,7 +20,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class FlexComponent(BaseModel): """ diff --git a/linebot/v3/messaging/models/flex_container.py b/linebot/v3/messaging/models/flex_container.py index 37c2fa5a0..3964833ab 100644 --- a/linebot/v3/messaging/models/flex_container.py +++ b/linebot/v3/messaging/models/flex_container.py @@ -20,7 +20,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class FlexContainer(BaseModel): """ diff --git a/linebot/v3/messaging/models/flex_filler.py b/linebot/v3/messaging/models/flex_filler.py index fba6497c9..0b6fcabb6 100644 --- a/linebot/v3/messaging/models/flex_filler.py +++ b/linebot/v3/messaging/models/flex_filler.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictInt +from pydantic.v1 import BaseModel, StrictInt from linebot.v3.messaging.models.flex_component import FlexComponent class FlexFiller(FlexComponent): diff --git a/linebot/v3/messaging/models/flex_icon.py b/linebot/v3/messaging/models/flex_icon.py index 1763bdda5..ab4e9da13 100644 --- a/linebot/v3/messaging/models/flex_icon.py +++ b/linebot/v3/messaging/models/flex_icon.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator from linebot.v3.messaging.models.flex_component import FlexComponent class FlexIcon(FlexComponent): diff --git a/linebot/v3/messaging/models/flex_image.py b/linebot/v3/messaging/models/flex_image.py index c63d93bd0..c449bc6f5 100644 --- a/linebot/v3/messaging/models/flex_image.py +++ b/linebot/v3/messaging/models/flex_image.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_component import FlexComponent @@ -112,7 +112,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_message.py b/linebot/v3/messaging/models/flex_message.py index 4f63372d9..40c9c22ac 100644 --- a/linebot/v3/messaging/models/flex_message.py +++ b/linebot/v3/messaging/models/flex_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.flex_container import FlexContainer from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() - # override the default output from pydantic by calling `to_dict()` of contents + # override the default output from pydantic.v1 by calling `to_dict()` of contents if self.contents: _dict['contents'] = self.contents.to_dict() return _dict diff --git a/linebot/v3/messaging/models/flex_separator.py b/linebot/v3/messaging/models/flex_separator.py index 2cb355f03..dde0e6d0d 100644 --- a/linebot/v3/messaging/models/flex_separator.py +++ b/linebot/v3/messaging/models/flex_separator.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic.v1 import BaseModel, StrictStr from linebot.v3.messaging.models.flex_component import FlexComponent class FlexSeparator(FlexComponent): diff --git a/linebot/v3/messaging/models/flex_span.py b/linebot/v3/messaging/models/flex_span.py index 8fbdb9074..6a28e9983 100644 --- a/linebot/v3/messaging/models/flex_span.py +++ b/linebot/v3/messaging/models/flex_span.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr, validator +from pydantic.v1 import BaseModel, StrictStr, validator from linebot.v3.messaging.models.flex_component import FlexComponent class FlexSpan(FlexComponent): diff --git a/linebot/v3/messaging/models/flex_text.py b/linebot/v3/messaging/models/flex_text.py index e958d5e39..efe2c74e5 100644 --- a/linebot/v3/messaging/models/flex_text.py +++ b/linebot/v3/messaging/models/flex_text.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist, validator from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_component import FlexComponent from linebot.v3.messaging.models.flex_span import FlexSpan @@ -148,10 +148,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in contents (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in contents (list) _items = [] if self.contents: for _item in self.contents: diff --git a/linebot/v3/messaging/models/flex_video.py b/linebot/v3/messaging/models/flex_video.py index 405e53351..b0d78c2e3 100644 --- a/linebot/v3/messaging/models/flex_video.py +++ b/linebot/v3/messaging/models/flex_video.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.flex_component import FlexComponent @@ -60,10 +60,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of alt_content + # override the default output from pydantic.v1 by calling `to_dict()` of alt_content if self.alt_content: _dict['altContent'] = self.alt_content.to_dict() - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/gender_demographic_filter.py b/linebot/v3/messaging/models/gender_demographic_filter.py index 600362615..693ba9eb4 100644 --- a/linebot/v3/messaging/models/gender_demographic_filter.py +++ b/linebot/v3/messaging/models/gender_demographic_filter.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.demographic_filter import DemographicFilter from linebot.v3.messaging.models.gender_demographic import GenderDemographic diff --git a/linebot/v3/messaging/models/get_aggregation_unit_name_list_response.py b/linebot/v3/messaging/models/get_aggregation_unit_name_list_response.py index 0f720c72f..562f60815 100644 --- a/linebot/v3/messaging/models/get_aggregation_unit_name_list_response.py +++ b/linebot/v3/messaging/models/get_aggregation_unit_name_list_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class GetAggregationUnitNameListResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/get_aggregation_unit_usage_response.py b/linebot/v3/messaging/models/get_aggregation_unit_usage_response.py index 915641bae..b7ba852bd 100644 --- a/linebot/v3/messaging/models/get_aggregation_unit_usage_response.py +++ b/linebot/v3/messaging/models/get_aggregation_unit_usage_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class GetAggregationUnitUsageResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/get_followers_response.py b/linebot/v3/messaging/models/get_followers_response.py index b305a11f5..2bb703ae8 100644 --- a/linebot/v3/messaging/models/get_followers_response.py +++ b/linebot/v3/messaging/models/get_followers_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class GetFollowersResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/get_message_content_transcoding_response.py b/linebot/v3/messaging/models/get_message_content_transcoding_response.py index a70ea8679..6ec3b5f73 100644 --- a/linebot/v3/messaging/models/get_message_content_transcoding_response.py +++ b/linebot/v3/messaging/models/get_message_content_transcoding_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class GetMessageContentTranscodingResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/get_webhook_endpoint_response.py b/linebot/v3/messaging/models/get_webhook_endpoint_response.py index 6454c3f7e..ccacf62ac 100644 --- a/linebot/v3/messaging/models/get_webhook_endpoint_response.py +++ b/linebot/v3/messaging/models/get_webhook_endpoint_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr class GetWebhookEndpointResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/group_member_count_response.py b/linebot/v3/messaging/models/group_member_count_response.py index c72e3429a..37424ba4c 100644 --- a/linebot/v3/messaging/models/group_member_count_response.py +++ b/linebot/v3/messaging/models/group_member_count_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class GroupMemberCountResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/group_summary_response.py b/linebot/v3/messaging/models/group_summary_response.py index 887bb11cb..6f3db12ab 100644 --- a/linebot/v3/messaging/models/group_summary_response.py +++ b/linebot/v3/messaging/models/group_summary_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class GroupSummaryResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/group_user_profile_response.py b/linebot/v3/messaging/models/group_user_profile_response.py index 865a1423c..f23249815 100644 --- a/linebot/v3/messaging/models/group_user_profile_response.py +++ b/linebot/v3/messaging/models/group_user_profile_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class GroupUserProfileResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/image_carousel_column.py b/linebot/v3/messaging/models/image_carousel_column.py index 92c4f8f0f..7a5f127a6 100644 --- a/linebot/v3/messaging/models/image_carousel_column.py +++ b/linebot/v3/messaging/models/image_carousel_column.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.action import Action class ImageCarouselColumn(BaseModel): @@ -55,7 +55,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/image_carousel_template.py b/linebot/v3/messaging/models/image_carousel_template.py index c360f2dc3..f929eb18a 100644 --- a/linebot/v3/messaging/models/image_carousel_template.py +++ b/linebot/v3/messaging/models/image_carousel_template.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic.v1 import BaseModel, conlist from linebot.v3.messaging.models.image_carousel_column import ImageCarouselColumn from linebot.v3.messaging.models.template import Template @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in columns (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in columns (list) _items = [] if self.columns: for _item in self.columns: diff --git a/linebot/v3/messaging/models/image_message.py b/linebot/v3/messaging/models/image_message.py index f607ebdf7..ba301a554 100644 --- a/linebot/v3/messaging/models/image_message.py +++ b/linebot/v3/messaging/models/image_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/messaging/models/imagemap_action.py b/linebot/v3/messaging/models/imagemap_action.py index 6d87067e5..c120738a6 100644 --- a/linebot/v3/messaging/models/imagemap_action.py +++ b/linebot/v3/messaging/models/imagemap_action.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.imagemap_area import ImagemapArea class ImagemapAction(BaseModel): @@ -75,7 +75,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of area + # override the default output from pydantic.v1 by calling `to_dict()` of area if self.area: _dict['area'] = self.area.to_dict() return _dict diff --git a/linebot/v3/messaging/models/imagemap_area.py b/linebot/v3/messaging/models/imagemap_area.py index b0720b584..3c3c97803 100644 --- a/linebot/v3/messaging/models/imagemap_area.py +++ b/linebot/v3/messaging/models/imagemap_area.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictInt +from pydantic.v1 import BaseModel, StrictInt class ImagemapArea(BaseModel): """ diff --git a/linebot/v3/messaging/models/imagemap_base_size.py b/linebot/v3/messaging/models/imagemap_base_size.py index 2a8f20609..59f681a57 100644 --- a/linebot/v3/messaging/models/imagemap_base_size.py +++ b/linebot/v3/messaging/models/imagemap_base_size.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictInt +from pydantic.v1 import BaseModel, StrictInt class ImagemapBaseSize(BaseModel): """ diff --git a/linebot/v3/messaging/models/imagemap_external_link.py b/linebot/v3/messaging/models/imagemap_external_link.py index 3719692cc..1c9fa761c 100644 --- a/linebot/v3/messaging/models/imagemap_external_link.py +++ b/linebot/v3/messaging/models/imagemap_external_link.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ImagemapExternalLink(BaseModel): """ diff --git a/linebot/v3/messaging/models/imagemap_message.py b/linebot/v3/messaging/models/imagemap_message.py index 5281f47f2..9f52b3ec2 100644 --- a/linebot/v3/messaging/models/imagemap_message.py +++ b/linebot/v3/messaging/models/imagemap_message.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.messaging.models.imagemap_action import ImagemapAction from linebot.v3.messaging.models.imagemap_base_size import ImagemapBaseSize from linebot.v3.messaging.models.imagemap_video import ImagemapVideo @@ -65,23 +65,23 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() - # override the default output from pydantic by calling `to_dict()` of base_size + # override the default output from pydantic.v1 by calling `to_dict()` of base_size if self.base_size: _dict['baseSize'] = self.base_size.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in actions (list) _items = [] if self.actions: for _item in self.actions: if _item: _items.append(_item.to_dict()) _dict['actions'] = _items - # override the default output from pydantic by calling `to_dict()` of video + # override the default output from pydantic.v1 by calling `to_dict()` of video if self.video: _dict['video'] = self.video.to_dict() return _dict diff --git a/linebot/v3/messaging/models/imagemap_video.py b/linebot/v3/messaging/models/imagemap_video.py index bc0f1dc08..511206055 100644 --- a/linebot/v3/messaging/models/imagemap_video.py +++ b/linebot/v3/messaging/models/imagemap_video.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.imagemap_area import ImagemapArea from linebot.v3.messaging.models.imagemap_external_link import ImagemapExternalLink @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of area + # override the default output from pydantic.v1 by calling `to_dict()` of area if self.area: _dict['area'] = self.area.to_dict() - # override the default output from pydantic by calling `to_dict()` of external_link + # override the default output from pydantic.v1 by calling `to_dict()` of external_link if self.external_link: _dict['externalLink'] = self.external_link.to_dict() return _dict diff --git a/linebot/v3/messaging/models/issue_link_token_response.py b/linebot/v3/messaging/models/issue_link_token_response.py index b864cd6c5..516b7303b 100644 --- a/linebot/v3/messaging/models/issue_link_token_response.py +++ b/linebot/v3/messaging/models/issue_link_token_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class IssueLinkTokenResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/limit.py b/linebot/v3/messaging/models/limit.py index ceb52e89a..1d5c167cb 100644 --- a/linebot/v3/messaging/models/limit.py +++ b/linebot/v3/messaging/models/limit.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, conint +from pydantic.v1 import BaseModel, Field, StrictBool, conint class Limit(BaseModel): """ diff --git a/linebot/v3/messaging/models/location_action.py b/linebot/v3/messaging/models/location_action.py index 6f3436ab8..143f5b9db 100644 --- a/linebot/v3/messaging/models/location_action.py +++ b/linebot/v3/messaging/models/location_action.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.action import Action class LocationAction(Action): diff --git a/linebot/v3/messaging/models/location_message.py b/linebot/v3/messaging/models/location_message.py index 74395d40b..169dbc70f 100644 --- a/linebot/v3/messaging/models/location_message.py +++ b/linebot/v3/messaging/models/location_message.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic.v1 import BaseModel, StrictFloat, StrictInt, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -60,10 +60,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/messaging/models/mark_messages_as_read_request.py b/linebot/v3/messaging/models/mark_messages_as_read_request.py index 7896c4f4b..bc5237a10 100644 --- a/linebot/v3/messaging/models/mark_messages_as_read_request.py +++ b/linebot/v3/messaging/models/mark_messages_as_read_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.messaging.models.chat_reference import ChatReference class MarkMessagesAsReadRequest(BaseModel): @@ -55,7 +55,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of chat + # override the default output from pydantic.v1 by calling `to_dict()` of chat if self.chat: _dict['chat'] = self.chat.to_dict() return _dict diff --git a/linebot/v3/messaging/models/members_ids_response.py b/linebot/v3/messaging/models/members_ids_response.py index 82689cda8..045a0ec5f 100644 --- a/linebot/v3/messaging/models/members_ids_response.py +++ b/linebot/v3/messaging/models/members_ids_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class MembersIdsResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/message.py b/linebot/v3/messaging/models/message.py index 961d69076..01c07a31b 100644 --- a/linebot/v3/messaging/models/message.py +++ b/linebot/v3/messaging/models/message.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -84,10 +84,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/messaging/models/message_action.py b/linebot/v3/messaging/models/message_action.py index b7bf1718b..7b6ec8f72 100644 --- a/linebot/v3/messaging/models/message_action.py +++ b/linebot/v3/messaging/models/message_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic.v1 import BaseModel, StrictStr from linebot.v3.messaging.models.action import Action class MessageAction(Action): diff --git a/linebot/v3/messaging/models/message_imagemap_action.py b/linebot/v3/messaging/models/message_imagemap_action.py index ca1e64856..7e8df68f4 100644 --- a/linebot/v3/messaging/models/message_imagemap_action.py +++ b/linebot/v3/messaging/models/message_imagemap_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic.v1 import BaseModel, StrictStr from linebot.v3.messaging.models.imagemap_action import ImagemapAction from linebot.v3.messaging.models.imagemap_area import ImagemapArea @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of area + # override the default output from pydantic.v1 by calling `to_dict()` of area if self.area: _dict['area'] = self.area.to_dict() return _dict diff --git a/linebot/v3/messaging/models/message_quota_response.py b/linebot/v3/messaging/models/message_quota_response.py index 9f6438f97..fd5619219 100644 --- a/linebot/v3/messaging/models/message_quota_response.py +++ b/linebot/v3/messaging/models/message_quota_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt from linebot.v3.messaging.models.quota_type import QuotaType class MessageQuotaResponse(BaseModel): diff --git a/linebot/v3/messaging/models/multicast_request.py b/linebot/v3/messaging/models/multicast_request.py index f6affa11f..af3d0d88a 100644 --- a/linebot/v3/messaging/models/multicast_request.py +++ b/linebot/v3/messaging/models/multicast_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr, validator +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist, constr, validator from linebot.v3.messaging.models.message import Message class MulticastRequest(BaseModel): @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/narrowcast_progress_response.py b/linebot/v3/messaging/models/narrowcast_progress_response.py index ea1664951..8fb8d27fe 100644 --- a/linebot/v3/messaging/models/narrowcast_progress_response.py +++ b/linebot/v3/messaging/models/narrowcast_progress_response.py @@ -19,7 +19,7 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator class NarrowcastProgressResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/narrowcast_request.py b/linebot/v3/messaging/models/narrowcast_request.py index bec0ea220..d71c1dcc1 100644 --- a/linebot/v3/messaging/models/narrowcast_request.py +++ b/linebot/v3/messaging/models/narrowcast_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, conlist from linebot.v3.messaging.models.filter import Filter from linebot.v3.messaging.models.limit import Limit from linebot.v3.messaging.models.message import Message @@ -62,20 +62,20 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: if _item: _items.append(_item.to_dict()) _dict['messages'] = _items - # override the default output from pydantic by calling `to_dict()` of recipient + # override the default output from pydantic.v1 by calling `to_dict()` of recipient if self.recipient: _dict['recipient'] = self.recipient.to_dict() - # override the default output from pydantic by calling `to_dict()` of filter + # override the default output from pydantic.v1 by calling `to_dict()` of filter if self.filter: _dict['filter'] = self.filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of limit + # override the default output from pydantic.v1 by calling `to_dict()` of limit if self.limit: _dict['limit'] = self.limit.to_dict() return _dict diff --git a/linebot/v3/messaging/models/number_of_messages_response.py b/linebot/v3/messaging/models/number_of_messages_response.py index 1e023aaeb..c269e543e 100644 --- a/linebot/v3/messaging/models/number_of_messages_response.py +++ b/linebot/v3/messaging/models/number_of_messages_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator class NumberOfMessagesResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/operator_demographic_filter.py b/linebot/v3/messaging/models/operator_demographic_filter.py index 0b7f8a5d3..5db6103df 100644 --- a/linebot/v3/messaging/models/operator_demographic_filter.py +++ b/linebot/v3/messaging/models/operator_demographic_filter.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.demographic_filter import DemographicFilter class OperatorDemographicFilter(DemographicFilter): @@ -57,21 +57,21 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in var_and (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in var_and (list) _items = [] if self.var_and: for _item in self.var_and: if _item: _items.append(_item.to_dict()) _dict['and'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in var_or (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in var_or (list) _items = [] if self.var_or: for _item in self.var_or: if _item: _items.append(_item.to_dict()) _dict['or'] = _items - # override the default output from pydantic by calling `to_dict()` of var_not + # override the default output from pydantic.v1 by calling `to_dict()` of var_not if self.var_not: _dict['not'] = self.var_not.to_dict() return _dict diff --git a/linebot/v3/messaging/models/operator_recipient.py b/linebot/v3/messaging/models/operator_recipient.py index ee02045e5..28e3a504a 100644 --- a/linebot/v3/messaging/models/operator_recipient.py +++ b/linebot/v3/messaging/models/operator_recipient.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.recipient import Recipient class OperatorRecipient(Recipient): @@ -57,21 +57,21 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in var_and (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in var_and (list) _items = [] if self.var_and: for _item in self.var_and: if _item: _items.append(_item.to_dict()) _dict['and'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in var_or (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in var_or (list) _items = [] if self.var_or: for _item in self.var_or: if _item: _items.append(_item.to_dict()) _dict['or'] = _items - # override the default output from pydantic by calling `to_dict()` of var_not + # override the default output from pydantic.v1 by calling `to_dict()` of var_not if self.var_not: _dict['not'] = self.var_not.to_dict() return _dict diff --git a/linebot/v3/messaging/models/pnp_messages_request.py b/linebot/v3/messaging/models/pnp_messages_request.py index 7e281b0be..b9e7d0c30 100644 --- a/linebot/v3/messaging/models/pnp_messages_request.py +++ b/linebot/v3/messaging/models/pnp_messages_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist from linebot.v3.messaging.models.message import Message class PnpMessagesRequest(BaseModel): @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/postback_action.py b/linebot/v3/messaging/models/postback_action.py index 1d23c17c0..238b6b77f 100644 --- a/linebot/v3/messaging/models/postback_action.py +++ b/linebot/v3/messaging/models/postback_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, constr, validator from linebot.v3.messaging.models.action import Action class PostbackAction(Action): diff --git a/linebot/v3/messaging/models/push_message_request.py b/linebot/v3/messaging/models/push_message_request.py index b61f01411..050b8b4d7 100644 --- a/linebot/v3/messaging/models/push_message_request.py +++ b/linebot/v3/messaging/models/push_message_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist from linebot.v3.messaging.models.message import Message class PushMessageRequest(BaseModel): @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/quick_reply.py b/linebot/v3/messaging/models/quick_reply.py index 0d6bf9d58..89bfd9353 100644 --- a/linebot/v3/messaging/models/quick_reply.py +++ b/linebot/v3/messaging/models/quick_reply.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.quick_reply_item import QuickReplyItem class QuickReply(BaseModel): @@ -55,7 +55,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in items (list) _items = [] if self.items: for _item in self.items: diff --git a/linebot/v3/messaging/models/quick_reply_item.py b/linebot/v3/messaging/models/quick_reply_item.py index e4d594037..5e8984194 100644 --- a/linebot/v3/messaging/models/quick_reply_item.py +++ b/linebot/v3/messaging/models/quick_reply_item.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic.v1 import BaseModel, Field, StrictStr, constr from linebot.v3.messaging.models.action import Action class QuickReplyItem(BaseModel): @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/quota_consumption_response.py b/linebot/v3/messaging/models/quota_consumption_response.py index 9e1aa55ec..d7ce36447 100644 --- a/linebot/v3/messaging/models/quota_consumption_response.py +++ b/linebot/v3/messaging/models/quota_consumption_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class QuotaConsumptionResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/recipient.py b/linebot/v3/messaging/models/recipient.py index 593c11b7c..b4a6c9445 100644 --- a/linebot/v3/messaging/models/recipient.py +++ b/linebot/v3/messaging/models/recipient.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class Recipient(BaseModel): """ diff --git a/linebot/v3/messaging/models/redelivery_recipient.py b/linebot/v3/messaging/models/redelivery_recipient.py index 57bc7c482..2f1d43591 100644 --- a/linebot/v3/messaging/models/redelivery_recipient.py +++ b/linebot/v3/messaging/models/redelivery_recipient.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.recipient import Recipient class RedeliveryRecipient(Recipient): diff --git a/linebot/v3/messaging/models/reply_message_request.py b/linebot/v3/messaging/models/reply_message_request.py index 614e0e254..ec6fdb992 100644 --- a/linebot/v3/messaging/models/reply_message_request.py +++ b/linebot/v3/messaging/models/reply_message_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist from linebot.v3.messaging.models.message import Message class ReplyMessageRequest(BaseModel): @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/rich_menu_alias_list_response.py b/linebot/v3/messaging/models/rich_menu_alias_list_response.py index d2d2002de..af49ad367 100644 --- a/linebot/v3/messaging/models/rich_menu_alias_list_response.py +++ b/linebot/v3/messaging/models/rich_menu_alias_list_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.rich_menu_alias_response import RichMenuAliasResponse class RichMenuAliasListResponse(BaseModel): @@ -55,7 +55,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in aliases (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in aliases (list) _items = [] if self.aliases: for _item in self.aliases: diff --git a/linebot/v3/messaging/models/rich_menu_alias_response.py b/linebot/v3/messaging/models/rich_menu_alias_response.py index eb25965db..60c92d0ad 100644 --- a/linebot/v3/messaging/models/rich_menu_alias_response.py +++ b/linebot/v3/messaging/models/rich_menu_alias_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class RichMenuAliasResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_area.py b/linebot/v3/messaging/models/rich_menu_area.py index f4019366b..8db5710f2 100644 --- a/linebot/v3/messaging/models/rich_menu_area.py +++ b/linebot/v3/messaging/models/rich_menu_area.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.rich_menu_bounds import RichMenuBounds @@ -56,10 +56,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of bounds + # override the default output from pydantic.v1 by calling `to_dict()` of bounds if self.bounds: _dict['bounds'] = self.bounds.to_dict() - # override the default output from pydantic by calling `to_dict()` of action + # override the default output from pydantic.v1 by calling `to_dict()` of action if self.action: _dict['action'] = self.action.to_dict() return _dict diff --git a/linebot/v3/messaging/models/rich_menu_batch_link_operation.py b/linebot/v3/messaging/models/rich_menu_batch_link_operation.py index f5cec86e0..0457cb01d 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_link_operation.py +++ b/linebot/v3/messaging/models/rich_menu_batch_link_operation.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.rich_menu_batch_operation import RichMenuBatchOperation class RichMenuBatchLinkOperation(RichMenuBatchOperation): diff --git a/linebot/v3/messaging/models/rich_menu_batch_operation.py b/linebot/v3/messaging/models/rich_menu_batch_operation.py index bedae5126..c9aa3d16b 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_operation.py +++ b/linebot/v3/messaging/models/rich_menu_batch_operation.py @@ -20,7 +20,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class RichMenuBatchOperation(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_batch_progress_response.py b/linebot/v3/messaging/models/rich_menu_batch_progress_response.py index ea983ecc4..9cc8da6d5 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_progress_response.py +++ b/linebot/v3/messaging/models/rich_menu_batch_progress_response.py @@ -19,7 +19,7 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.messaging.models.rich_menu_batch_progress_phase import RichMenuBatchProgressPhase class RichMenuBatchProgressResponse(BaseModel): diff --git a/linebot/v3/messaging/models/rich_menu_batch_request.py b/linebot/v3/messaging/models/rich_menu_batch_request.py index be01843f0..f83ceaac2 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_request.py +++ b/linebot/v3/messaging/models/rich_menu_batch_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist, constr, validator +from pydantic.v1 import BaseModel, Field, conlist, constr, validator from linebot.v3.messaging.models.rich_menu_batch_operation import RichMenuBatchOperation class RichMenuBatchRequest(BaseModel): @@ -65,7 +65,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in operations (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in operations (list) _items = [] if self.operations: for _item in self.operations: diff --git a/linebot/v3/messaging/models/rich_menu_batch_unlink_all_operation.py b/linebot/v3/messaging/models/rich_menu_batch_unlink_all_operation.py index f1562c042..c8365358c 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_unlink_all_operation.py +++ b/linebot/v3/messaging/models/rich_menu_batch_unlink_all_operation.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.rich_menu_batch_operation import RichMenuBatchOperation class RichMenuBatchUnlinkAllOperation(RichMenuBatchOperation): diff --git a/linebot/v3/messaging/models/rich_menu_batch_unlink_operation.py b/linebot/v3/messaging/models/rich_menu_batch_unlink_operation.py index 1dfa79e50..3d4564e79 100644 --- a/linebot/v3/messaging/models/rich_menu_batch_unlink_operation.py +++ b/linebot/v3/messaging/models/rich_menu_batch_unlink_operation.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.rich_menu_batch_operation import RichMenuBatchOperation class RichMenuBatchUnlinkOperation(RichMenuBatchOperation): diff --git a/linebot/v3/messaging/models/rich_menu_bounds.py b/linebot/v3/messaging/models/rich_menu_bounds.py index e1f769f1d..ddf58b12e 100644 --- a/linebot/v3/messaging/models/rich_menu_bounds.py +++ b/linebot/v3/messaging/models/rich_menu_bounds.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, conint +from pydantic.v1 import BaseModel, Field, conint class RichMenuBounds(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_bulk_link_request.py b/linebot/v3/messaging/models/rich_menu_bulk_link_request.py index 77de1a4ed..0b7ef1f28 100644 --- a/linebot/v3/messaging/models/rich_menu_bulk_link_request.py +++ b/linebot/v3/messaging/models/rich_menu_bulk_link_request.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class RichMenuBulkLinkRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_bulk_unlink_request.py b/linebot/v3/messaging/models/rich_menu_bulk_unlink_request.py index 466ac45f3..0748af104 100644 --- a/linebot/v3/messaging/models/rich_menu_bulk_unlink_request.py +++ b/linebot/v3/messaging/models/rich_menu_bulk_unlink_request.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class RichMenuBulkUnlinkRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_id_response.py b/linebot/v3/messaging/models/rich_menu_id_response.py index 0015a386b..a8f504d33 100644 --- a/linebot/v3/messaging/models/rich_menu_id_response.py +++ b/linebot/v3/messaging/models/rich_menu_id_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class RichMenuIdResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_list_response.py b/linebot/v3/messaging/models/rich_menu_list_response.py index 794caab72..8a06db785 100644 --- a/linebot/v3/messaging/models/rich_menu_list_response.py +++ b/linebot/v3/messaging/models/rich_menu_list_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.rich_menu_response import RichMenuResponse class RichMenuListResponse(BaseModel): @@ -55,7 +55,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in richmenus (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in richmenus (list) _items = [] if self.richmenus: for _item in self.richmenus: diff --git a/linebot/v3/messaging/models/rich_menu_request.py b/linebot/v3/messaging/models/rich_menu_request.py index 0dfc1899a..3629be134 100644 --- a/linebot/v3/messaging/models/rich_menu_request.py +++ b/linebot/v3/messaging/models/rich_menu_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist, constr +from pydantic.v1 import BaseModel, Field, StrictBool, conlist, constr from linebot.v3.messaging.models.rich_menu_area import RichMenuArea from linebot.v3.messaging.models.rich_menu_size import RichMenuSize @@ -59,10 +59,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of size + # override the default output from pydantic.v1 by calling `to_dict()` of size if self.size: _dict['size'] = self.size.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in areas (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in areas (list) _items = [] if self.areas: for _item in self.areas: diff --git a/linebot/v3/messaging/models/rich_menu_response.py b/linebot/v3/messaging/models/rich_menu_response.py index 47eff4bee..c62086440 100644 --- a/linebot/v3/messaging/models/rich_menu_response.py +++ b/linebot/v3/messaging/models/rich_menu_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist, constr from linebot.v3.messaging.models.rich_menu_area import RichMenuArea from linebot.v3.messaging.models.rich_menu_size import RichMenuSize @@ -60,10 +60,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of size + # override the default output from pydantic.v1 by calling `to_dict()` of size if self.size: _dict['size'] = self.size.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in areas (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in areas (list) _items = [] if self.areas: for _item in self.areas: diff --git a/linebot/v3/messaging/models/rich_menu_size.py b/linebot/v3/messaging/models/rich_menu_size.py index 60711b84c..cd7571284 100644 --- a/linebot/v3/messaging/models/rich_menu_size.py +++ b/linebot/v3/messaging/models/rich_menu_size.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, conint +from pydantic.v1 import BaseModel, Field, conint class RichMenuSize(BaseModel): """ diff --git a/linebot/v3/messaging/models/rich_menu_switch_action.py b/linebot/v3/messaging/models/rich_menu_switch_action.py index 370850b94..833be8101 100644 --- a/linebot/v3/messaging/models/rich_menu_switch_action.py +++ b/linebot/v3/messaging/models/rich_menu_switch_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic.v1 import BaseModel, Field, constr from linebot.v3.messaging.models.action import Action class RichMenuSwitchAction(Action): diff --git a/linebot/v3/messaging/models/room_member_count_response.py b/linebot/v3/messaging/models/room_member_count_response.py index 425fcfabd..48decf154 100644 --- a/linebot/v3/messaging/models/room_member_count_response.py +++ b/linebot/v3/messaging/models/room_member_count_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class RoomMemberCountResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/room_user_profile_response.py b/linebot/v3/messaging/models/room_user_profile_response.py index 0d8a211b5..e7e938025 100644 --- a/linebot/v3/messaging/models/room_user_profile_response.py +++ b/linebot/v3/messaging/models/room_user_profile_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class RoomUserProfileResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/sender.py b/linebot/v3/messaging/models/sender.py index 2cbdb1b23..74ae00db4 100644 --- a/linebot/v3/messaging/models/sender.py +++ b/linebot/v3/messaging/models/sender.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic.v1 import BaseModel, Field, constr class Sender(BaseModel): """ diff --git a/linebot/v3/messaging/models/set_webhook_endpoint_request.py b/linebot/v3/messaging/models/set_webhook_endpoint_request.py index c100dffe5..fe9004abf 100644 --- a/linebot/v3/messaging/models/set_webhook_endpoint_request.py +++ b/linebot/v3/messaging/models/set_webhook_endpoint_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, constr +from pydantic.v1 import BaseModel, Field, constr class SetWebhookEndpointRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/sticker_message.py b/linebot/v3/messaging/models/sticker_message.py index 0552ec95a..00bd27d09 100644 --- a/linebot/v3/messaging/models/sticker_message.py +++ b/linebot/v3/messaging/models/sticker_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/messaging/models/subscription_period_demographic_filter.py b/linebot/v3/messaging/models/subscription_period_demographic_filter.py index ebb684473..e4332cb6b 100644 --- a/linebot/v3/messaging/models/subscription_period_demographic_filter.py +++ b/linebot/v3/messaging/models/subscription_period_demographic_filter.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.messaging.models.demographic_filter import DemographicFilter from linebot.v3.messaging.models.subscription_period_demographic import SubscriptionPeriodDemographic diff --git a/linebot/v3/messaging/models/template.py b/linebot/v3/messaging/models/template.py index b8c551f31..4d6bc9f09 100644 --- a/linebot/v3/messaging/models/template.py +++ b/linebot/v3/messaging/models/template.py @@ -20,7 +20,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class Template(BaseModel): """ diff --git a/linebot/v3/messaging/models/template_message.py b/linebot/v3/messaging/models/template_message.py index bec5c5b08..8fa27ec7c 100644 --- a/linebot/v3/messaging/models/template_message.py +++ b/linebot/v3/messaging/models/template_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() - # override the default output from pydantic by calling `to_dict()` of template + # override the default output from pydantic.v1 by calling `to_dict()` of template if self.template: _dict['template'] = self.template.to_dict() return _dict diff --git a/linebot/v3/messaging/models/test_webhook_endpoint_request.py b/linebot/v3/messaging/models/test_webhook_endpoint_request.py index ea59ace64..70ba4bd29 100644 --- a/linebot/v3/messaging/models/test_webhook_endpoint_request.py +++ b/linebot/v3/messaging/models/test_webhook_endpoint_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic.v1 import BaseModel, Field, constr class TestWebhookEndpointRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/test_webhook_endpoint_response.py b/linebot/v3/messaging/models/test_webhook_endpoint_response.py index ca7f76f23..94c94cdb7 100644 --- a/linebot/v3/messaging/models/test_webhook_endpoint_response.py +++ b/linebot/v3/messaging/models/test_webhook_endpoint_response.py @@ -19,7 +19,7 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr class TestWebhookEndpointResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/text_message.py b/linebot/v3/messaging/models/text_message.py index e6b42470d..56b38af27 100644 --- a/linebot/v3/messaging/models/text_message.py +++ b/linebot/v3/messaging/models/text_message.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, StrictStr, conlist +from pydantic.v1 import BaseModel, StrictStr, conlist from linebot.v3.messaging.models.emoji import Emoji from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in emojis (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in emojis (list) _items = [] if self.emojis: for _item in self.emojis: diff --git a/linebot/v3/messaging/models/update_rich_menu_alias_request.py b/linebot/v3/messaging/models/update_rich_menu_alias_request.py index de452ea5a..f8ab32120 100644 --- a/linebot/v3/messaging/models/update_rich_menu_alias_request.py +++ b/linebot/v3/messaging/models/update_rich_menu_alias_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class UpdateRichMenuAliasRequest(BaseModel): """ diff --git a/linebot/v3/messaging/models/uri_action.py b/linebot/v3/messaging/models/uri_action.py index eb7f036aa..ef1f8b095 100644 --- a/linebot/v3/messaging/models/uri_action.py +++ b/linebot/v3/messaging/models/uri_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.action import Action from linebot.v3.messaging.models.alt_uri import AltUri @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of alt_uri + # override the default output from pydantic.v1 by calling `to_dict()` of alt_uri if self.alt_uri: _dict['altUri'] = self.alt_uri.to_dict() return _dict diff --git a/linebot/v3/messaging/models/uri_imagemap_action.py b/linebot/v3/messaging/models/uri_imagemap_action.py index 98e6356a9..269887517 100644 --- a/linebot/v3/messaging/models/uri_imagemap_action.py +++ b/linebot/v3/messaging/models/uri_imagemap_action.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.imagemap_action import ImagemapAction from linebot.v3.messaging.models.imagemap_area import ImagemapArea @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of area + # override the default output from pydantic.v1 by calling `to_dict()` of area if self.area: _dict['area'] = self.area.to_dict() return _dict diff --git a/linebot/v3/messaging/models/user_profile_response.py b/linebot/v3/messaging/models/user_profile_response.py index 4debd4e88..0fffdbb40 100644 --- a/linebot/v3/messaging/models/user_profile_response.py +++ b/linebot/v3/messaging/models/user_profile_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class UserProfileResponse(BaseModel): """ diff --git a/linebot/v3/messaging/models/validate_message_request.py b/linebot/v3/messaging/models/validate_message_request.py index 24c45680b..be449fd9e 100644 --- a/linebot/v3/messaging/models/validate_message_request.py +++ b/linebot/v3/messaging/models/validate_message_request.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.messaging.models.message import Message class ValidateMessageRequest(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in messages (list) _items = [] if self.messages: for _item in self.messages: diff --git a/linebot/v3/messaging/models/video_message.py b/linebot/v3/messaging/models/video_message.py index 36cdb0ab9..de94cd55d 100644 --- a/linebot/v3/messaging/models/video_message.py +++ b/linebot/v3/messaging/models/video_message.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.messaging.models.message import Message from linebot.v3.messaging.models.quick_reply import QuickReply from linebot.v3.messaging.models.sender import Sender @@ -59,10 +59,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of quick_reply + # override the default output from pydantic.v1 by calling `to_dict()` of quick_reply if self.quick_reply: _dict['quickReply'] = self.quick_reply.to_dict() - # override the default output from pydantic by calling `to_dict()` of sender + # override the default output from pydantic.v1 by calling `to_dict()` of sender if self.sender: _dict['sender'] = self.sender.to_dict() return _dict diff --git a/linebot/v3/module/api/async_line_module.py b/linebot/v3/module/api/async_line_module.py index c1bca599f..c28cf1a71 100644 --- a/linebot/v3/module/api/async_line_module.py +++ b/linebot/v3/module/api/async_line_module.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr, conint +from pydantic.v1 import Field, StrictStr, conint from typing import Optional diff --git a/linebot/v3/module/api/line_module.py b/linebot/v3/module/api/line_module.py index d08fcffa3..ebe57351c 100644 --- a/linebot/v3/module/api/line_module.py +++ b/linebot/v3/module/api/line_module.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic.v1 import Field, StrictStr, conint from typing import Optional diff --git a/linebot/v3/module/api_response.py b/linebot/v3/module/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/module/api_response.py +++ b/linebot/v3/module/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/module/models/acquire_chat_control_request.py b/linebot/v3/module/models/acquire_chat_control_request.py index 028e8947d..143e1b033 100644 --- a/linebot/v3/module/models/acquire_chat_control_request.py +++ b/linebot/v3/module/models/acquire_chat_control_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, conint +from pydantic.v1 import BaseModel, Field, StrictBool, conint class AcquireChatControlRequest(BaseModel): """ diff --git a/linebot/v3/module/models/detach_module_request.py b/linebot/v3/module/models/detach_module_request.py index efbe787d1..3b741e538 100644 --- a/linebot/v3/module/models/detach_module_request.py +++ b/linebot/v3/module/models/detach_module_request.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class DetachModuleRequest(BaseModel): """ diff --git a/linebot/v3/module/models/get_modules_response.py b/linebot/v3/module/models/get_modules_response.py index a5085992a..c2be2f412 100644 --- a/linebot/v3/module/models/get_modules_response.py +++ b/linebot/v3/module/models/get_modules_response.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.module.models.module_bot import ModuleBot class GetModulesResponse(BaseModel): @@ -56,7 +56,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in bots (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in bots (list) _items = [] if self.bots: for _item in self.bots: diff --git a/linebot/v3/module/models/module_bot.py b/linebot/v3/module/models/module_bot.py index 6ebe9776f..d8d14fd39 100644 --- a/linebot/v3/module/models/module_bot.py +++ b/linebot/v3/module/models/module_bot.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ModuleBot(BaseModel): """ diff --git a/linebot/v3/moduleattach/api/async_line_module_attach.py b/linebot/v3/moduleattach/api/async_line_module_attach.py index 04746fa54..cba3c530f 100644 --- a/linebot/v3/moduleattach/api/async_line_module_attach.py +++ b/linebot/v3/moduleattach/api/async_line_module_attach.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from typing import Optional diff --git a/linebot/v3/moduleattach/api/line_module_attach.py b/linebot/v3/moduleattach/api/line_module_attach.py index c737c9b5c..fd48db184 100644 --- a/linebot/v3/moduleattach/api/line_module_attach.py +++ b/linebot/v3/moduleattach/api/line_module_attach.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from typing import Optional diff --git a/linebot/v3/moduleattach/api_response.py b/linebot/v3/moduleattach/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/moduleattach/api_response.py +++ b/linebot/v3/moduleattach/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/moduleattach/models/attach_module_response.py b/linebot/v3/moduleattach/models/attach_module_response.py index 3675b4e40..40cd2bf45 100644 --- a/linebot/v3/moduleattach/models/attach_module_response.py +++ b/linebot/v3/moduleattach/models/attach_module_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class AttachModuleResponse(BaseModel): """ diff --git a/linebot/v3/oauth/api/async_channel_access_token.py b/linebot/v3/oauth/api/async_channel_access_token.py index 59150eedb..653f5e595 100644 --- a/linebot/v3/oauth/api/async_channel_access_token.py +++ b/linebot/v3/oauth/api/async_channel_access_token.py @@ -16,11 +16,11 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from typing import Optional diff --git a/linebot/v3/oauth/api/channel_access_token.py b/linebot/v3/oauth/api/channel_access_token.py index 403a6f4cc..3ca7eab6c 100644 --- a/linebot/v3/oauth/api/channel_access_token.py +++ b/linebot/v3/oauth/api/channel_access_token.py @@ -15,10 +15,10 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic.v1 import Field, StrictStr from typing import Optional diff --git a/linebot/v3/oauth/api_response.py b/linebot/v3/oauth/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/oauth/api_response.py +++ b/linebot/v3/oauth/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/oauth/models/channel_access_token_key_ids_response.py b/linebot/v3/oauth/models/channel_access_token_key_ids_response.py index a5987e3d3..92618edcb 100644 --- a/linebot/v3/oauth/models/channel_access_token_key_ids_response.py +++ b/linebot/v3/oauth/models/channel_access_token_key_ids_response.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist class ChannelAccessTokenKeyIdsResponse(BaseModel): """ diff --git a/linebot/v3/oauth/models/error_response.py b/linebot/v3/oauth/models/error_response.py index f149d0e70..6b60f3a44 100644 --- a/linebot/v3/oauth/models/error_response.py +++ b/linebot/v3/oauth/models/error_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ErrorResponse(BaseModel): """ diff --git a/linebot/v3/oauth/models/issue_channel_access_token_response.py b/linebot/v3/oauth/models/issue_channel_access_token_response.py index 90157d2b3..3e66df10e 100644 --- a/linebot/v3/oauth/models/issue_channel_access_token_response.py +++ b/linebot/v3/oauth/models/issue_channel_access_token_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class IssueChannelAccessTokenResponse(BaseModel): """ diff --git a/linebot/v3/oauth/models/issue_short_lived_channel_access_token_response.py b/linebot/v3/oauth/models/issue_short_lived_channel_access_token_response.py index 73b252e1a..acb7848b8 100644 --- a/linebot/v3/oauth/models/issue_short_lived_channel_access_token_response.py +++ b/linebot/v3/oauth/models/issue_short_lived_channel_access_token_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class IssueShortLivedChannelAccessTokenResponse(BaseModel): """ diff --git a/linebot/v3/oauth/models/verify_channel_access_token_response.py b/linebot/v3/oauth/models/verify_channel_access_token_response.py index 47a127dc4..7bca5438b 100644 --- a/linebot/v3/oauth/models/verify_channel_access_token_response.py +++ b/linebot/v3/oauth/models/verify_channel_access_token_response.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class VerifyChannelAccessTokenResponse(BaseModel): """ diff --git a/linebot/v3/shop/api/async_shop.py b/linebot/v3/shop/api/async_shop.py index 9e969f744..a11141c4f 100644 --- a/linebot/v3/shop/api/async_shop.py +++ b/linebot/v3/shop/api/async_shop.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable diff --git a/linebot/v3/shop/api/shop.py b/linebot/v3/shop/api/shop.py index 6f7871d39..140c0650a 100644 --- a/linebot/v3/shop/api/shop.py +++ b/linebot/v3/shop/api/shop.py @@ -15,7 +15,7 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from linebot.v3.shop.models.mission_sticker_request import MissionStickerRequest diff --git a/linebot/v3/shop/api_response.py b/linebot/v3/shop/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/shop/api_response.py +++ b/linebot/v3/shop/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/shop/models/error_response.py b/linebot/v3/shop/models/error_response.py index 6defc220e..edab12b8d 100644 --- a/linebot/v3/shop/models/error_response.py +++ b/linebot/v3/shop/models/error_response.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ErrorResponse(BaseModel): """ diff --git a/linebot/v3/shop/models/mission_sticker_request.py b/linebot/v3/shop/models/mission_sticker_request.py index 96f20fa6b..92f50a834 100644 --- a/linebot/v3/shop/models/mission_sticker_request.py +++ b/linebot/v3/shop/models/mission_sticker_request.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr class MissionStickerRequest(BaseModel): """ diff --git a/linebot/v3/webhooks/api/async_dummy.py b/linebot/v3/webhooks/api/async_dummy.py index 17d79782f..e66dbf57a 100644 --- a/linebot/v3/webhooks/api/async_dummy.py +++ b/linebot/v3/webhooks/api/async_dummy.py @@ -16,7 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable diff --git a/linebot/v3/webhooks/api/dummy.py b/linebot/v3/webhooks/api/dummy.py index f3b283b9c..73287f732 100644 --- a/linebot/v3/webhooks/api/dummy.py +++ b/linebot/v3/webhooks/api/dummy.py @@ -15,7 +15,7 @@ import re # noqa: F401 import io -from pydantic import validate_arguments, ValidationError +from pydantic.v1 import validate_arguments, ValidationError from typing_extensions import Annotated from linebot.v3.webhooks.models.callback_request import CallbackRequest diff --git a/linebot/v3/webhooks/api_response.py b/linebot/v3/webhooks/api_response.py index d81c2ff58..5cc59478a 100644 --- a/linebot/v3/webhooks/api_response.py +++ b/linebot/v3/webhooks/api_response.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from pydantic.v1 import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/linebot/v3/webhooks/models/account_link_event.py b/linebot/v3/webhooks/models/account_link_event.py index a6437b111..81bd65fd4 100644 --- a/linebot/v3/webhooks/models/account_link_event.py +++ b/linebot/v3/webhooks/models/account_link_event.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of link + # override the default output from pydantic.v1 by calling `to_dict()` of link if self.link: _dict['link'] = self.link.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/action_result.py b/linebot/v3/webhooks/models/action_result.py index 5bb36b3fa..3d3fa01f9 100644 --- a/linebot/v3/webhooks/models/action_result.py +++ b/linebot/v3/webhooks/models/action_result.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class ActionResult(BaseModel): """ diff --git a/linebot/v3/webhooks/models/activated_event.py b/linebot/v3/webhooks/models/activated_event.py index e254fedeb..86b6881e3 100644 --- a/linebot/v3/webhooks/models/activated_event.py +++ b/linebot/v3/webhooks/models/activated_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.webhooks.models.chat_control import ChatControl from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of chat_control + # override the default output from pydantic.v1 by calling `to_dict()` of chat_control if self.chat_control: _dict['chatControl'] = self.chat_control.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/all_mentionee.py b/linebot/v3/webhooks/models/all_mentionee.py index a66ec56c1..adb631ede 100644 --- a/linebot/v3/webhooks/models/all_mentionee.py +++ b/linebot/v3/webhooks/models/all_mentionee.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.mentionee import Mentionee class AllMentionee(Mentionee): diff --git a/linebot/v3/webhooks/models/attached_module_content.py b/linebot/v3/webhooks/models/attached_module_content.py index 11707b97e..03dd4a0b7 100644 --- a/linebot/v3/webhooks/models/attached_module_content.py +++ b/linebot/v3/webhooks/models/attached_module_content.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.webhooks.models.module_content import ModuleContent class AttachedModuleContent(ModuleContent): diff --git a/linebot/v3/webhooks/models/audio_message_content.py b/linebot/v3/webhooks/models/audio_message_content.py index 976984313..d0dc728f9 100644 --- a/linebot/v3/webhooks/models/audio_message_content.py +++ b/linebot/v3/webhooks/models/audio_message_content.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.webhooks.models.content_provider import ContentProvider from linebot.v3.webhooks.models.message_content import MessageContent @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of content_provider + # override the default output from pydantic.v1 by calling `to_dict()` of content_provider if self.content_provider: _dict['contentProvider'] = self.content_provider.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/beacon_content.py b/linebot/v3/webhooks/models/beacon_content.py index c78a8afc0..21c9f87fd 100644 --- a/linebot/v3/webhooks/models/beacon_content.py +++ b/linebot/v3/webhooks/models/beacon_content.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class BeaconContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/beacon_event.py b/linebot/v3/webhooks/models/beacon_event.py index ca22e2df9..9b3029785 100644 --- a/linebot/v3/webhooks/models/beacon_event.py +++ b/linebot/v3/webhooks/models/beacon_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.beacon_content import BeaconContent from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of beacon + # override the default output from pydantic.v1 by calling `to_dict()` of beacon if self.beacon: _dict['beacon'] = self.beacon.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/bot_resumed_event.py b/linebot/v3/webhooks/models/bot_resumed_event.py index 21c663b0a..73aba98ad 100644 --- a/linebot/v3/webhooks/models/bot_resumed_event.py +++ b/linebot/v3/webhooks/models/bot_resumed_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/bot_suspended_event.py b/linebot/v3/webhooks/models/bot_suspended_event.py index b8f51f1c2..86409d413 100644 --- a/linebot/v3/webhooks/models/bot_suspended_event.py +++ b/linebot/v3/webhooks/models/bot_suspended_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/callback_request.py b/linebot/v3/webhooks/models/callback_request.py index 5d73a8037..4e82c90bf 100644 --- a/linebot/v3/webhooks/models/callback_request.py +++ b/linebot/v3/webhooks/models/callback_request.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, conlist, constr, validator +from pydantic.v1 import BaseModel, Field, conlist, constr, validator from linebot.v3.webhooks.models.event import Event class CallbackRequest(BaseModel): @@ -66,7 +66,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in events (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in events (list) _items = [] if self.events: for _item in self.events: diff --git a/linebot/v3/webhooks/models/chat_control.py b/linebot/v3/webhooks/models/chat_control.py index b43502a55..ae640f151 100644 --- a/linebot/v3/webhooks/models/chat_control.py +++ b/linebot/v3/webhooks/models/chat_control.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class ChatControl(BaseModel): """ diff --git a/linebot/v3/webhooks/models/content_provider.py b/linebot/v3/webhooks/models/content_provider.py index d48ddc4d4..0b7132b8f 100644 --- a/linebot/v3/webhooks/models/content_provider.py +++ b/linebot/v3/webhooks/models/content_provider.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class ContentProvider(BaseModel): """ diff --git a/linebot/v3/webhooks/models/deactivated_event.py b/linebot/v3/webhooks/models/deactivated_event.py index 5deef425a..d5bda8300 100644 --- a/linebot/v3/webhooks/models/deactivated_event.py +++ b/linebot/v3/webhooks/models/deactivated_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/delivery_context.py b/linebot/v3/webhooks/models/delivery_context.py index 505fbbe40..9981df37c 100644 --- a/linebot/v3/webhooks/models/delivery_context.py +++ b/linebot/v3/webhooks/models/delivery_context.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictBool +from pydantic.v1 import BaseModel, Field, StrictBool class DeliveryContext(BaseModel): """ diff --git a/linebot/v3/webhooks/models/detached_module_content.py b/linebot/v3/webhooks/models/detached_module_content.py index c83a6f026..04d73c6bf 100644 --- a/linebot/v3/webhooks/models/detached_module_content.py +++ b/linebot/v3/webhooks/models/detached_module_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator from linebot.v3.webhooks.models.module_content import ModuleContent class DetachedModuleContent(ModuleContent): diff --git a/linebot/v3/webhooks/models/emoji.py b/linebot/v3/webhooks/models/emoji.py index 86ae91fde..fe5befb90 100644 --- a/linebot/v3/webhooks/models/emoji.py +++ b/linebot/v3/webhooks/models/emoji.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class Emoji(BaseModel): """ diff --git a/linebot/v3/webhooks/models/event.py b/linebot/v3/webhooks/models/event.py index e9c836922..db0195154 100644 --- a/linebot/v3/webhooks/models/event.py +++ b/linebot/v3/webhooks/models/event.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event_mode import EventMode from linebot.v3.webhooks.models.source import Source @@ -96,10 +96,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/file_message_content.py b/linebot/v3/webhooks/models/file_message_content.py index ac2c4e7d8..71bae4581 100644 --- a/linebot/v3/webhooks/models/file_message_content.py +++ b/linebot/v3/webhooks/models/file_message_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.webhooks.models.message_content import MessageContent class FileMessageContent(MessageContent): diff --git a/linebot/v3/webhooks/models/follow_event.py b/linebot/v3/webhooks/models/follow_event.py index 356c9c4a1..8c014fbdc 100644 --- a/linebot/v3/webhooks/models/follow_event.py +++ b/linebot/v3/webhooks/models/follow_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/group_source.py b/linebot/v3/webhooks/models/group_source.py index 4b5f9a541..293640027 100644 --- a/linebot/v3/webhooks/models/group_source.py +++ b/linebot/v3/webhooks/models/group_source.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.source import Source class GroupSource(Source): diff --git a/linebot/v3/webhooks/models/image_message_content.py b/linebot/v3/webhooks/models/image_message_content.py index 9047beb30..48266906c 100644 --- a/linebot/v3/webhooks/models/image_message_content.py +++ b/linebot/v3/webhooks/models/image_message_content.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.content_provider import ContentProvider from linebot.v3.webhooks.models.image_set import ImageSet from linebot.v3.webhooks.models.message_content import MessageContent @@ -59,10 +59,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of content_provider + # override the default output from pydantic.v1 by calling `to_dict()` of content_provider if self.content_provider: _dict['contentProvider'] = self.content_provider.to_dict() - # override the default output from pydantic by calling `to_dict()` of image_set + # override the default output from pydantic.v1 by calling `to_dict()` of image_set if self.image_set: _dict['imageSet'] = self.image_set.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/image_set.py b/linebot/v3/webhooks/models/image_set.py index 775cc8ddf..2af9a9b33 100644 --- a/linebot/v3/webhooks/models/image_set.py +++ b/linebot/v3/webhooks/models/image_set.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class ImageSet(BaseModel): """ diff --git a/linebot/v3/webhooks/models/join_event.py b/linebot/v3/webhooks/models/join_event.py index b7851b17a..eb15a1062 100644 --- a/linebot/v3/webhooks/models/join_event.py +++ b/linebot/v3/webhooks/models/join_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -58,10 +58,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/joined_members.py b/linebot/v3/webhooks/models/joined_members.py index f9cd9037c..01bb48bab 100644 --- a/linebot/v3/webhooks/models/joined_members.py +++ b/linebot/v3/webhooks/models/joined_members.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.webhooks.models.user_source import UserSource class JoinedMembers(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in members (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in members (list) _items = [] if self.members: for _item in self.members: diff --git a/linebot/v3/webhooks/models/leave_event.py b/linebot/v3/webhooks/models/leave_event.py index 4c7c08135..d6d15f513 100644 --- a/linebot/v3/webhooks/models/leave_event.py +++ b/linebot/v3/webhooks/models/leave_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/left_members.py b/linebot/v3/webhooks/models/left_members.py index 7dc1d5312..f481789b4 100644 --- a/linebot/v3/webhooks/models/left_members.py +++ b/linebot/v3/webhooks/models/left_members.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.webhooks.models.user_source import UserSource class LeftMembers(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in members (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in members (list) _items = [] if self.members: for _item in self.members: diff --git a/linebot/v3/webhooks/models/link_content.py b/linebot/v3/webhooks/models/link_content.py index b965b08bc..ae6c55eb9 100644 --- a/linebot/v3/webhooks/models/link_content.py +++ b/linebot/v3/webhooks/models/link_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, validator class LinkContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/link_things_content.py b/linebot/v3/webhooks/models/link_things_content.py index b0848d330..4acf4ac69 100644 --- a/linebot/v3/webhooks/models/link_things_content.py +++ b/linebot/v3/webhooks/models/link_things_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.things_content import ThingsContent class LinkThingsContent(ThingsContent): diff --git a/linebot/v3/webhooks/models/location_message_content.py b/linebot/v3/webhooks/models/location_message_content.py index faa2fa157..e90aa68d0 100644 --- a/linebot/v3/webhooks/models/location_message_content.py +++ b/linebot/v3/webhooks/models/location_message_content.py @@ -19,7 +19,7 @@ from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr from linebot.v3.webhooks.models.message_content import MessageContent class LocationMessageContent(MessageContent): diff --git a/linebot/v3/webhooks/models/member_joined_event.py b/linebot/v3/webhooks/models/member_joined_event.py index 0bebbd334..03c7149c8 100644 --- a/linebot/v3/webhooks/models/member_joined_event.py +++ b/linebot/v3/webhooks/models/member_joined_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of joined + # override the default output from pydantic.v1 by calling `to_dict()` of joined if self.joined: _dict['joined'] = self.joined.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/member_left_event.py b/linebot/v3/webhooks/models/member_left_event.py index 52391b60e..bc9b5446e 100644 --- a/linebot/v3/webhooks/models/member_left_event.py +++ b/linebot/v3/webhooks/models/member_left_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of left + # override the default output from pydantic.v1 by calling `to_dict()` of left if self.left: _dict['left'] = self.left.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/mention.py b/linebot/v3/webhooks/models/mention.py index f0bada819..468ed87ab 100644 --- a/linebot/v3/webhooks/models/mention.py +++ b/linebot/v3/webhooks/models/mention.py @@ -19,7 +19,7 @@ from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic.v1 import BaseModel, Field, conlist from linebot.v3.webhooks.models.mentionee import Mentionee class Mention(BaseModel): @@ -54,7 +54,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in mentionees (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in mentionees (list) _items = [] if self.mentionees: for _item in self.mentionees: diff --git a/linebot/v3/webhooks/models/mentionee.py b/linebot/v3/webhooks/models/mentionee.py index 79ec48f68..88a0ec26a 100644 --- a/linebot/v3/webhooks/models/mentionee.py +++ b/linebot/v3/webhooks/models/mentionee.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr class Mentionee(BaseModel): """ diff --git a/linebot/v3/webhooks/models/message_content.py b/linebot/v3/webhooks/models/message_content.py index eb4cbddd6..56be98138 100644 --- a/linebot/v3/webhooks/models/message_content.py +++ b/linebot/v3/webhooks/models/message_content.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class MessageContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/message_event.py b/linebot/v3/webhooks/models/message_event.py index 5f7b99eca..bc571178a 100644 --- a/linebot/v3/webhooks/models/message_event.py +++ b/linebot/v3/webhooks/models/message_event.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of message + # override the default output from pydantic.v1 by calling `to_dict()` of message if self.message: _dict['message'] = self.message.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/module_content.py b/linebot/v3/webhooks/models/module_content.py index 773b1453f..19fe6a84d 100644 --- a/linebot/v3/webhooks/models/module_content.py +++ b/linebot/v3/webhooks/models/module_content.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ModuleContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/module_event.py b/linebot/v3/webhooks/models/module_event.py index f9bf0efd1..c4d3df828 100644 --- a/linebot/v3/webhooks/models/module_event.py +++ b/linebot/v3/webhooks/models/module_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of module + # override the default output from pydantic.v1 by calling `to_dict()` of module if self.module: _dict['module'] = self.module.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/postback_content.py b/linebot/v3/webhooks/models/postback_content.py index cd9bc3a28..fe1b82306 100644 --- a/linebot/v3/webhooks/models/postback_content.py +++ b/linebot/v3/webhooks/models/postback_content.py @@ -19,7 +19,7 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class PostbackContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/postback_event.py b/linebot/v3/webhooks/models/postback_event.py index 0d365b4c3..e2af0dcca 100644 --- a/linebot/v3/webhooks/models/postback_event.py +++ b/linebot/v3/webhooks/models/postback_event.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of postback + # override the default output from pydantic.v1 by calling `to_dict()` of postback if self.postback: _dict['postback'] = self.postback.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/room_source.py b/linebot/v3/webhooks/models/room_source.py index cff3c9491..99fea273e 100644 --- a/linebot/v3/webhooks/models/room_source.py +++ b/linebot/v3/webhooks/models/room_source.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.source import Source class RoomSource(Source): diff --git a/linebot/v3/webhooks/models/scenario_result.py b/linebot/v3/webhooks/models/scenario_result.py index ff3698668..6e84fc448 100644 --- a/linebot/v3/webhooks/models/scenario_result.py +++ b/linebot/v3/webhooks/models/scenario_result.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist from linebot.v3.webhooks.models.action_result import ActionResult class ScenarioResult(BaseModel): @@ -62,7 +62,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in action_results (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in action_results (list) _items = [] if self.action_results: for _item in self.action_results: diff --git a/linebot/v3/webhooks/models/scenario_result_things_content.py b/linebot/v3/webhooks/models/scenario_result_things_content.py index 128d72dd1..6c8494ae8 100644 --- a/linebot/v3/webhooks/models/scenario_result_things_content.py +++ b/linebot/v3/webhooks/models/scenario_result_things_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.scenario_result import ScenarioResult from linebot.v3.webhooks.models.things_content import ThingsContent @@ -57,7 +57,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of result + # override the default output from pydantic.v1 by calling `to_dict()` of result if self.result: _dict['result'] = self.result.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/source.py b/linebot/v3/webhooks/models/source.py index 5ed12b528..8a308f2e9 100644 --- a/linebot/v3/webhooks/models/source.py +++ b/linebot/v3/webhooks/models/source.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class Source(BaseModel): """ diff --git a/linebot/v3/webhooks/models/sticker_message_content.py b/linebot/v3/webhooks/models/sticker_message_content.py index 5177456d4..bfd16aefa 100644 --- a/linebot/v3/webhooks/models/sticker_message_content.py +++ b/linebot/v3/webhooks/models/sticker_message_content.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, constr, validator +from pydantic.v1 import BaseModel, Field, StrictStr, conlist, constr, validator from linebot.v3.webhooks.models.message_content import MessageContent class StickerMessageContent(MessageContent): diff --git a/linebot/v3/webhooks/models/text_message_content.py b/linebot/v3/webhooks/models/text_message_content.py index 56ae0a43e..afd03199c 100644 --- a/linebot/v3/webhooks/models/text_message_content.py +++ b/linebot/v3/webhooks/models/text_message_content.py @@ -19,7 +19,7 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic.v1 import BaseModel, Field, StrictStr, conlist from linebot.v3.webhooks.models.emoji import Emoji from linebot.v3.webhooks.models.mention import Mention from linebot.v3.webhooks.models.message_content import MessageContent @@ -60,14 +60,14 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each item in emojis (list) + # override the default output from pydantic.v1 by calling `to_dict()` of each item in emojis (list) _items = [] if self.emojis: for _item in self.emojis: if _item: _items.append(_item.to_dict()) _dict['emojis'] = _items - # override the default output from pydantic by calling `to_dict()` of mention + # override the default output from pydantic.v1 by calling `to_dict()` of mention if self.mention: _dict['mention'] = self.mention.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/things_content.py b/linebot/v3/webhooks/models/things_content.py index 684ec7715..7b88f179c 100644 --- a/linebot/v3/webhooks/models/things_content.py +++ b/linebot/v3/webhooks/models/things_content.py @@ -20,7 +20,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class ThingsContent(BaseModel): """ diff --git a/linebot/v3/webhooks/models/things_event.py b/linebot/v3/webhooks/models/things_event.py index b4b054ac9..6788cac7d 100644 --- a/linebot/v3/webhooks/models/things_event.py +++ b/linebot/v3/webhooks/models/things_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of things + # override the default output from pydantic.v1 by calling `to_dict()` of things if self.things: _dict['things'] = self.things.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/unfollow_event.py b/linebot/v3/webhooks/models/unfollow_event.py index 010e29622..86e4bce63 100644 --- a/linebot/v3/webhooks/models/unfollow_event.py +++ b/linebot/v3/webhooks/models/unfollow_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -57,10 +57,10 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/unlink_things_content.py b/linebot/v3/webhooks/models/unlink_things_content.py index 2a4c5e9e4..17ace661c 100644 --- a/linebot/v3/webhooks/models/unlink_things_content.py +++ b/linebot/v3/webhooks/models/unlink_things_content.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.things_content import ThingsContent class UnlinkThingsContent(ThingsContent): diff --git a/linebot/v3/webhooks/models/unsend_detail.py b/linebot/v3/webhooks/models/unsend_detail.py index 4b51c9230..c9683807f 100644 --- a/linebot/v3/webhooks/models/unsend_detail.py +++ b/linebot/v3/webhooks/models/unsend_detail.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class UnsendDetail(BaseModel): """ diff --git a/linebot/v3/webhooks/models/unsend_event.py b/linebot/v3/webhooks/models/unsend_event.py index b6a907794..6f4c0cd6e 100644 --- a/linebot/v3/webhooks/models/unsend_event.py +++ b/linebot/v3/webhooks/models/unsend_event.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -59,13 +59,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of unsend + # override the default output from pydantic.v1 by calling `to_dict()` of unsend if self.unsend: _dict['unsend'] = self.unsend.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/user_mentionee.py b/linebot/v3/webhooks/models/user_mentionee.py index a10b3dc26..152d563a1 100644 --- a/linebot/v3/webhooks/models/user_mentionee.py +++ b/linebot/v3/webhooks/models/user_mentionee.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.mentionee import Mentionee class UserMentionee(Mentionee): diff --git a/linebot/v3/webhooks/models/user_source.py b/linebot/v3/webhooks/models/user_source.py index 016fa2e3b..3afa60735 100644 --- a/linebot/v3/webhooks/models/user_source.py +++ b/linebot/v3/webhooks/models/user_source.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.source import Source class UserSource(Source): diff --git a/linebot/v3/webhooks/models/video_message_content.py b/linebot/v3/webhooks/models/video_message_content.py index 49c0b3378..f7655ab77 100644 --- a/linebot/v3/webhooks/models/video_message_content.py +++ b/linebot/v3/webhooks/models/video_message_content.py @@ -19,7 +19,7 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr from linebot.v3.webhooks.models.content_provider import ContentProvider from linebot.v3.webhooks.models.message_content import MessageContent @@ -58,7 +58,7 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of content_provider + # override the default output from pydantic.v1 by calling `to_dict()` of content_provider if self.content_provider: _dict['contentProvider'] = self.content_provider.to_dict() return _dict diff --git a/linebot/v3/webhooks/models/video_play_complete.py b/linebot/v3/webhooks/models/video_play_complete.py index 9132dcafb..3c62758d8 100644 --- a/linebot/v3/webhooks/models/video_play_complete.py +++ b/linebot/v3/webhooks/models/video_play_complete.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr class VideoPlayComplete(BaseModel): """ diff --git a/linebot/v3/webhooks/models/video_play_complete_event.py b/linebot/v3/webhooks/models/video_play_complete_event.py index c5b3c41e3..cd6837b74 100644 --- a/linebot/v3/webhooks/models/video_play_complete_event.py +++ b/linebot/v3/webhooks/models/video_play_complete_event.py @@ -19,7 +19,7 @@ -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from linebot.v3.webhooks.models.delivery_context import DeliveryContext from linebot.v3.webhooks.models.event import Event from linebot.v3.webhooks.models.event_mode import EventMode @@ -60,13 +60,13 @@ def to_dict(self): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of source + # override the default output from pydantic.v1 by calling `to_dict()` of source if self.source: _dict['source'] = self.source.to_dict() - # override the default output from pydantic by calling `to_dict()` of delivery_context + # override the default output from pydantic.v1 by calling `to_dict()` of delivery_context if self.delivery_context: _dict['deliveryContext'] = self.delivery_context.to_dict() - # override the default output from pydantic by calling `to_dict()` of video_play_complete + # override the default output from pydantic.v1 by calling `to_dict()` of video_play_complete if self.video_play_complete: _dict['videoPlayComplete'] = self.video_play_complete.to_dict() return _dict diff --git a/requirements.txt b/requirements.txt index b9077f397..da39efd44 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ requests ==2.31.0 aiohttp ==3.8.5 future -pydantic >= 1.10.5, < 2 +pydantic >=2.0.3, <3 aenum >= 3.1.11 python_dateutil >= 2.5.3 Deprecated