diff --git a/line-openapi b/line-openapi index 1729a0aee..4d9979bb3 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 1729a0aee4ec6257c4f7395860b012d3a3e0b235 +Subproject commit 4d9979bb3afa2798fa7dcc489f0fde023a8b25dd diff --git a/linebot/v3/liff/__init__.py b/linebot/v3/liff/__init__.py index d1a353644..e978896c2 100644 --- a/linebot/v3/liff/__init__.py +++ b/linebot/v3/liff/__init__.py @@ -42,3 +42,4 @@ from linebot.v3.liff.models.liff_scope import LiffScope from linebot.v3.liff.models.liff_view import LiffView from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest +from linebot.v3.liff.models.update_liff_view import UpdateLiffView diff --git a/linebot/v3/liff/models/__init__.py b/linebot/v3/liff/models/__init__.py index 0606081c4..1de294a34 100644 --- a/linebot/v3/liff/models/__init__.py +++ b/linebot/v3/liff/models/__init__.py @@ -23,3 +23,4 @@ from linebot.v3.liff.models.liff_scope import LiffScope from linebot.v3.liff.models.liff_view import LiffView from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest +from linebot.v3.liff.models.update_liff_view import UpdateLiffView diff --git a/linebot/v3/liff/models/update_liff_app_request.py b/linebot/v3/liff/models/update_liff_app_request.py index 6c10d0175..3c802b8b2 100644 --- a/linebot/v3/liff/models/update_liff_app_request.py +++ b/linebot/v3/liff/models/update_liff_app_request.py @@ -23,14 +23,14 @@ 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 -from linebot.v3.liff.models.liff_view import LiffView +from linebot.v3.liff.models.update_liff_view import UpdateLiffView class UpdateLiffAppRequest(BaseModel): """ UpdateLiffAppRequest https://developers.line.biz/en/reference/liff-server/#add-liff-app """ - view: Optional[LiffView] = None + view: Optional[UpdateLiffView] = None description: Optional[StrictStr] = Field(None, description="Name of the LIFF app. The LIFF app name can't include \"LINE\" or similar strings, or inappropriate strings. ") features: Optional[LiffFeatures] = None permanent_link_pattern: Optional[StrictStr] = Field(None, alias="permanentLinkPattern", description="How additional information in LIFF URLs is handled. Specify `concat`. ") @@ -81,7 +81,7 @@ def from_dict(cls, obj: dict) -> UpdateLiffAppRequest: return UpdateLiffAppRequest.parse_obj(obj) _obj = UpdateLiffAppRequest.parse_obj({ - "view": LiffView.from_dict(obj.get("view")) if obj.get("view") is not None else None, + "view": UpdateLiffView.from_dict(obj.get("view")) if obj.get("view") is not None else None, "description": obj.get("description"), "features": LiffFeatures.from_dict(obj.get("features")) if obj.get("features") is not None else None, "permanent_link_pattern": obj.get("permanentLinkPattern"), diff --git a/linebot/v3/liff/models/update_liff_view.py b/linebot/v3/liff/models/update_liff_view.py new file mode 100644 index 000000000..c51c90982 --- /dev/null +++ b/linebot/v3/liff/models/update_liff_view.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + LIFF server API + + LIFF Server API. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator + +class UpdateLiffView(BaseModel): + """ + UpdateLiffView + https://developers.line.biz/en/reference/liff-server/#update-liff-app + """ + type: Optional[StrictStr] = Field(None, description="Size of the LIFF app view. Specify one of these values: - compact - tall - full ") + url: Optional[StrictStr] = Field(None, description="Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL. The URL scheme must be https. URL fragments (#URL-fragment) can't be specified. ") + module_mode: Optional[StrictBool] = Field(None, alias="moduleMode", description="`true` to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed. ") + + __properties = ["type", "url", "moduleMode"] + + @validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('compact', 'tall', 'full'): + raise ValueError("must be one of enum values ('compact', 'tall', 'full')") + return value + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> UpdateLiffView: + """Create an instance of UpdateLiffView from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> UpdateLiffView: + """Create an instance of UpdateLiffView from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UpdateLiffView.parse_obj(obj) + + _obj = UpdateLiffView.parse_obj({ + "type": obj.get("type"), + "url": obj.get("url"), + "module_mode": obj.get("moduleMode") + }) + return _obj +