o
    ~hi                    @   s:  d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZ d dlmZ d dlmZmZmZ ddlmZmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlm Z  G dd deedZ!G dd de!Z"G dd de"edZ#G dd de"Z$G dd de$Z%G dd de#Z&G dd de#Z'G dd de#Z(G d d! d!e#Z)G d"d# d#e!Z*G d$d% d%e#Z+G d&d' d'e#Z,G d(d) d)e#Z-G d*d+ d+e#Z.G d,d- d-e#Z/G d.d/ d/e#Z0G d0d1 d1e#Z1G d2d3 d3eZ2G d4d5 d5e#Z3G d6d7 d7e#Z4G d8d9 d9e#Z5G d:d; d;e#Z6G d<d= d=e#Z7G d>d? d?e#Z8G d@dA dAe#Z9G dBdC dCe#Z:G dDdE dEe#Z;G dFdG dGe#Z<G dHdI dIe#Z=G dJdK dKe"Z>G dLdM dMe"Z?G dNdO dOe!Z@G dPdQ dQe@ZAG dRdS dSe@ZBG dTdU dUe@ZCG dVdW dWe@ZDG dXdY dYZEdS )Z    N)ABCMeta)	IteratorListOptionalSetTypeUnionSequenceDictAny)show_unknown_key_warning)
JsonObjectJsonValidatorEnumValidator   )ButtonStylesWorkflow	SlackFile)ConfirmObject)DispatchActionConfig)MarkdownTextObject)Option)OptionGroup)PlainTextObject)
TextObjectc                   @   s   e Zd ZdZdhZee Zdd Ze	de
e fddZddd	de
e d
e
e defddZedeed f de
ed ef  fddZedeeed ef  deed ef  fddZeded  deed   fddZdS )BlockElementz~Block Elements are things that exists inside of your Blocks.
    https://api.slack.com/reference/block-kit/block-elements
    typec                 C   s   t dt d S )Nz?subtype is deprecated since slackclient 2.6.0, use type instead)warningswarnDeprecationWarningself r"   ^/var/www/html/zoom/venv/lib/python3.10/site-packages/slack_sdk/models/blocks/block_elements.py_subtype_warning%   s   zBlockElement._subtype_warningreturnc                 C      | j S Nr   r    r"   r"   r#   subtype+      zBlockElement.subtypeN)r   r)   r)   othersc                K   s(   |r|    |r
|n|| _t| | d S r'   )r$   r   r   )r!   r   r)   r+   r"   r"   r#   __init__/   s   zBlockElement.__init__block_elementc                 C   s   |d u rd S t |trGd|v rFt|}|d}|  D ]}||jkr-|di |  S q|tjkr:tdi |S |tjkrFtdi |S n	t |tt	frP|S | j
d| d d S )Nr   z&Unknown element detected and skipped ()r"   )
isinstancedictcopypop_get_sub_block_elementsr   r   r   r   r   loggerwarning)clsr-   dtsubclassr"   r"   r#   parse;   s&   





zBlockElement.parseblock_elementsc                    s    fdd|pg D S )Nc                    s   g | ]}  |qS r"   )r:   ).0er6   r"   r#   
<listcomp>S   s    z*BlockElement.parse_all.<locals>.<listcomp>r"   )r6   r;   r"   r>   r#   	parse_allO   s   zBlockElement.parse_allr6   c                 c   s2    |   D ]}t|dr|V  | E d H  qd S )Nr   )__subclasses__hasattrr3   )r6   r9   r"   r"   r#   r3   U   s   
z$BlockElement._get_sub_block_elements)__name__
__module____qualname____doc__
attributeslogging	getLoggerr4   r$   propertyr   strr)   r0   r,   classmethodr   r   r:   r	   r   r@   r   r   r3   r"   r"   r"   r#   r      s4    

($r   )	metaclassc                	       s   e Zd ZdZedee f fddZdddddee dee d	ee d
e	f fddZ
ede ddefddZ  ZS )InteractiveElement   r%   c                       t  jddhS )Nalt_text	action_idsuperrG   unionr    	__class__r"   r#   rG   f      zInteractiveElement.attributesN)rR   r   r)   rR   r   r)   r+   c                   s(   |r|    t j|p|d || _dS )zAn interactive block element.

        We generally recommend using the concrete subclasses for better supports of available properties.
        r(   N)r$   rT   r,   rR   )r!   rR   r   r)   r+   rV   r"   r#   r,   j   s   
zInteractiveElement.__init__z"action_id attribute cannot exceed  charactersc                 C      | j d u pt| j | jkS r'   )rR   lenaction_id_max_lengthr    r"   r"   r#   _validate_action_id_length      z-InteractiveElement._validate_action_id_length)rC   rD   rE   r\   rJ   r   rK   rG   r   r0   r,   r   boolr]   __classcell__r"   r"   rV   r#   rN   c   s$    rN   c                       s   e Zd ZdZh dZedee fddZddddddddee d	ee	ee
f  d
ee dee dee	eef  dee def fddZede ddefddZ  ZS )InputInteractiveElement   >   r   confirmrR   placeholderfocus_on_loadr%   c                 C   r&   r'   r(   r    r"   r"   r#   r)      r*   zInputInteractiveElement.subtypeN)rR   rd   r   r)   rc   re   rR   rd   r   r)   rc   re   r+   c                   sB   |r|    t j||p|d t|| _t|| _|| _dS )zInteractiveElement that is usable in input blocks

        We generally recommend using the concrete subclasses for better supports of available properties.
        rR   r   N)	r$   rT   r,   r   r:   rd   r   rc   re   )r!   rR   rd   r   r)   rc   re   r+   rV   r"   r#   r,      s   
z InputInteractiveElement.__init__z$placeholder attribute cannot exceed rY   c                 C   s(   | j d u p| j jd u pt| j j| jkS r'   )rd   textr[   placeholder_max_lengthr    r"   r"   r#   _validate_placeholder_length   s
   

z4InputInteractiveElement._validate_placeholder_length)rC   rD   rE   rh   rG   rJ   r   rK   r)   r   r   r0   r   r_   r,   r   ri   r`   r"   r"   rV   r#   ra      s8    	ra   c                       s,  e Zd ZdZdZdZdZedee	 f fddZ
ddddddd	d
ee	eef dee	 dee	 dee	 dee	 deeeef  dee	 def fddZede ddefddZede ddefddZede ddefddZededd Zed e ddefd!d"Z  ZS )#ButtonElementbuttonK       r%   c                       t  jh dS )N>   urlrg   stylevaluerc   accessibility_labelrS   r    rV   r"   r#   rG      rX   zButtonElement.attributesN)rR   rp   rr   rq   rc   rs   rg   rR   rp   rr   rq   rc   rs   r+   c          	         sV   t  j|| jd t| | tj|tjd| _|| _|| _	|| _
t|| _|| _dS )aZ  An interactive element that inserts a button. The button can be a trigger for
        anything from opening a simple link to starting a complex workflow.
        https://api.slack.com/reference/block-kit/block-elements#button

        Args:
            text (required): A text object that defines the button's text.
                Can only be of type: plain_text.
                Maximum length for the text in this field is 75 characters.
            action_id (required): An identifier for this action.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            url: A URL to load in the user's browser when the button is clicked.
                Maximum length for this field is 3000 characters.
                If you're using url, you'll still receive an interaction payload
                and will need to send an acknowledgement response.
            value: The value to send along with the interaction payload.
                Maximum length for this field is 2000 characters.
            style: Decorates buttons with alternative visual color schemes. Use this option with restraint.
                "primary" gives buttons a green outline and text, ideal for affirmation or confirmation actions.
                "primary" should only be used for one button within a set.
                "danger" gives buttons a red outline and text, and should be used when the action is destructive.
                Use "danger" even more sparingly than "primary".
                If you don't include this field, the default button style will be used.
            confirm: A confirm object that defines an optional confirmation dialog after the button is clicked.
            accessibility_label: A label for longer descriptive text about a button element.
                This label will be read out by screen readers instead of the button text object.
                Maximum length for this field is 75 characters.
        rf   default_typeN)rT   r,   r   r   r   r:   r   rg   rp   rr   rq   r   rc   rs   )	r!   rg   rR   rp   rr   rq   rc   rs   r+   rV   r"   r#   r,      s   )

zButtonElement.__init__ztext attribute cannot exceed rY   c                 C   s(   | j d u p| j j d u pt| j j | jkS r'   )rg   r[   text_max_lengthr    r"   r"   r#   _validate_text_length   s   (z#ButtonElement._validate_text_lengthzurl attribute cannot exceed c                 C   rZ   r'   )rp   r[   url_max_lengthr    r"   r"   r#   _validate_url_length   r^   z"ButtonElement._validate_url_lengthzvalue attribute cannot exceed c                 C   rZ   r'   )rr   r[   value_max_lengthr    r"   r"   r#   _validate_value_length   r^   z$ButtonElement._validate_value_lengthc                 C   s   | j d u p	| j tv S r'   )rq   r   r    r"   r"   r#   _validate_style_valid     z#ButtonElement._validate_style_validz,accessibility_label attribute cannot exceed c                 C   rZ   r'   )rs   r[   rv   r    r"   r"   r#   $_validate_accessibility_label_length  r^   z2ButtonElement._validate_accessibility_label_length)rC   rD   rE   r   rv   rx   rz   rJ   r   rK   rG   r   r0   r   r   r   r,   r   r_   rw   ry   r{   r   r   r|   r~   r`   r"   r"   rV   r#   rj      sP    	
4
rj   c                       sL   e Zd Zddddeeeef dedee dee def
 fdd	Z  Z	S )
LinkButtonElementN)rR   rq   rg   rp   rR   rq   r+   c                   s$   t  j|||d|d t| | dS )a  A simple button that simply opens a given URL. You will still receive an
        interaction payload and will need to send an acknowledgement response.
        This is a helper class that makes creating links simpler.
        https://api.slack.com/reference/block-kit/block-elements#button

        Args:
            text (required): A text object that defines the button's text.
                Can only be of type: plain_text.
                Maximum length for the text in this field is 75 characters.
            url (required): A URL to load in the user's browser when the button is clicked.
                Maximum length for this field is 3000 characters.
                If you're using url, you'll still receive an interaction payload
                and will need to send an acknowledgement response.
            action_id (required): An identifier for this action.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            style: Decorates buttons with alternative visual color schemes. Use this option with restraint.
                "primary" gives buttons a green outline and text, ideal for affirmation or confirmation actions.
                "primary" should only be used for one button within a set.
                "danger" gives buttons a red outline and text, and should be used when the action is destructive.
                Use "danger" even more sparingly than "primary".
                If you don't include this field, the default button style will be used.
        N)rg   rp   rR   rr   rq   )rT   r,   r   )r!   rg   rp   rR   rq   r+   rV   r"   r#   r,     s   !zLinkButtonElement.__init__)
rC   rD   rE   r   rK   r0   r   r   r,   r`   r"   r"   rV   r#   r     s    r   c                       s   e Zd ZdZedee f fddZdddddddee dee	e
eef   d	ee	e
eef   d
ee
eef  dee def fddZ  ZS )CheckboxesElement
checkboxesr%   c                    rP   )Noptionsinitial_optionsrS   r    rV   r"   r#   rG   @  rX   zCheckboxesElement.attributesN)rR   r   r   rc   re   rR   r   r   rc   re   r+   c                   sB   t  j| j|t||d t| | t|| _t|| _	dS )a  A checkbox group that allows a user to choose multiple items from a list of possible options.
        https://api.slack.com/reference/block-kit/block-elements#checkboxes

        Args:
            action_id (required): An identifier for the action triggered when the checkbox group is changed.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            options (required): An array of option objects. A maximum of 10 options are allowed.
            initial_options: An array of option objects that exactly matches one or more of the options.
                These options will be selected when the checkbox group initially loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                after clicking one of the checkboxes in this element.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   rR   rc   re   N)
rT   r,   r   r   r:   r   r   r@   r   r   )r!   rR   r   r   rc   re   r+   rV   r"   r#   r,   D  s   
zCheckboxesElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r   r	   r   r0   r   r   r_   r,   r`   r"   r"   rV   r#   r   =  s,    r   c                       s   e Zd ZdZedee f fddZdddddddee dee	ee
ef  d	ee d
ee	e
ef  dee de
f fddZeddefddZ  ZS )DatePickerElement
datepickerr%   c                       t  jdhS )Ninitial_daterS   r    rV   r"   r#   rG   r     zDatePickerElement.attributesN)rR   rd   r   rc   re   rR   rd   r   rc   re   r+   c                   s<   t  j| j|t|tjt||d t| | || _dS )a  
        An element which lets users easily select a date from a calendar style UI.
        Date picker elements can be used inside of SectionBlocks and ActionsBlocks.
        https://api.slack.com/reference/block-kit/block-elements#datepicker

        Args:
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder: A plain_text only text object that defines the placeholder text shown on the datepicker.
                Maximum length for the text in this field is 150 characters.
            initial_date: The initial date that is selected when the element is loaded.
                This should be in the format YYYY-MM-DD.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a date is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   rR   rd   rc   re   N)	rT   r,   r   r   r:   r   r   r   r   )r!   rR   rd   r   rc   re   r+   rV   r"   r#   r,   v  s   

zDatePickerElement.__init__z5initial_date attribute must be in format 'YYYY-MM-DD'c                 C      | j d u ptd| j d uS )Nz.\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))r   rematchr    r"   r"   r#   _validate_initial_date_valid  s   
z.DatePickerElement._validate_initial_date_valid)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r   r_   r,   r   r   r`   r"   r"   rV   r#   r   o  s0    (r   c                       s   e Zd ZdZedee f fddZddddddddee dee	ee
ef  d	ee d
ee	e
ef  dee dee de
f fddZeddefddZ  ZS )TimePickerElement
timepickerr%   c                    rP   )Ninitial_timetimezonerS   r    rV   r"   r#   rG     rX   zTimePickerElement.attributesN)rR   rd   r   rc   re   r   rR   rd   r   rc   re   r   r+   c                   sB   t  j| j|t|tjt||d t| | || _|| _	dS )a:  
        An element which allows selection of a time of day.
        On desktop clients, this time picker will take the form of a dropdown list
        with free-text entry for precise choices.
        On mobile clients, the time picker will use native time picker UIs.
        https://api.slack.com/reference/block-kit/block-elements#timepicker

        Args:
            action_id (required): An identifier for the action triggered when a time is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder: A plain_text only text object that defines the placeholder text shown on the timepicker.
                Maximum length for the text in this field is 150 characters.
            initial_time: The initial time that is selected when the element is loaded.
                This should be in the format HH:mm, where HH is the 24-hour format of an hour (00 to 23)
                and mm is minutes with leading zeros (00 to 59), for example 22:25 for 10:25pm.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a time is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
            timezone: The timezone to consider for this input value.
        r   N)
rT   r,   r   r   r:   r   r   r   r   r   )r!   rR   rd   r   rc   re   r   r+   rV   r"   r#   r,     s   "

zTimePickerElement.__init__z0initial_time attribute must be in format 'HH:mm'c                 C   r   )Nz ([0-1][0-9]|2[0-3]):([0-5][0-9]))r   r   r   r    r"   r"   r#   _validate_initial_time_valid  s   z.TimePickerElement._validate_initial_time_valid)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r   r_   r,   r   r   r`   r"   r"   rV   r#   r     s6    	.r   c                       s   e Zd ZdZedee f fddZddddddee dee	 d	ee
eef  d
ee def
 fddZeddefddZ  ZS )DateTimePickerElementdatetimepickerr%   c                    r   )Ninitial_date_timerS   r    rV   r"   r#   rG     r   z DateTimePickerElement.attributesN)rR   r   rc   re   rR   r   rc   re   r+   c                   s0   t  j| j|t||d t| | || _dS )a  
        An element that allows the selection of a time of day formatted as a UNIX timestamp.
        On desktop clients, this time picker will take the form of a dropdown list and the
        date picker will take the form of a dropdown calendar. Both options will have free-text
        entry for precise choices. On mobile clients, the time picker and date
        picker will use native UIs.
        https://api.slack.com/reference/block-kit/block-elements#datetimepicker

        Args:
            action_id (required): An identifier for the action triggered when a time is selected. You can use this
                when you receive an interaction payload to identify the source of the action. Should be unique among
                all other action_ids in the containing block. Maximum length for this field is 255 characters.
            initial_date_time: The initial date and time that is selected when the element is loaded, represented as
                a UNIX timestamp in seconds. This should be in the format of 10 digits, for example 1628633820
                represents the date and time August 10th, 2021 at 03:17pm PST.
                and mm is minutes with leading zeros (00 to 59), for example 22:25 for 10:25pm.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a time is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   )r!   rR   r   rc   re   r+   rV   r"   r#   r,     s   

zDateTimePickerElement.__init__zBinitial_date_time attribute must be between 0 and 99999999 secondsc                 C   s$   | j d u pd| j   kodkS   S )Nr   l   c(	 )r   r    r"   r"   r#   !_validate_initial_date_time_valid  s   $z7DateTimePickerElement._validate_initial_date_time_valid)rC   rD   rE   r   rJ   r   rK   rG   r   intr   r0   r   r_   r,   r   r   r`   r"   r"   rV   r#   r     s*    (r   c                       s   e Zd ZdZdZdZedee f fddZ	ddddd	e
e d
e
e de
eeeef ef  def fddZede ddefddZede ddefddZ  ZS )ImageElementimagerm   rn   r%   c                    ro   )N>   rQ   	image_url
slack_filerS   r    rV   r"   r#   rG   (  rX   zImageElement.attributesN)rQ   r   r   rQ   r   r   r+   c                   sV   t  j| jd t| | || _|| _|du st|tr!|| _dS tdi || _dS )a  An element to insert an image - this element can be used in section and
        context blocks only. If you want a block with only an image in it,
        you're looking for the image block.
        https://api.slack.com/reference/block-kit/block-elements#image

        Args:
            alt_text (required): A plain-text summary of the image. This should not contain any markup.
            image_url: The URL of the image to be displayed.
            slack_file: A Slack image file object that defines the source of the image.
        r(   Nr"   )	rT   r,   r   r   r   rQ   r/   r   r   )r!   rQ   r   r   r+   rV   r"   r#   r,   ,  s
   
0zImageElement.__init__z"image_url attribute cannot exceed rY   c                 C   rZ   r'   )r   r[   image_url_max_lengthr    r"   r"   r#   _validate_image_url_lengthE  r^   z'ImageElement._validate_image_url_lengthz!alt_text attribute cannot exceed c                 C   s   t | j| jkS r'   )r[   rQ   alt_text_max_lengthr    r"   r"   r#   _validate_alt_text_lengthI  r   z&ImageElement._validate_alt_text_length)rC   rD   rE   r   r   r   rJ   r   rK   rG   r   r   r
   r   r   r0   r,   r   r_   r   r   r`   r"   r"   rV   r#   r   #  s,    r   c                       s,  e Zd ZdZdZdZedee f fddZ	ddddddddde
eeeef  d	e
e d
e
eeeef   de
eeeef   de
eeef  de
eeef  de
e def fddZede ddefddZede ddefddZeddefddZeddefddZ  ZS )StaticSelectElementstatic_selectd   r%   c                    ro   N>   r   option_groupsinitial_optionrS   r    rV   r"   r#   rG   X  rX   zStaticSelectElement.attributesN)rd   rR   r   r   r   rc   re   rd   rR   r   r   r   rc   re   r+   c          	         sH   t  j| j|t|tjt||d t| | || _|| _	|| _
dS )a  This is the simplest form of select menu, with a static list of options passed in when defining the element.
        https://api.slack.com/reference/block-kit/block-elements#static_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            options (either options or option_groups is required): An array of option objects.
                Maximum number of options is 100.
                If option_groups is specified, this field should not be.
            option_groups (either options or option_groups is required): An array of option group objects.
                Maximum number of option groups is 100.
                If options is specified, this field should not be.
            initial_option: A single option that exactly matches one of the options or option_groups.
                This option will be selected when the menu initially loads.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a menu item is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   NrT   r,   r   r   r:   r   r   r   r   r   r   )	r!   rd   rR   r   r   r   rc   re   r+   rV   r"   r#   r,   \     #

zStaticSelectElement.__init__ options attribute cannot exceed 	 elementsc                 C   rZ   r'   r   r[   options_max_lengthr    r"   r"   r#   _validate_options_length  r^   z,StaticSelectElement._validate_options_length&option_groups attribute cannot exceed c                 C   rZ   r'   r   r[   option_groups_max_lengthr    r"   r"   r#   _validate_option_groups_length  r^   z2StaticSelectElement._validate_option_groups_length2options and option_groups cannot both be specifiedc                 C      | j d uo	| jd u S r'   r   r   r    r"   r"   r#   2_validate_options_and_option_groups_both_specified     zFStaticSelectElement._validate_options_and_option_groups_both_specified*options or option_groups must be specifiedc                 C      | j d up	| jd uS r'   r   r    r"   r"   r#   7_validate_neither_options_or_option_groups_is_specified  r}   zKStaticSelectElement._validate_neither_options_or_option_groups_is_specified)rC   rD   rE   r   r   r   rJ   r   rK   rG   r   r   r0   r   r	   r   r   r   r_   r,   r   r   r   r   r   r`   r"   r"   rV   r#   r   S  sL    	
0r   c                       s"  e Zd ZdZdZdZedee f fddZ	dddddddddde
eeeef  d	e
e d
e
ee  de
ee  de
ee  de
eeef  de
e de
e def fddZede ddefddZede ddefddZeddefddZeddefddZ  ZS ) StaticMultiSelectElementmulti_static_selectr   r%   c                    ro   )N>   r   r   r   max_selected_itemsrS   r    rV   r"   r#   rG     rX   z#StaticMultiSelectElement.attributesN)rd   rR   r   r   r   rc   r   re   rd   rR   r   r   r   rc   r   re   r+   c          
         s`   t  j| j|t|tjt||d t| |	 t	|| _
t	|| _t	|| _|| _dS )a  
        This is the simplest form of select menu, with a static list of options passed in when defining the element.
        https://api.slack.com/reference/block-kit/block-elements#static_multi_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            options (either options or option_groups is required): An array of option objects.
                Maximum number of options is 100.
                If option_groups is specified, this field should not be.
            option_groups (either options or option_groups is required): An array of option group objects.
                Maximum number of option groups is 100.
                If options is specified, this field should not be.
            initial_options: An array of option objects that exactly match one or more of the options
                within options or option_groups. These options will be selected when the menu initially loads.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears before the multi-select choices are submitted.
            max_selected_items: Specifies the maximum number of items that can be selected in the menu.
                Minimum number is 1.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   r   r@   r   r   r   r   r   )
r!   rd   rR   r   r   r   rc   r   re   r+   rV   r"   r#   r,     s   '

z!StaticMultiSelectElement.__init__r   r   c                 C   rZ   r'   r   r    r"   r"   r#   r     r^   z1StaticMultiSelectElement._validate_options_lengthr   c                 C   rZ   r'   r   r    r"   r"   r#   r     r^   z7StaticMultiSelectElement._validate_option_groups_lengthr   c                 C   s   | j d u p	| jd u S r'   r   r    r"   r"   r#   r     r}   zKStaticMultiSelectElement._validate_options_and_option_groups_both_specifiedr   c                 C   r   r'   r   r    r"   r"   r#   r     r}   zPStaticMultiSelectElement._validate_neither_options_or_option_groups_is_specified)rC   rD   rE   r   r   r   rJ   r   rK   rG   r   r   r0   r   r	   r   r   r   r   r_   r,   r   r   r   r   r   r`   r"   r"   rV   r#   r     sR    


	
5r   c                       s
  e Zd ZdZdZdZedee f fddZ	ddddddddde
e d	e
e d
e
ee  de
ee  de
e de
eeef  de
e def fddZede ddefddZede ddefddZeddefddZeddefddZ  ZS )SelectElementr   r   r%   c                    ro   r   rS   r    rV   r"   r#   rG     rX   zSelectElement.attributesN)rR   rd   r   r   r   rc   re   rR   rd   r   r   r   rc   re   r+   c          	         sH   t  j| j|t|tjt||d t| | || _|| _	|| _
dS )a  This is the simplest form of select menu, with a static list of options passed in when defining the element.
        https://api.slack.com/reference/block-kit/block-elements#static_select

        Args:
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            options (either options or option_groups is required): An array of option objects.
                Maximum number of options is 100.
                If option_groups is specified, this field should not be.
            option_groups (either options or option_groups is required): An array of option group objects.
                Maximum number of option groups is 100.
                If options is specified, this field should not be.
            initial_option: A single option that exactly matches one of the options or option_groups.
                This option will be selected when the menu initially loads.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a menu item is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   Nr   )	r!   rR   rd   r   r   r   rc   re   r+   rV   r"   r#   r,     r   zSelectElement.__init__r   r   c                 C   rZ   r'   r   r    r"   r"   r#   r   &  r^   z&SelectElement._validate_options_lengthr   c                 C   rZ   r'   r   r    r"   r"   r#   r   *  r^   z,SelectElement._validate_option_groups_lengthr   c                 C   r   r'   r   r    r"   r"   r#   r   .  r   z@SelectElement._validate_options_and_option_groups_both_specifiedr   c                 C   r   r'   r   r    r"   r"   r#   r   2  r}   zESelectElement._validate_neither_options_or_option_groups_is_specified)rC   rD   rE   r   r   r   rJ   r   rK   rG   r   r	   r   r   r   r0   r   r_   r,   r   r   r   r   r   r`   r"   r"   rV   r#   r     sL    

	
0r   c                       s   e Zd ZdZedee f fddZddddddddee dee	ee
f  d	e	ee ee f d
ee dee	eef  dee def fddZ  ZS )ExternalDataSelectElementexternal_selectr%   c                    rP   )Nmin_query_lengthr   rS   r    rV   r"   r#   rG   ?  rX   z$ExternalDataSelectElement.attributesN)rR   rd   r   r   rc   re   rR   rd   r   r   rc   re   r+   c                   sB   t  j| j|t|tjt||d t| | || _|| _	dS )a  
        This select menu will load its options from an external data source, allowing
        for a dynamic list of options.
        https://api.slack.com/reference/block-kit/block-elements#external_select

        Args:
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            initial_option: A single option that exactly matches one of the options
                within the options or option_groups loaded from the external data source.
                This option will be selected when the menu initially loads.
            min_query_length: When the typeahead field is used, a request will be sent on every character change.
                If you prefer fewer requests or more fully ideated queries,
                use the min_query_length attribute to tell Slack
                the fewest number of typed characters required before dispatch.
                The default value is 3.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a menu item is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)
rT   r,   r   r   r:   r   r   r   r   r   )r!   rR   rd   r   r   rc   re   r+   rV   r"   r#   r,   C  s   $

z"ExternalDataSelectElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r   r   r   r   r0   r   r_   r,   r`   r"   r"   rV   r#   r   <  s2    	r   c                       s   e Zd ZdZedee f fddZdddddddddee	ee
ef  dee d	ee d
eee	e
ef   dee	e
ef  dee dee de
f fddZ  ZS )ExternalDataMultiSelectElementmulti_external_selectr%   c                    ro   )N>   r   r   r   rS   r    rV   r"   r#   rG   w  rX   z)ExternalDataMultiSelectElement.attributesN)rd   rR   r   r   rc   r   re   rd   rR   r   r   rc   r   re   r+   c          	         sN   t  j| j|t|tjt||d t| | || _t	
|| _|| _dS )aH  
        This select menu will load its options from an external data source, allowing
        for a dynamic list of options.
        https://api.slack.com/reference/block-kit/block-elements#external_multi_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            min_query_length: When the typeahead field is used, a request will be sent on every character change.
                If you prefer fewer requests or more fully ideated queries,
                use the min_query_length attribute to tell Slack
                the fewest number of typed characters required before dispatch.
                The default value is 3
            initial_options: An array of option objects that exactly match one or more of the options
                within options or option_groups. These options will be selected when the menu initially loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                before the multi-select choices are submitted.
            max_selected_items: Specifies the maximum number of items that can be selected in the menu.
                Minimum number is 1.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   r   r   r@   r   r   )	r!   rd   rR   r   r   rc   r   re   r+   rV   r"   r#   r,   {  s   &

z'ExternalDataMultiSelectElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r   r	   r   r   r_   r,   r`   r"   r"   rV   r#   r   t  s8    	
r   c                       s   e Zd ZdZedee f fddZdddddddee	ee
ef  dee d	ee d
ee	e
ef  dee de
f fddZ  ZS )UserSelectElementusers_selectr%   c                    r   )Ninitial_userrS   r    rV   r"   r#   rG     r   zUserSelectElement.attributesN)rd   rR   r   rc   re   rd   rR   r   rc   re   r+   c                   s<   t  j| j|t|tjt||d t| | || _dS )a  
        This select menu will populate its options with a list of Slack users visible to
        the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#users_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_user: The user ID of any valid user to be pre-selected when the menu loads.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a menu item is selected.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)	rT   r,   r   r   r:   r   r   r   r   )r!   rd   rR   r   rc   re   r+   rV   r"   r#   r,     s   

zUserSelectElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r   r_   r,   r`   r"   r"   rV   r#   r     s,    r   c                       s   e Zd ZdZedee f fddZddddddddee dee	ee
ef  d	eee  d
ee	e
ef  dee dee de
f fddZ  ZS )UserMultiSelectElementmulti_users_selectr%   c                    rP   )Ninitial_usersr   rS   r    rV   r"   r#   rG     rX   z!UserMultiSelectElement.attributesN)rR   rd   r   rc   r   re   rR   rd   r   rc   r   re   r+   c                   sB   t  j| j|t|tjt||d t| | || _|| _	dS )as  
        This select menu will populate its options with a list of Slack users visible to
        the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#users_multi_select

        Args:
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            initial_users: An array of user IDs of any valid users to be pre-selected when the menu loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                before the multi-select choices are submitted.
            max_selected_items: Specifies the maximum number of items that can be selected in the menu.
                Minimum number is 1.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)
rT   r,   r   r   r:   r   r   r   r   r   )r!   rR   rd   r   rc   r   re   r+   rV   r"   r#   r,     s   

zUserMultiSelectElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r	   r   r   r_   r,   r`   r"   r"   rV   r#   r     s2    
	r   c                   @   sh   e Zd Zh dZee Zdddddeee	  dee
 dee
 fddZed	eed f fd
dZdS )ConversationFilter>   includeexclude_bot_users exclude_external_shared_channelsNr   r   r   r   r   r   c                C   s   || _ || _|| _dS )a_  Provides a way to filter the list of options in a conversations select menu
        or conversations multi-select menu.
        https://api.slack.com/reference/block-kit/composition-objects#filter_conversations

        Args:
            include: Indicates which type of conversations should be included in the list.
                When this field is provided, any conversations that do not match will be excluded.
                You should provide an array of strings from the following options:
                "im", "mpim", "private", and "public". The array cannot be empty.
            exclude_bot_users: Indicates whether to exclude bot users from conversation lists. Defaults to false.
            exclude_external_shared_channels: Indicates whether to exclude external shared channels
                from conversation lists. Defaults to false.
        Nr   )r!   r   r   r   r"   r"   r#   r,     s   
zConversationFilter.__init__filterc                 C   sT   |d u rd S t |tr|S t |trt|}tdi |S | jd| d d S )Nz9Unknown conversation filter object detected and skipped (r.   r"   )r/   r   r0   r1   r4   r5   )r6   r   r7   r"   r"   r#   r:   7  s   


zConversationFilter.parse)rC   rD   rE   rG   rH   rI   r4   r   r	   rK   r_   r,   rL   r   r0   r:   r"   r"   r"   r#   r     s    


r   c                       s   e Zd ZdZedee f fddZddddddddddee	ee
ef  dee d	ee d
ee	e
ef  dee dee dee dee de
f fddZ  ZS )ConversationSelectElementconversations_selectr%   c                    ro   )N>   r   initial_conversationresponse_url_enableddefault_to_current_conversationrS   r    rV   r"   r#   rG   H     z$ConversationSelectElement.attributesN)rd   rR   r   rc   r   r   r   re   rd   rR   r   rc   r   r   r   re   r+   c          
         sN   t  j| j|t|tjt||d t| |	 || _|| _	|| _
|| _dS )a(  
        This select menu will populate its options with a list of public and private
        channels, DMs, and MPIMs visible to the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#conversation_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_conversation: The ID of any valid conversation to be pre-selected when the menu loads.
                If default_to_current_conversation is also supplied, initial_conversation will take precedence.
            confirm: A confirm object that defines an optional confirmation dialog
                that appears after a menu item is selected.
            response_url_enabled: This field only works with menus in input blocks in modals.
                When set to true, the view_submission payload from the menu's parent view will contain a response_url.
                This response_url can be used for message responses. The target conversation for the message
                will be determined by the value of this select menu.
            default_to_current_conversation: Pre-populates the select menu with the conversation
                that the user was viewing when they opened the modal, if available. Default is false.
            filter: A filter object that reduces the list of available conversations using the specified criteria.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   r   r   r   r   )
r!   rd   rR   r   rc   r   r   r   re   r+   rV   r"   r#   r,   S  s   '

z"ConversationSelectElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r   r_   r   r,   r`   r"   r"   rV   r#   r   E  s>    	
r   c                       s   e Zd ZdZedee f fddZddddddddddee	ee
ef  dee d	eee  d
ee	e
ef  dee dee dee	e
ef  dee de
f fddZ  ZS )ConversationMultiSelectElementmulti_conversations_selectr%   c                    ro   )N>   r   r   initial_conversationsr   rS   r    rV   r"   r#   rG     r   z)ConversationMultiSelectElement.attributesN)rd   rR   r   rc   r   r   r   re   rd   rR   r   rc   r   r   r   re   r+   c          
         sT   t  j| j|t|tjt||d t| |	 || _|| _	|| _
t|| _dS )am  
        This multi-select menu will populate its options with a list of public and private channels,
        DMs, and MPIMs visible to the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#conversation_multi_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_conversations: An array of one or more IDs of any valid conversations to be pre-selected
                when the menu loads. If default_to_current_conversation is also supplied,
                initial_conversations will be ignored.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                before the multi-select choices are submitted.
            max_selected_items: Specifies the maximum number of items that can be selected in the menu.
                Minimum number is 1.
            default_to_current_conversation: Pre-populates the select menu with the conversation that
                the user was viewing when they opened the modal, if available. Default is false.
            filter: A filter object that reduces the list of available conversations using the specified criteria.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   r   r   r   r   r   )
r!   rd   rR   r   rc   r   r   r   re   r+   rV   r"   r#   r,     s   &
z'ConversationMultiSelectElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r	   r   r   r_   r   r,   r`   r"   r"   rV   r#   r     s>    
	
r   c                       s   e Zd ZdZedee f fddZddddddddee	ee
ef  dee d	ee d
ee	e
ef  dee dee de
f fddZ  ZS )ChannelSelectElementchannels_selectr%   c                    rP   )Ninitial_channelr   rS   r    rV   r"   r#   rG     rX   zChannelSelectElement.attributesN)rd   rR   r   rc   r   re   rd   rR   r   rc   r   re   r+   c                   B   t  j| j|t|tjt||d t| | || _|| _	dS )aT  
        This select menu will populate its options with a list of public channels
        visible to the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#channel_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_channel: The ID of any valid public channel to be pre-selected when the menu loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                after a menu item is selected.
            response_url_enabled: This field only works with menus in input blocks in modals.
                When set to true, the view_submission payload from the menu's parent view will contain a response_url.
                This response_url can be used for message responses.
                The target channel for the message will be determined by the value of this select menu
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)
rT   r,   r   r   r:   r   r   r   r   r   )r!   rd   rR   r   rc   r   re   r+   rV   r"   r#   r,     s   !

zChannelSelectElement.__init__r   r"   r"   rV   r#   r     s2    	r   c                       s   e Zd ZdZedee f fddZddddddddee	ee
ef  dee d	eee  d
ee	e
ef  dee dee de
f fddZ  ZS )ChannelMultiSelectElementmulti_channels_selectr%   c                    rP   )Ninitial_channelsr   rS   r    rV   r"   r#   rG   	  rX   z$ChannelMultiSelectElement.attributesN)rd   rR   r   rc   r   re   rd   rR   r   rc   r   re   r+   c                   r   )a  
        This multi-select menu will populate its options with a list of public channels visible
        to the current user in the active workspace.
        https://api.slack.com/reference/block-kit/block-elements#channel_multi_select

        Args:
            placeholder (required): A plain_text only text object that defines the placeholder text shown on the menu.
                Maximum length for the text in this field is 150 characters.
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_channels: An array of one or more IDs of any valid public channel
                to be pre-selected when the menu loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                before the multi-select choices are submitted.
            max_selected_items: Specifies the maximum number of items that can be selected in the menu.
                Minimum number is 1.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)
rT   r,   r   r   r:   r   r   r   r   r   )r!   rd   rR   r   rc   r   re   r+   rV   r"   r#   r,     s    

z"ChannelMultiSelectElement.__init__r   r"   r"   rV   r#   r     s2    
	r   c                       s   e Zd ZdZedee f fddZdddddddee dee	ee
ef  d	eeeef  d
ee	e
ef  dee de
f fddZ  ZS )RichTextInputElementrich_text_inputr%   c                    rP   Ninitial_valuedispatch_action_configrS   r    rV   r"   r#   rG   B  
   zRichTextInputElement.attributesN)rR   rd   r   r   re   rR   rd   r   r   re   r+   c                   s:   t  j| j|t|tj|d t| | || _|| _d S )Nr   rR   rd   re   	rT   r,   r   r   r:   r   r   r   r   )r!   rR   rd   r   r   re   r+   rV   r"   r#   r,   K  s   


zRichTextInputElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r
   r   r   r_   r,   r`   r"   r"   rV   r#   r   ?  s,    r   c                       s   e Zd ZdZedee f fddZddddddddddee dee	ee
ef  d	ee d
ee dee dee dee	e
ef  dee de
f fddZ  ZS )PlainTextInputElementplain_text_inputr%   c                    ro   )N>   	multiline
max_length
min_lengthr   r   rS   r    rV   r"   r#   rG   i  r   z PlainTextInputElement.attributesN)rR   rd   r   r   r   r   r   re   rR   rd   r   r   r   r   r   re   r+   c          
         sL   t  j| j|t|tj|d t| |	 || _|| _|| _	|| _
|| _dS )aR  
        A plain-text input, similar to the HTML <input> tag, creates a field
        where a user can enter freeform data. It can appear as a single-line
        field or a larger textarea using the multiline flag. Plain-text input
        elements can be used inside of SectionBlocks and ActionsBlocks.
        https://api.slack.com/reference/block-kit/block-elements#input

        Args:
            action_id (required): An identifier for the input value when the parent modal is submitted.
                You can use this when you receive a view_submission payload to identify the value of the input element.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            placeholder: A plain_text only text object that defines the placeholder text shown
                in the plain-text input. Maximum length for the text in this field is 150 characters.
            initial_value: The initial value in the plain-text input when it is loaded.
            multiline: Indicates whether the input will be a single line (false) or a larger textarea (true).
                Defaults to false.
            min_length: The minimum length of input that the user must provide. If the user provides less,
                they will receive an error. Maximum value is 3000.
            max_length: The maximum length of input that the user can provide. If the user provides more,
                they will receive an error.
            dispatch_action_config: A dispatch configuration object that determines when
                during text input the element returns a block_actions payload.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   r   r   r   r   )
r!   rR   rd   r   r   r   r   r   re   r+   rV   r"   r#   r,   u  s   '

zPlainTextInputElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r_   r   r   r,   r`   r"   r"   rV   r#   r   f  s>    	
r   c                          e Zd ZdZedee f fddZdddddddee dee d	ee	e
ef  d
ee dee	ee
ef  de
f fddZ  ZS )EmailInputElementemail_text_inputr%   c                    rP   r   rS   r    rV   r"   r#   rG     r   zEmailInputElement.attributesNrR   r   r   re   rd   rR   r   r   re   rd   r+   c                   :   t  j| j|t|tj|d t| | || _|| _dS )aB  
        https://api.slack.com/reference/block-kit/block-elements#email

        Args:
            action_id (required): An identifier for the input value when the parent modal is submitted.
                You can use this when you receive a view_submission payload to identify the value of the input element.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_value: The initial value in the email input when it is loaded.
            dispatch_action_config:  dispatch configuration object that determines when during
                text input the element returns a block_actions payload.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
            placeholder: A plain_text only text object that defines the placeholder text shown in the
                email input. Maximum length for the text in this field is 150 characters.
        r   Nr   r!   rR   r   r   re   rd   r+   rV   r"   r#   r,     s   

zEmailInputElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r   r_   r   r,   r`   r"   r"   rV   r#   r     ,    r   c                       r   )UrlInputElementurl_text_inputr%   c                    rP   r   rS   r    rV   r"   r#   rG     r   zUrlInputElement.attributesNr   rR   r   r   re   rd   r+   c                   r   )a  
        A URL input element, similar to the Plain-text input element,
        creates a single line field where a user can enter URL-encoded data.
        https://api.slack.com/reference/block-kit/block-elements#url

        Args:
            action_id (required): An identifier for the input value when the parent modal is submitted.
                You can use this when you receive a view_submission payload to identify the value of the input element.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            initial_value: The initial value in the URL input when it is loaded.
            dispatch_action_config: A dispatch configuration object that determines when during text input
                the element returns a block_actions payload.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
            placeholder: A plain_text only text object that defines the placeholder text shown in the URL input.
                Maximum length for the text in this field is 150 characters.
        r   Nr   r   rV   r"   r#   r,     s   

zUrlInputElement.__init__r   r"   r"   rV   r#   r     r   r   c                       s   e Zd ZdZedee f fddZddddddddddee d	ee	 d
ee
eeef  dee
eeef  dee
eeef  dee
eef  dee	 dee
eeef  def fddZ  ZS )NumberInputElementnumber_inputr%   c                    ro   )N>   	max_value	min_valuer   is_decimal_allowedr   rS   r    rV   r"   r#   rG   #  r   zNumberInputElement.attributesNF)rR   r   r   r   r   r   re   rd   rR   r   r   r   r   r   re   rd   r+   c          
         s|   t  j| j|t|tj|d t| |	 |durt|nd| _|| _	|dur+t|nd| _
|dur6t|nd| _|| _dS )au  
        https://api.slack.com/reference/block-kit/block-elements#number

        Args:
            action_id (required): An identifier for the input value when the parent modal is submitted.
                You can use this when you receive a view_submission payload to identify the value of the input element.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            is_decimal_allowed (required): Decimal numbers are allowed if is_decimal_allowed= true, set the value to
                false otherwise.
            initial_value: The initial value in the number input when it is loaded.
            min_value: The minimum value, cannot be greater than max_value.
            max_value: The maximum value, cannot be less than min_value.
            dispatch_action_config: A dispatch configuration object that determines when
                during text input the element returns a block_actions payload.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
            placeholder: A plain_text only text object that defines the placeholder text shown
                in the plain-text input. Maximum length for the text in this field is 150 characters.
        r   N)rT   r,   r   r   r:   r   r   rK   r   r   r   r   r   )
r!   rR   r   r   r   r   r   re   rd   r+   rV   r"   r#   r,   /  s   !

zNumberInputElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r_   r   r   floatr0   r   r   r,   r`   r"   r"   rV   r#   r      s>    	
r   c                	       sf   e Zd ZdZedee f fddZdddddee dee	e  d	ee
 d
ef fddZ  ZS )FileInputElement
file_inputr%   c                    rP   )N	filetypes	max_filesrS   r    rV   r"   r#   rG   g  r   zFileInputElement.attributesN)rR   r  r  rR   r  r  r+   c                   s,   t  j| j|d t| | || _|| _dS )a  
        https://api.slack.com/reference/block-kit/block-elements#file_input

        Args:
            action_id (required): An identifier for the input value when the parent modal is submitted.
                You can use this when you receive a view_submission payload to identify the value of the input element.
                Should be unique among all other action_ids in the containing block. Maximum length is 255 characters.
            filetypes: An array of valid file extensions that will be accepted for this element.
                All file extensions will be accepted if filetypes is not specified.
                This validation is provided for convenience only,
                and you should perform your own file type validation based on what you expect to receive.
            max_files: Maximum number of files that can be uploaded for this file_input element.
                Minimum of 1, maximum of 10. Defaults to 10 if not specified.
        )r   rR   N)rT   r,   r   r   r  r  )r!   rR   r  r  r+   rV   r"   r#   r,   p  s   

zFileInputElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r   r0   r,   r`   r"   r"   rV   r#   r   d  s     
r   c                       s   e Zd ZdZedee f fddZdddddddee dee	e
eef   d	ee
eef  d
ee
eef  dee def fddZ  ZS )RadioButtonsElementradio_buttonsr%   c                    rP   )Nr   r   rS   r    rV   r"   r#   rG     rX   zRadioButtonsElement.attributesN)rR   r   r   rc   re   rR   r   r   rc   re   r+   c                   s6   t  j| j|t||d t| | || _|| _dS )a  A radio button group that allows a user to choose one item from a list of possible options.
        https://api.slack.com/reference/block-kit/block-elements#radio

        Args:
            action_id (required): An identifier for the action triggered when the radio button group is changed.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            options (required): An array of option objects. A maximum of 10 options are allowed.
            initial_option: An option object that exactly matches one of the options.
                This option will be selected when the radio button group initially loads.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                after clicking one of the radio buttons in this element.
            focus_on_load: Indicates whether the element will be set to auto focus within the view object.
                Only one element can be set to true. Defaults to false.
        r   N)rT   r,   r   r   r:   r   r   r   )r!   rR   r   r   rc   re   r+   rV   r"   r#   r,     s   

zRadioButtonsElement.__init__r   r"   r"   rV   r#   r    s,    r  c                
       s   e Zd ZdZdZdZedee f fddZ	dddd	e
e d
ee de
eeef  def fddZede de ddefddZ  ZS )OverflowMenuElementoverflowr      r%   c                    rP   )Nrc   r   rS   r    rV   r"   r#   rG     rX   zOverflowMenuElement.attributesN)rR   rc   rR   r   rc   r+   c                   s2   t  j|| jd t| | || _t|| _dS )uV  
        This is like a cross between a button and a select menu - when a user clicks
        on this overflow button, they will be presented with a list of options to
        choose from. Unlike the select menu, there is no typeahead field, and the
        button always appears with an ellipsis ("…") rather than customisable text.

        As such, it is usually used if you want a more compact layout than a select
        menu, or to supply a list of less visually important actions after a row of
        buttons. You can also specify simple URL links as overflow menu options,
        instead of actions.

        https://api.slack.com/reference/block-kit/block-elements#overflow

        Args:
            action_id (required): An identifier for the action triggered when a menu option is selected.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            options (required): An array of option objects to display in the menu.
                Maximum number of options is 5, minimum is 1.
            confirm: A confirm object that defines an optional confirmation dialog that appears
                after a menu item is selected.
        rf   N)rT   r,   r   r   r   r   r:   rc   )r!   rR   r   rc   r+   rV   r"   r#   r,     s   
zOverflowMenuElement.__init__z$options attribute must have between z and z itemsc                 C   s"   | j t| j  ko| jkS   S r'   )options_min_lengthr[   r   r   r    r"   r"   r#   r     s   "z,OverflowMenuElement._validate_options_length)rC   rD   rE   r   r  r   rJ   r   rK   rG   r   r	   r   r   r0   r   r,   r   r_   r   r`   r"   r"   rV   r#   r    s&    %r  c                       s   e Zd ZdZedee f fddZddddddeee	e
f dee d	eee	ef  d
ee dee de	f fddZ  ZS )WorkflowButtonElementworkflow_buttonr%   c                    ro   )N>   rg   rq   workflowrs   rS   r    rV   r"   r#   rG     rX   z WorkflowButtonElement.attributesN)rR   r  rq   rs   rg   rR   r  rq   rs   r+   c                   sD   t  j|| jd t| | tj|tjd| _|| _|| _	|| _
dS )aA  Allows users to run a link trigger with customizable inputs
        Interactive component - but interactions with workflow button elements will not send block_actions events,
        since these are used to start new workflow runs.
        https://api.slack.com/reference/block-kit/block-elements#workflow_button

        Args:
            text (required): A text object that defines the button's text.
                Can only be of type: plain_text. text may truncate with ~30 characters.
                Maximum length for the text in this field is 75 characters.
            action_id (required): An identifier for this action.
                You can use this when you receive an interaction payload to identify the source of the action.
                Should be unique among all other action_ids in the containing block.
                Maximum length for this field is 255 characters.
            workflow: A workflow object that contains details about the workflow
                that will run when the button is clicked.
            style: Decorates buttons with alternative visual color schemes. Use this option with restraint.
                "primary" gives buttons a green outline and text, ideal for affirmation or confirmation actions.
                "primary" should only be used for one button within a set.
                "danger" gives buttons a red outline and text, and should be used when the action is destructive.
                Use "danger" even more sparingly than "primary".
                If you don't include this field, the default button style will be used.
            accessibility_label: A label for longer descriptive text about a button element.
                This label will be read out by screen readers instead of the button text object.
                Maximum length for this field is 75 characters.
        rf   rt   N)rT   r,   r   r   r   r:   r   rg   r  rq   rs   )r!   rg   rR   r  rq   rs   r+   rV   r"   r#   r,     s   #

zWorkflowButtonElement.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r0   r   r   r   r,   r`   r"   r"   rV   r#   r	    s*    r	  c                   @   s   e Zd ZdS )RichTextElementN)rC   rD   rE   r"   r"   r"   r#   r  8  s    r  c                       s|   e Zd ZdZedee f fddZddddddee	e
ef  dee d	ee d
ee dee de
f fddZ  ZS )RichTextListElementrich_text_listr%   c                    ro   )N>   rq   borderindentoffsetelementsrS   r    rV   r"   r#   rG   ?  rX   zRichTextListElement.attributesN)rq   r  r  r  r  rq   r  r  r  r+   c                   sB   t  j| jd t| | t|| _|| _|| _|| _	|| _
d S Nr(   )rT   r,   r   r   r   r@   r  rq   r  r  r  )r!   r  rq   r  r  r  r+   rV   r"   r#   r,   C  s   


zRichTextListElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r	   r   r0   r  r   r   r,   r`   r"   r"   rV   r#   r  <  s*    r  c                       s^   e Zd ZdZedee f fddZdddee	e
ef  dee d	e
f fd
dZ  ZS )RichTextPreformattedElementrich_text_preformattedr%   c                    rP   )Nr  r  rS   r    rV   r"   r#   rG   Y  rX   z&RichTextPreformattedElement.attributesN)r  r  r  r+   c                   s0   t  j| jd t| | t|| _|| _d S r  )rT   r,   r   r   r   r@   r  r  )r!   r  r  r+   rV   r"   r#   r,   ]  s   

z$RichTextPreformattedElement.__init__r  r"   r"   rV   r#   r  V  s    r  c                       P   e Zd ZdZedee f fddZdee	e
ef  de
f fddZ  ZS )	RichTextQuoteElementrich_text_quoter%   c                    r   Nr  rS   r    rV   r"   r#   rG   m  r   zRichTextQuoteElement.attributesr  r+   c                   *   t  j| jd t| | t|| _d S r  rT   r,   r   r   r   r@   r  r!   r  r+   rV   r"   r#   r,   q     
zRichTextQuoteElement.__init__rC   rD   rE   r   rJ   r   rK   rG   r	   r   r0   r  r,   r`   r"   r"   rV   r#   r  j      r  c                       r  )	RichTextSectionElementrich_text_sectionr%   c                    r   r  rS   r    rV   r"   r#   rG     r   z!RichTextSectionElement.attributesr  r+   c                   r  r  r  r  rV   r"   r#   r,     r  zRichTextSectionElement.__init__r  r"   r"   rV   r#   r!  |  r   r!  c                   @   s   e Zd ZG dd dZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZdS )RichTextElementPartsc                
   @   sP   e Zd Zddddddee dee dee dee fddZd	efd
dZdS )RichTextElementParts.TextStyleNbolditalicstrikecoder&  r'  r(  r)  c                C   s   || _ || _|| _|| _d S r'   r%  )r!   r&  r'  r(  r)  r"   r"   r#   r,     s   
z'RichTextElementParts.TextStyle.__init__r%   c                 G   s(   | j | j| j| jd}dd | D S )Nr%  c                 S   s   i | ]\}}|d ur||qS r'   r"   )r<   kvr"   r"   r#   
<dictcomp>  s    z:RichTextElementParts.TextStyle.to_dict.<locals>.<dictcomp>)r&  r'  r(  r)  items)r!   argsresultr"   r"   r#   to_dict  s   z&RichTextElementParts.TextStyle.to_dict)rC   rD   rE   r   r_   r,   r0   r0  r"   r"   r"   r#   	TextStyle  s    
r1  c                       sZ   e Zd ZdZedee f fddZdddedee	e
df  d	e
f fd
dZ  ZS )zRichTextElementParts.Textrg   r%   c                    rP   )Nrg   rq   rS   r    rV   r"   r#   rG     rX   z$RichTextElementParts.Text.attributesNrq   rq   r$  r+   c                   *   t  j| jd t| | || _|| _d S r  )rT   r,   r   r   rg   rq   )r!   rg   rq   r+   rV   r"   r#   r,        

z"RichTextElementParts.Text.__init__rC   rD   rE   r   rJ   r   rK   rG   r   r   r0   r,   r`   r"   r"   rV   r#   Text      r6  c                       Z   e Zd ZdZedee f fddZdddedee	e
d	f  d
e
f fddZ  ZS )zRichTextElementParts.Channelchannelr%   c                    rP   )N
channel_idrq   rS   r    rV   r"   r#   rG     rX   z'RichTextElementParts.Channel.attributesNr2  r:  rq   r$  r+   c                   r3  r  )rT   r,   r   r   r:  rq   )r!   r:  rq   r+   rV   r"   r#   r,     r4  z%RichTextElementParts.Channel.__init__r5  r"   r"   rV   r#   Channel  r7  r;  c                       r8  )zRichTextElementParts.Useruserr%   c                    rP   )Nuser_idrq   rS   r    rV   r"   r#   rG     rX   z$RichTextElementParts.User.attributesNr2  r=  rq   r$  r+   c                   r3  r  )rT   r,   r   r   r=  rq   )r!   r=  rq   r+   rV   r"   r#   r,     r4  z"RichTextElementParts.User.__init__r5  r"   r"   rV   r#   User  r7  r>  c                       sn   e Zd ZdZedee f fddZdddddedee	 d	ee d
ee
edf  def
 fddZ  ZS )zRichTextElementParts.Emojiemojir%   c                    ro   )N>   namerq   unicode	skin_tonerS   r    rV   r"   r#   rG     rX   z%RichTextElementParts.Emoji.attributesN)rB  rA  rq   r@  rB  rA  rq   r$  r+   c                   s6   t  j| jd t| | || _|| _|| _|| _d S r  )rT   r,   r   r   r@  rB  rA  rq   )r!   r@  rB  rA  rq   r+   rV   r"   r#   r,     s   	

z#RichTextElementParts.Emoji.__init__)rC   rD   rE   r   rJ   r   rK   rG   r   r   r   r0   r,   r`   r"   r"   rV   r#   Emoji  s$    rC  c                
       sd   e Zd ZdZedee f fddZddddedee d	ee	e
d
f  de
f fddZ  ZS )zRichTextElementParts.Linklinkr%   c                    ro   )N>   rp   rg   rq   rS   r    rV   r"   r#   rG     rX   z$RichTextElementParts.Link.attributesN)rg   rq   rp   rg   rq   r$  r+   c                   s0   t  j| jd t| | || _|| _|| _d S r  )rT   r,   r   r   rp   rg   rq   )r!   rp   rg   rq   r+   rV   r"   r#   r,     s
   

z"RichTextElementParts.Link.__init__r5  r"   r"   rV   r#   Link  s    rE  c                       r8  )zRichTextElementParts.Teamteamr%   c                    rP   )Nteam_idrq   rS   r    rV   r"   r#   rG     rX   z$RichTextElementParts.Team.attributesNr2  rG  rq   r$  r+   c                   r3  r  )rT   r,   r   r   rG  rq   )r!   rG  rq   r+   rV   r"   r#   r,     r4  z"RichTextElementParts.Team.__init__r5  r"   r"   rV   r#   Team  r7  rH  c                       r8  )zRichTextElementParts.UserGroup	usergroupr%   c                    rP   )Nusergroup_idrq   rS   r    rV   r"   r#   rG   !  rX   z)RichTextElementParts.UserGroup.attributesNr2  rJ  rq   r$  r+   c                   r3  r  )rT   r,   r   r   rJ  rq   )r!   rJ  rq   r+   rV   r"   r#   r,   %  r4  z'RichTextElementParts.UserGroup.__init__r5  r"   r"   rV   r#   	UserGroup  r7  rK  c                       D   e Zd ZdZedee f fddZdedef fddZ	  Z
S )	zRichTextElementParts.Datedater%   c                    r   )N	timestamprS   r    rV   r"   r#   rG   4  r   z$RichTextElementParts.Date.attributesrN  r+   c                   $   t  j| jd t| | || _d S r  )rT   r,   r   r   rN  )r!   rN  r+   rV   r"   r#   r,   8     

z"RichTextElementParts.Date.__init__rC   rD   rE   r   rJ   r   rK   rG   r0   r,   r`   r"   r"   rV   r#   Date1      rR  c                       rL  )	zRichTextElementParts.Broadcast	broadcastr%   c                    r   )NrangerS   r    rV   r"   r#   rG   E  r   z)RichTextElementParts.Broadcast.attributesrU  r+   c                   rO  r  )rT   r,   r   r   rU  )r!   rU  r+   rV   r"   r#   r,   I  rP  z'RichTextElementParts.Broadcast.__init__rQ  r"   r"   rV   r#   	BroadcastB  rS  rV  c                       rL  )	zRichTextElementParts.Colorcolorr%   c                    r   )Nrr   rS   r    rV   r"   r#   rG   V  r   z%RichTextElementParts.Color.attributesrr   r+   c                   rO  r  )rT   r,   r   r   rr   )r!   rr   r+   rV   r"   r#   r,   Z  rP  z#RichTextElementParts.Color.__init__rQ  r"   r"   rV   r#   ColorS  rS  rX  N)rC   rD   rE   r1  r  r6  r;  r>  rC  rE  rH  rK  rR  rV  rX  r"   r"   r"   r#   r#    s    r#  )Fr1   rH   r   r   abcr   typingr   r   r   r   r   r   r	   r
   r   slack_sdk.modelsr   slack_sdk.models.basic_objectsr   r   r   basic_componentsr   r   r   r   r   r   r   r   r   r   r   rN   ra   rj   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r	  r  r  r  r  r!  r#  r"   r"   r"   r#   <module>   sj    ,F#2S22<?90JPO8@/8*DH59'J79D1289