|
| 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