Skip to content

Commit 4667ad6

Browse files
github-actions[bot]github-actions
andauthored
Codes are generated by openapi generator (#547)
line/line-openapi#36 Co-authored-by: github-actions <github-actions@github.com>
1 parent 144149c commit 4667ad6

File tree

10 files changed

+17
-20
lines changed

10 files changed

+17
-20
lines changed

linebot/v3/webhooks/models/callback_request.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import json
1919

2020

21-
from typing import List, Optional
21+
from typing import List
2222
from pydantic.v1 import BaseModel, Field, conlist, constr, validator
2323
from linebot.v3.webhooks.models.event import Event
2424

@@ -27,17 +27,14 @@ class CallbackRequest(BaseModel):
2727
The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects.
2828
https://developers.line.biz/en/reference/messaging-api/#request-body
2929
"""
30-
destination: Optional[constr(strict=True, max_length=33, min_length=33)] = Field(None, description="User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. ")
31-
events: Optional[conlist(Event)] = Field(None, description="Array of webhook event objects. The LINE Platform may send an empty array that doesn't include a webhook event object to confirm communication. ")
30+
destination: constr(strict=True, max_length=33, min_length=33) = Field(..., description="User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. ")
31+
events: conlist(Event) = Field(..., description="Array of webhook event objects. The LINE Platform may send an empty array that doesn't include a webhook event object to confirm communication. ")
3232

3333
__properties = ["destination", "events"]
3434

3535
@validator('destination')
3636
def destination_validate_regular_expression(cls, value):
3737
"""Validates the regular expression"""
38-
if value is None:
39-
return value
40-
4138
if not re.match(r"^U[0-9a-f]{32}$", value):
4239
raise ValueError(r"must validate the regular expression /^U[0-9a-f]{32}$/")
4340
return value

linebot/v3/webhooks/models/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Event(BaseModel):
2929
"""
3030
Webhook event
3131
"""
32-
type: Optional[StrictStr] = Field(None, description="Type of the event")
32+
type: StrictStr = Field(..., description="Type of the event")
3333
source: Optional[Source] = None
3434
timestamp: StrictInt = Field(..., description="Time of the event in milliseconds.")
3535
mode: EventMode = Field(...)

linebot/v3/webhooks/models/image_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ImageSet(BaseModel):
2525
"""
2626
ImageSet
2727
"""
28-
id: Optional[StrictStr] = Field(None, description="Image set ID. Only included when multiple images are sent simultaneously.")
28+
id: StrictStr = Field(..., description="Image set ID. Only included when multiple images are sent simultaneously.")
2929
index: Optional[StrictInt] = Field(None, description="An index starting from 1, indicating the image number in a set of images sent simultaneously. Only included when multiple images are sent simultaneously. However, it won't be included if the sender is using LINE 11.15 or earlier for Android.")
3030
total: Optional[StrictInt] = Field(None, description="The total number of images sent simultaneously.")
3131

linebot/v3/webhooks/models/mentionee.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
import linebot.v3.webhooks.models
2020

2121

22-
from typing import Optional, Union
22+
from typing import Union
2323
from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr
2424

2525
class Mentionee(BaseModel):
2626
"""
2727
Mentionee
2828
https://developers.line.biz/en/reference/messaging-api/#wh-text
2929
"""
30-
type: Optional[StrictStr] = Field(None, description="Mentioned target.")
30+
type: StrictStr = Field(..., description="Mentioned target.")
3131
index: StrictInt = Field(..., description="Index position of the user mention for a character in text, with the first character being at position 0.")
3232
length: StrictInt = Field(..., description="The length of the text of the mentioned user. For a mention @example, 8 is the length.")
3333

linebot/v3/webhooks/models/message_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
import linebot.v3.webhooks.models
2020

2121

22-
from typing import Optional, Union
22+
from typing import Union
2323
from pydantic.v1 import BaseModel, Field, StrictStr
2424

2525
class MessageContent(BaseModel):
2626
"""
2727
MessageContent
2828
https://developers.line.biz/en/reference/messaging-api/#message-event
2929
"""
30-
type: Optional[StrictStr] = Field(None, description="Type")
30+
type: StrictStr = Field(..., description="Type")
3131
id: StrictStr = Field(..., description="Message ID")
3232

3333
__properties = ["type", "id"]

linebot/v3/webhooks/models/message_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MessageEvent(Event):
3131
Webhook event object which contains the sent message.
3232
"""
3333
reply_token: Optional[StrictStr] = Field(None, alias="replyToken")
34-
message: Optional[MessageContent] = None
34+
message: MessageContent = Field(...)
3535
type: str = "message"
3636

3737
__properties = ["type", "source", "timestamp", "mode", "webhookEventId", "deliveryContext", "replyToken", "message"]

linebot/v3/webhooks/models/module_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import linebot.v3.webhooks.models
2020

2121

22-
from typing import Optional, Union
22+
from typing import Union
2323
from pydantic.v1 import BaseModel, Field, StrictStr
2424

2525
class ModuleContent(BaseModel):
2626
"""
2727
ModuleContent
2828
"""
29-
type: Optional[StrictStr] = Field(None, description="Type")
29+
type: StrictStr = Field(..., description="Type")
3030

3131
__properties = ["type"]
3232

linebot/v3/webhooks/models/postback_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PostbackEvent(Event):
3131
Event object for when a user performs a postback action which initiates a postback. You can reply to postback events.
3232
"""
3333
reply_token: Optional[StrictStr] = Field(None, alias="replyToken", description="Reply token used to send reply message to this event")
34-
postback: Optional[PostbackContent] = None
34+
postback: PostbackContent = Field(...)
3535
type: str = "postback"
3636

3737
__properties = ["type", "source", "timestamp", "mode", "webhookEventId", "deliveryContext", "replyToken", "postback"]

linebot/v3/webhooks/models/things_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import linebot.v3.webhooks.models
2020

2121

22-
from typing import Optional, Union
22+
from typing import Union
2323
from pydantic.v1 import BaseModel, Field, StrictStr
2424

2525
class ThingsContent(BaseModel):
2626
"""
2727
ThingsContent
2828
"""
29-
type: Optional[StrictStr] = Field(None, description="Type")
29+
type: StrictStr = Field(..., description="Type")
3030

3131
__properties = ["type"]
3232

linebot/v3/webhooks/models/unsend_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import json
1919

2020

21-
from typing import Optional
2221

22+
from pydantic.v1 import Field
2323
from linebot.v3.webhooks.models.delivery_context import DeliveryContext
2424
from linebot.v3.webhooks.models.event import Event
2525
from linebot.v3.webhooks.models.event_mode import EventMode
@@ -30,7 +30,7 @@ class UnsendEvent(Event):
3030
"""
3131
Event object for when the user unsends a message.
3232
"""
33-
unsend: Optional[UnsendDetail] = None
33+
unsend: UnsendDetail = Field(...)
3434
type: str = "unsend"
3535

3636
__properties = ["type", "source", "timestamp", "mode", "webhookEventId", "deliveryContext", "unsend"]

0 commit comments

Comments
 (0)