o
    .&ßa  ã                	   @   sÜ   d dl mZ d dlmZ d dlmZ ddddœZdd	d
ddœd	dddœd	dg d¢ddœd	dddœd	dddœdœdœZddddœZdd	dddœd	dddœdœdœZdd„ Z	G dd„ deƒZ
G dd„ de
ƒZG d d!„ d!e
ƒZd"S )#é    )Úunpack_cli_arg)ÚCustomArgument)Ú!create_argument_model_from_schemazs3-locationFz´Information about the location of the application revision in Amazon S3. You must specify the bucket, the key, and bundleType. Optionally, you can also specify an eTag and version.)ÚnameÚrequiredÚ	help_textÚobjectÚstringzThe Amazon S3 bucket name.T)ÚtypeÚdescriptionr   zThe Amazon S3 object key name.z-The format of the bundle stored in Amazon S3.)ÚtarÚtgzÚzip)r
   r   Úenumr   zThe Amazon S3 object eTag.zThe Amazon S3 object version.)ÚbucketÚkeyÚ
bundleTypeÚeTagÚversion)r
   Ú
propertieszgithub-locationa4  Information about the location of the application revision in GitHub. You must specify the repository and commit ID that references the application revision. For the repository, use the format GitHub-account/repository-name or GitHub-org/repository-name. For the commit ID, use the SHA1 Git commit reference.zqThe GitHub account or organization and repository. Specify as GitHub-account/repository or GitHub-org/repository.zThe SHA1 Git commit reference.©Ú
repositoryÚcommitIdc                 K   sV   t tƒ}td||dœt¤Ž| td < t tƒ}td||dœt¤Ž| td < d| d _d S )N)Úargument_modelÚsessionr   FÚrevision© )r   ÚS3_LOCATION_SCHEMAÚS3LocationArgumentÚS3_LOCATION_ARG_DESCRIPTIONÚGITHUB_LOCATION_SCHEMAÚGitHubLocationArgumentÚGITHUB_LOCATION_ARG_DESCRIPTIONr   )Úargument_tabler   ÚkwargsÚs3_modelÚgithub_modelr   r   úO/usr/lib/python3/dist-packages/awscli/customizations/codedeploy/locationargs.pyÚmodify_revision_arguments\   s"   þý
ÿþý
ÿr(   c                       s,   e Zd Z‡ fdd„Zdd„ Zdd„ Z‡  ZS )ÚLocationArgumentc                    s    t t| ƒj|i |¤Ž || _d S )N)Úsuperr)   Ú__init__Ú_session)Úselfr   Úargsr$   ©Ú	__class__r   r'   r+   q   s   
zLocationArgument.__init__c                 C   sN   |d u rd S | j jd| j | j| |d d�}|d u rt| |ƒ}|  |¡|d< d S )Nzprocess-cli-arg.codedeploy.%s)ÚparamÚcli_argumentÚvalueÚ	operationr   )r,   Úemit_first_non_none_responser   r   r   Úbuild_revision_location)r-   Ú
parametersr3   Úparsedr   r   r'   Úadd_to_paramsu   s   û
zLocationArgument.add_to_paramsc                 C   s   t dƒ‚)zE
        Repack the input structure into a revisionLocation.
        r6   )ÚNotImplementedError)r-   Ú
value_dictr   r   r'   r6   ƒ   s   z(LocationArgument.build_revision_location)Ú__name__Ú
__module__Ú__qualname__r+   r9   r6   Ú__classcell__r   r   r/   r'   r)   p   s    r)   c                   @   ó   e Zd Zdd„ ZdS )r   c                    s|   g d¢}‡ fdd„}t t||ƒƒstdƒ‚dˆ d ˆ d ˆ d dœd	œ}d
ˆ v r0ˆ d
 |d d
< dˆ v r<ˆ d |d d< |S )N)r   r   r   c                    ó   ˆ   | d¡S ©NF©Úget©Úk©r;   r   r'   Ú<lambda>�   ó    z<S3LocationArgument.build_revision_location.<locals>.<lambda>z6--s3-location must specify bucket, key and bundleType.ÚS3r   r   r   )ÚrevisionTypeÚ
s3Locationr   rL   r   ©ÚallÚmapÚRuntimeError)r-   r;   r   Úvalidr   r   rG   r'   r6   ‹   s"   ÿýþz*S3LocationArgument.build_revision_locationN©r<   r=   r>   r6   r   r   r   r'   r   Š   ó    r   c                   @   r@   )r!   c                    sB   ddg}‡ fdd„}t t||ƒƒstdƒ‚dˆ d ˆ d dœdœS )	Nr   r   c                    rA   rB   rC   rE   rG   r   r'   rH   ¤   rI   z@GitHubLocationArgument.build_revision_location.<locals>.<lambda>z7--github-location must specify repository and commitId.ÚGitHubr   )rK   ÚgitHubLocationrM   )r-   r;   r   rQ   r   rG   r'   r6   ¢   s   ÿþþz.GitHubLocationArgument.build_revision_locationNrR   r   r   r   r'   r!   ¡   rS   r!   N)Úawscli.argprocessr   Úawscli.argumentsr   r   r   r   r"   r    r(   r)   r   r!   r   r   r   r'   Ú<module>   sd   üýýüýýêþ!üú	ý÷þ