o
    È·eT  ã                   @   s   G d d„ de ƒZdS )c                   @   s6   e Zd ZdZdZdd„ Zedd„ ƒZejdd„ ƒZdS )	ÚSourceAttributeaL  
    Provide information about attributes for an index field.
    A maximum of 20 source attributes can be configured for
    each index field.

    :ivar default: Optional default value if the source attribute
        is not specified in a document.
        
    :ivar name: The name of the document source field to add
        to this ``IndexField``.

    :ivar data_function: Identifies the transformation to apply
        when copying data from a source attribute.
        
    :ivar data_map: The value is a dict with the following keys:
        * cases - A dict that translates source field values
            to custom values.
        * default - An optional default value to use if the
            source attribute is not specified in a document.
        * name - the name of the document source field to add
            to this ``IndexField``
    :ivar data_trim_title: Trims common title words from a source
        document attribute when populating an ``IndexField``.
        This can be used to create an ``IndexField`` you can
        use for sorting.  The value is a dict with the following
        fields:
        * default - An optional default value.
        * language - an IETF RFC 4646 language code.
        * separator - The separator that follows the text to trim.
        * name - The name of the document source field to add.
    )ÚCopyÚ	TrimTitleÚMapc                 C   s"   i | _ | jd | _i | _i | _d S )Né    )Ú	data_copyÚValidDataFunctionsÚ_data_functionÚdata_mapÚdata_trim_title©Úself© r   úW/var/www/ideatree/venv/lib/python3.10/site-packages/boto/cloudsearch/sourceattribute.pyÚ__init__;   s   
zSourceAttribute.__init__c                 C   s   | j S )N)r   r   r   r   r   Údata_functionA   s   zSourceAttribute.data_functionc                 C   s,   || j vrd | j ¡}td| ƒ‚|| _d S )Nú|z data_function must be one of: %s)r   ÚjoinÚ
ValueErrorr   )r   ÚvalueÚvalidr   r   r   r   E   s   

N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úpropertyr   Úsetterr   r   r   r   r      s     
r   N)Úobjectr   r   r   r   r   Ú<module>   s   