Ë
    €Ï  ã                   óL   — d Z ddlmZ ddlmZ ddlmZ ddlmZ d
d„Zd„ Z	d„ Z
y	)zASet up flags for creating or updating a Github Enterprise config.é    )Úabsolute_import)Údivision)Úunicode_literals)Úflagsc                 ó   — | j                  d| d¬«       | j                  dt        | d¬«       |s| j                  dd¬	«       |r| j                  d
d¬	«       | j                  dd¬	«       | j                  | ¬«      }|j                  d«      }|j                  ddd¬«       |j                  ddd¬«       |j                  dt        d¬«       |j                  d«      }|j                  ddd¬«       |j                  ddd¬«       |j                  ddd¬«       |j                  ddd ¬«       |j                  d!d"¬	«       |j                  d#d$¬	«       |j                  d%d&¬	«       |j                  d'd(¬	«       | S ))aX  Sets up all the argparse flags for creating or updating a GHE config.

  Args:
    parser: An argparse.ArgumentParser-like object.
    update: If true, use the version of the flags for updating a config.
      Otherwise, use the version for creating a config.

  Returns:
    The parser argument with GitHub Enterprise config flags added in.
  z
--host-uriz-The host uri of the GitHub Enterprise Server.©ÚrequiredÚhelpz--app-idzHThe app id of the GitHub app that should be associated with this config.)Útyper	   r
   z--peered-networkz“VPC network that should be used when making calls to the GitHub Enterprise Server.

If not specified, calls will be made over the public internet.
)r
   ÚCONFIGzDThe unique identifier of the GitHub Enterprise Config to be updated.z--webhook-keyzÏThe unique identifier that Cloud Build expects to be set as the value for
the query field `webhook_key` on incoming webhook requests.

If this is not set, Cloud Build will generate one on the user's behalf.
)r	   z5Cloud Storage location of the GitHub App credentials:z--gcs-bucketTz;The Cloud Storage bucket containing the credential payload.z--gcs-objectz;The Cloud Storage object containing the credential payload.z--generationzzThe object generation to read the credential payload from.

If this is not set, Cloud Build will read the latest version.
)r   r
   z7Secret Manager resources of the GitHub App credentials:z--private-key-namez3Secret Manager resource containing the private key.z--webhook-secret-namez3Secret Manager resource containing the webhook key.z--oauth-secret-namez4Secret Manager resource containing the oauth secret.z--oauth-client-id-namez7Secret Manager resource containing the oauth client id.z--private-key-version-namezASecret Manager SecretVersion resource containing the private key.z--webhook-secret-version-namezASecret Manager SecretVersion resource containing the webhook key.z--oauth-secret-version-namezBSecret Manager SecretVersion resource containing the oauth secret.z--oauth-client-id-version-namezESecret Manager SecretVersion resource containing the oauth client id.)Úadd_argumentÚintÚadd_mutually_exclusive_groupÚadd_argument_group)ÚparserÚupdateÚgcs_or_secretmanagerÚgcsÚsecretmanagers        úClib/googlecloudsdk/command_lib/cloudbuild/githubenterprise_flags.pyÚAddGitHubEnterpriseConfigArgsr      s1  € ð 	×ÑØØˆzØ:ð ô <ð 	×ÑØÜØˆzðð ô ñ 
Ø
×ÑØðð ô ñ Ø
×ÑØàNð ô ð
 	×ÑØðð ô ð  ×<Ñ<Øˆzð =ó Ðà×/Ñ/Ø=ó	?€#à×ÑØØØHð ô Jð ×ÑØØØHð ô Jð ×ÑØÜðð ô ð '×9Ñ9Ø?óA€-à×ÑØØØ@ð ô Bð ×ÑØØØ@ð ô Bð ×ÑØØØAð ô Cð ×ÑØØØDð ô Fð ×ÑØ"ØNð ô ð ×ÑØ%ØNð ô ð ×ÑØ#ØOð ô ð ×ÑØ&àMð ô ð
 
€-ó    c                 óŒ   — | j                  «       }|j                  ddd¬«       |j                  ddd¬«       t        | d¬«      S )	zÙSets up all the argparse flags for creating a GitHub Enterprise Config.

  Args:
    parser: An argparse.ArgumentParser-like object.

  Returns:
    The parser argument with GitHub Enterprise Config flags added in.
  z--nameTz)The name of the GitHub Enterprise config.r   z--regiona  The region of the Cloud Build Service to use.
Must be set to a supported region
name (e.g. `us-central1`).
If unset, `builds/region`, which is the default
region to use when working with Cloud Build resources, is used. If builds/region
is unset, region is set to `global`.
F©r   )r   r   r   )r   Úregions     r   Ú#AddGitHubEnterpriseConfigCreateArgsr   €   s]   € ð ×$Ñ$Ó&€&Ø×ÑØØØ6ð ô ð
 	×ÑØØðð ô 	ô 
' v°eÔ	<Ð<r   c                 óF   — t        j                  | «       t        | d¬«      S )zÙSets up all the argparse flags for updating a GitHub Enterprise Config.

  Args:
    parser: An argparse.ArgumentParser-like object.

  Returns:
    The parser argument with GitHub Enterprise Config flags added in.
  Tr   )Úbuild_flagsÚAddRegionFlagr   )r   s    r   Ú#AddGitHubEnterpriseConfigUpdateArgsr    ž   s   € ô ×Ñ˜FÔ#Ü	& v°dÔ	;Ð;r   N)F)Ú__doc__Ú
__future__r   r   r   Ú!googlecloudsdk.command_lib.buildsr   r   r   r   r    © r   r   Ú<module>r%      s(   ðñ Hå &Ý Ý 'å BóeòP=ó<
<r   