o
    !d                  	   @   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-locationFzInformation 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requiredZ	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.)tarZtgzzip)r	   r
   enumr   zThe Amazon S3 object eTag.zThe Amazon S3 object version.)bucketkey
bundleTypeeTagversion)r	   Z
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   )Zargument_tabler   kwargsZs3_modelZgithub_modelr   r   Qusr/lib/python3.10/site-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)paramZcli_argumentvalueZ	operationr   )r&   Zemit_first_non_none_responser   r   r   build_revision_location)r'   
parametersr,   parsedr   r   r!   add_to_paramsu   s   
zLocationArgument.add_to_paramsc                 C   s   t d)zE
        Repack the input structure into a revisionLocation.
        r-   )NotImplementedError)r'   
value_dictr   r   r!   r-      s   z(LocationArgument.build_revision_location)__name__
__module____qualname__r%   r0   r-   __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r2   r   r!   <lambda>       z<S3LocationArgument.build_revision_location.<locals>.<lambda>z6--s3-location must specify bucket, key and bundleType.ZS3r   r   r   )revisionType
s3Locationr   rB   r   allmapRuntimeError)r'   r2   r   validr   r   r>   r!   r-      s"   z*S3LocationArgument.build_revision_locationNr3   r4   r5   r-   r   r   r   r!   r          r   c                   @   r7   )r   c                    sB   ddg} fdd}t t||stdd d  d ddS )	Nr   r   c                    r8   r9   r:   r<   r>   r   r!   r?      r@   z@GitHubLocationArgument.build_revision_location.<locals>.<lambda>z7--github-location must specify repository and commitId.ZGitHubr   )rA   ZgitHubLocationrC   )r'   r2   r   rG   r   r>   r!   r-      s   z.GitHubLocationArgument.build_revision_locationNrH   r   r   r   r!   r      rI   r   N)Zawscli.argprocessr   Zawscli.argumentsr   r   r   r   r   r   r"   r#   r   r   r   r   r   r!   <module>   sd   !	