o
    ?Hh                     @  s   d Z ddlmZ ddlZddlZddlZddlZddlm	Z	m
Z
 ddlmZmZmZ ddlmZ ddlmZ G dd	 d	eZdS )
z
    LINE Messaging API

    This document describes LINE Messaging API.  # noqa: E501

    The version of the OpenAPI document: 0.0.1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
    )annotationsN)OptionalUnion)	BaseModelField	StrictStr)
QuickReply)Senderc                
   @  s   e Zd ZU dZedddZded< eddd	Zd
ed< dZded< g dZ	G dd dZ
dZdddddddddd	Zed-dd Zd.d!d"Zd.d#d$Zed/d'd(Zd)d* Zed0d+d,ZdS )1Messagezg
    Message
    https://developers.line.biz/en/reference/messaging-api/#message-common-properties
    .zType of message)descriptionr   typeN
quickReply)aliaszOptional[QuickReply]quick_replyzOptional[Sender]sender)r   r   r   c                   @  s   e Zd ZdZdZdZdS )zMessage.ConfigzPydantic configurationTN)__name__
__module____qualname____doc__allow_population_by_field_namevalidate_assignment r   r   c/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/linebot/v3/messaging/models/message.pyConfig&   s    r   AudioMessageFlexMessageImageMessageImagemapMessageLocationMessageStickerMessageTemplateMessageTextMessageVideoMessage)	audiofleximageimagemaplocationstickertemplatetextvideoobjdictreturnstrc                 C  s   || j  }|r| j|S dS )z9Returns the discriminator value (object type) of the dataN)%_Message__discriminator_property_name'_Message__discriminator_value_class_mapget)clsr,   discriminator_valuer   r   r   get_discriminator_value;   s   
zMessage.get_discriminator_valuec                 C  s   t | jddS )z:Returns the string representation of the model using aliasT)by_alias)pprintpformatr-   selfr   r   r   to_strD   s   zMessage.to_strc                 C  s   t |  S )z8Returns the JSON representation of the model using alias)jsondumpsto_dictr9   r   r   r   to_jsonH   s   zMessage.to_jsonjson_strUnion(AudioMessage, FlexMessage, ImageMessage, ImagemapMessage, LocationMessage, StickerMessage, TemplateMessage, TextMessage, VideoMessage)c                 C  s   |  t|S )z0Create an instance of Message from a JSON string)	from_dictr<   loads)r3   r@   r   r   r   	from_jsonL   s   zMessage.from_jsonc                 C  s<   | j di dd}| jr| j |d< | jr| j |d< |S )z>Returns the dictionary representation of the model using aliasT)r6   excludeexclude_noner   r   )r-   r   r>   r   )r:   _dictr   r   r   r>   Q   s   zMessage.to_dictc                 C  sT   |  |}|rttjjj|}||S tdt	| d | j
 d t	| j )z)Create an instance of Message from a dictz2Message failed to lookup discriminator value from z. Discriminator property name: z, mapping: )r5   getattrlinebotv3	messagingmodelsrB   
ValueErrorr<   r=   r0   r1   )r3   r,   object_typeklassr   r   r   rB   _   s   


zMessage.from_dict)r,   r-   r.   r/   )r.   r/   )r@   r/   r.   rA   )r,   r-   r.   rA   )r   r   r   r   r   r   __annotations__r   r   _Message__propertiesr   r0   r1   classmethodr5   r;   r?   rD   r>   rB   r   r   r   r   r
      s6   
 

r
   )r   
__future__r   r7   rer<   linebot.v3.messaging.modelsrI   typingr   r   pydantic.v1r   r   r   'linebot.v3.messaging.models.quick_replyr   "linebot.v3.messaging.models.senderr	   r
   r   r   r   r   <module>   s   