Skip to content

Commit 6ae3591

Browse files
github-actions[bot]github-actions
andauthored
Codes are generated by openapi generator (#687)
The `view.type` and `view.url` in the request body of [PUT https://api.line.me/liff/v1/apps/{liffId}](https://developers.line.biz/en/reference/liff-server/#update-liff-app) are not required. This PR modifies them to be optional. line/line-openapi#69 Co-authored-by: github-actions <github-actions@github.com>
1 parent 188b4e9 commit 6ae3591

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

linebot/v3/liff/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@
4242
from linebot.v3.liff.models.liff_scope import LiffScope
4343
from linebot.v3.liff.models.liff_view import LiffView
4444
from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest
45+
from linebot.v3.liff.models.update_liff_view import UpdateLiffView

linebot/v3/liff/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
from linebot.v3.liff.models.liff_scope import LiffScope
2424
from linebot.v3.liff.models.liff_view import LiffView
2525
from linebot.v3.liff.models.update_liff_app_request import UpdateLiffAppRequest
26+
from linebot.v3.liff.models.update_liff_view import UpdateLiffView

linebot/v3/liff/models/update_liff_app_request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
from linebot.v3.liff.models.liff_bot_prompt import LiffBotPrompt
2424
from linebot.v3.liff.models.liff_features import LiffFeatures
2525
from linebot.v3.liff.models.liff_scope import LiffScope
26-
from linebot.v3.liff.models.liff_view import LiffView
26+
from linebot.v3.liff.models.update_liff_view import UpdateLiffView
2727

2828
class UpdateLiffAppRequest(BaseModel):
2929
"""
3030
UpdateLiffAppRequest
3131
https://developers.line.biz/en/reference/liff-server/#add-liff-app
3232
"""
33-
view: Optional[LiffView] = None
33+
view: Optional[UpdateLiffView] = None
3434
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. ")
3535
features: Optional[LiffFeatures] = None
3636
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:
8181
return UpdateLiffAppRequest.parse_obj(obj)
8282

8383
_obj = UpdateLiffAppRequest.parse_obj({
84-
"view": LiffView.from_dict(obj.get("view")) if obj.get("view") is not None else None,
84+
"view": UpdateLiffView.from_dict(obj.get("view")) if obj.get("view") is not None else None,
8585
"description": obj.get("description"),
8686
"features": LiffFeatures.from_dict(obj.get("features")) if obj.get("features") is not None else None,
8787
"permanent_link_pattern": obj.get("permanentLinkPattern"),
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# coding: utf-8
2+
3+
"""
4+
LIFF server API
5+
6+
LIFF Server API. # noqa: E501
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
"""
13+
14+
15+
from __future__ import annotations
16+
import pprint
17+
import re # noqa: F401
18+
import json
19+
20+
21+
from typing import Optional
22+
from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator
23+
24+
class UpdateLiffView(BaseModel):
25+
"""
26+
UpdateLiffView
27+
https://developers.line.biz/en/reference/liff-server/#update-liff-app
28+
"""
29+
type: Optional[StrictStr] = Field(None, description="Size of the LIFF app view. Specify one of these values: - compact - tall - full ")
30+
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. ")
31+
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. ")
32+
33+
__properties = ["type", "url", "moduleMode"]
34+
35+
@validator('type')
36+
def type_validate_enum(cls, value):
37+
"""Validates the enum"""
38+
if value is None:
39+
return value
40+
41+
if value not in ('compact', 'tall', 'full'):
42+
raise ValueError("must be one of enum values ('compact', 'tall', 'full')")
43+
return value
44+
45+
class Config:
46+
"""Pydantic configuration"""
47+
allow_population_by_field_name = True
48+
validate_assignment = True
49+
50+
def to_str(self) -> str:
51+
"""Returns the string representation of the model using alias"""
52+
return pprint.pformat(self.dict(by_alias=True))
53+
54+
def to_json(self) -> str:
55+
"""Returns the JSON representation of the model using alias"""
56+
return json.dumps(self.to_dict())
57+
58+
@classmethod
59+
def from_json(cls, json_str: str) -> UpdateLiffView:
60+
"""Create an instance of UpdateLiffView from a JSON string"""
61+
return cls.from_dict(json.loads(json_str))
62+
63+
def to_dict(self):
64+
"""Returns the dictionary representation of the model using alias"""
65+
_dict = self.dict(by_alias=True,
66+
exclude={
67+
},
68+
exclude_none=True)
69+
return _dict
70+
71+
@classmethod
72+
def from_dict(cls, obj: dict) -> UpdateLiffView:
73+
"""Create an instance of UpdateLiffView from a dict"""
74+
if obj is None:
75+
return None
76+
77+
if not isinstance(obj, dict):
78+
return UpdateLiffView.parse_obj(obj)
79+
80+
_obj = UpdateLiffView.parse_obj({
81+
"type": obj.get("type"),
82+
"url": obj.get("url"),
83+
"module_mode": obj.get("moduleMode")
84+
})
85+
return _obj
86+

0 commit comments

Comments
 (0)