
    .                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r
  SSKJr  SS	KJr  SS
KJr  S rS rS rS rS rS rS rS rS rS rS rS rS rS rg)z3Flags and helpers for the Assured related commands.    )absolute_import)division)unicode_literals)message_util)arg_parsers)base)resource_args)	arg_utils)concept_parsersc                 H    U R                  SSSS9  U R                  SSSS9  g )N
--locationTzThe location of the Assured Workloads environments. For a current list of supported LOCATION values, see [Assured Workloads locations](https://cloud.google.com/assured-workloads/docs/locations).requiredhelp--organizationz^The parent organization of the Assured Workloads environments, provided as an organization ID.add_argumentparsers    /lib/googlecloudsdk/command_lib/assured/flags.pyAddListWorkloadsFlagsr      A    I	  	 	,	      c                 H    U R                  SSSS9  U R                  SSSS9  g )Nr   TzThe location of the Assured Workloads operations. For a current list of supported LOCATION values, see [Assured Workloads locations](https://cloud.google.com/assured-workloads/docs/locations).r   r   z\The parent organization of the Assured Workloads operations, provided as an organization ID.r   r   s    r   AddListOperationsFlagsr   2   r   r   c                 $   U R                  SSSS9  U R                  SSSS9  U R                  SSS	9  U R                  S
SSS9  [        R                  " S[        R                  " U5      S SSS9R
                  R                  U 5        [        R                  " S[        R                  " U5      S SS9R
                  R                  U 5        U R                  S[        R                  " S[        0S9SSS9  U R                  SSSS9  U R                  SSSS9  U R                  SS S	9  U R                  S!S"S	9  U R                  S#[        R                  " 5       SS$S9  U R                  S%S&S	9  U R                  S'[        SS(S)9  [        X5        g*)+zAdds required flags to the assured workloads create command.

Args:
  parser: Parser, Parser used to construct the command flags.
  release_track: ReleaseTrack, Release track of the command being called.

Returns:
  None.
r   TzThe location of the new Assured Workloads environment. For a current list of supported LOCATION values, see [Assured Workloads locations](https://cloud.google.com/assured-workloads/docs/locations).r   r   z`The parent organization of the new Assured Workloads environment, provided as an organization IDz--external-identifierz@The external identifier of the new Assured Workloads environmentr   --display-namez9The display name of the new Assured Workloads environmentz--compliance-regimec                     U S:g  $ )NCOMPLIANCE_REGIME_UNSPECIFIED regimes    r   <lambda>(AddCreateWorkloadFlags.<locals>.<lambda>o   s
    F.M$Mr   z>The compliance regime of the new Assured Workloads environment)include_filterr   help_strz	--partnerc                     U S:g  $ )NPARTNER_UNSPECIFIEDr!   r"   s    r   r$   r%   v   s
    F.C$Cr   zNThe partner choice when creating a workload managed by local trusted partners.)r&   r'   z--partner-permissionszdata-logs-viewerspec	KEY=VALUEzXThe partner permissions for the partner regime, for example, data-logs-viewer=true/falsetypemetavarr   z"--partner-services-billing-accountFa6  Billing account necessary for purchasing services from Sovereign Partners. This field is required for creating SIA/PSN/CNTXT partner workloads. The caller should have 'billing.resourceAssociations.create' IAM permission on this billing-account. The format of this string is billingAccounts/AAAAAA-BBBBBB-CCCCCCz--billing-accountzoThe billing account of the new Assured Workloads environment, for example, billingAccounts/0000AA-AAA00A-A0A0A0z--next-rotation-timezuThe next rotation time of the KMS settings of new Assured Workloads environment, for example, 2020-12-30T10:15:30.00Zz--rotation-periodzfThe rotation period of the KMS settings of the new Assured Workloads environment, for example, 172800s--labelszmThe labels of the new Assured Workloads environment, for example, LabelKey1=LabelValue1,LabelKey2=LabelValue2z--provisioned-resources-parentzHThe parent of the provisioned projects, for example, folders/{FOLDER_ID}z--enable-sovereign-controlszIf true, enable sovereign controls for the new Assured Workloads environment, currently only supported by EU_REGIONS_AND_SUPPORT)r.   defaultr   N)r   r
   ChoiceEnumMapperr   GetComplianceRegimesEnum
choice_argAddToParserGetPartnersEnumr   ArgDictbool_AddResourceSettingsFlagr   release_tracks     r   AddCreateWorkloadFlagsr<   G   s    	I	  	 	+	   	M   	F  
 ++M:MO J{{6"""=1C J{{6" $
 )   	*2	   	:	   	H   	8   	 8   	&    	#L   61r   c                 &   U[         R                  R                  :X  a?  U R                  S[        R
                  " [        [        [        [        [        S.S9SSS9  g	U R                  S[        R
                  " [        [        [        S.S9SSS9  g	)
zAdds the resource settings flag to the assured workloads create command.

Args:
  parser: Parser, Parser used to construct the command flags.
  release_track: ReleaseTrack, Release track of the command being called.

Returns:
  None.
z--resource-settings)zconsumer-project-idzconsumer-project-nameencryption-keys-project-idencryption-keys-project-name
keyring-idr*   r,   a  A comma-separated, key=value map of custom resource settings such as custom project ids, for example: consumer-project-id={CONSUMER_PROJECT_ID} Note: Currently only consumer-project-id, consumer-project-name, encryption-keys-project-id, encryption-keys-project-name and keyring-id are supported. The encryption-keys-project-id, encryption-keys-project-name and keyring-id settings can be specified only if KMS settings are providedr-   )r>   r?   r@   a  A comma-separated, key=value map of custom resource settings such as custom project ids, for example: consumer-project-id={CONSUMER_PROJECT_ID} Note: Currently only encryption-keys-project-id, encryption-keys-project-name and keyring-id are supported. The encryption-keys-project-id, encryption-keys-project-name and keyring-id settings can be specified only if KMS settings are providedN)calliope_baseReleaseTrackGAr   r   r7   strr:   s     r   r9   r9      s     m00333
  '*),.103!
 ;  0   .103!
 ;  r   c                 8    [        U SS9  U R                  SSS9  g )Ndeleteverb--etagzPThe etag acquired by reading the Assured Workloads environment or AW "resource".r   )AddWorkloadResourceArgToParserr   r   s    r   AddDeleteWorkloadFlagsrK      s'     h7  r   c                     [        U SS9  g NdescriberG   rJ   r   s    r   AddDescribeWorkloadFlagsrP     s     j9r   c                     [        U SS9  g rM   )AddViolationResourceArgToParserr   s    r   AddDescribeViolationFlagsrS     s    !&z:r   c                     [        U SS9  g )Nzenable-resource-monitoringrG   rO   r   s    r    AddEnableResourceMonitoringFlagsrU     s     .JKr   c                     [        U SS9  U R                  SSS9  U R                  SSS9nUR                  S	S
S9  UR                  SSS9  UR                  SS[        R                  " 5       SS9  g)z$Method to add update workload flags.updaterG   rI   zOThe etag acquired by reading the Assured Workloads environment before updating.r   TzBSettings that can be updated on the Assured Workloads environment.r   r   z:The new display name of the Assured Workloads environment.z!--violation-notifications-enabledz>The notification setting of the Assured Workloads environment.r0   r,   zmThe new labels of the Assured Workloads environment, for example, LabelKey1=LabelValue1,LabelKey2=LabelValue2)r/   r.   r   N)rJ   r   	add_groupr   r7   )r   updatable_fieldss     r   AddUpdateWorkloadFlagsrZ     s     h7   %%O &  G    )K     8   r   c                     [         R                  R                  S[        R                  " 5       SSS9R                  U 5        g )N	operationz5The Assured Workloads operation resource to describe.Tr   )r   ConceptParserForResourcer	   GetOperationResourceSpecr5   r   s    r   AddDescribeOperationFlagsra   8  s<    ++,,.=	 , 
 Kr   c                     [         R                  R                  S[        R                  " 5       SR                  U5      SS9R                  U 5        g )Nworkloadz1The Assured Workloads environment resource to {}.Tr]   )r   r^   r_   r	   GetWorkloadResourceSpecformatr5   r   rH   s     r   rJ   rJ   A  sG    ++++-9@@F	 , 
 Kr   c                     [         R                  R                  S[        R                  " 5       SR                  U5      SS9R                  U 5        g )N	violationz/The Assured Workloads violation resource to {}.Tr]   )r   r^   r_   r	   GetViolationResourceSpecre   r5   rf   s     r   rR   rR   J  sG    ++,,.7>>tD	 , 
 Kr   c                 <    [        U 5        U R                  SSSS9  g)z$Method to add list violations flags.z
--workloadTzQThe parent workload of the Assured Workloads violations, provided as workload ID.r   N)r   r   r   s    r   AddListViolationsFlagsrk   S  s(    %	  r   c                 Z    [        U SS9  U R                  SSSS9  U R                  SSS	9  g
)z+Method to add acknowledge violations flags.acknowledgerG   z	--commentTz=Business justification used added to acknowledge a violation.r   z--acknowledge-typea  the acknowledge type for specified violation, which is one of:
      SINGLE_VIOLATION - to acknowledge specified violation,
      EXISTING_CHILD_RESOURCE_VIOLATIONS - to acknowledge specified org policy
      violation and all associated child resource violations.r   N)rR   r   r   s    r   AddAcknowledgeViolationsFlagsrn   `  sF    !&}=J  
 	A  r   N)__doc__
__future__r   r   r   googlecloudsdk.api_lib.assuredr   googlecloudsdk.callioper   r   rA   "googlecloudsdk.command_lib.assuredr	   $googlecloudsdk.command_lib.util.apisr
   (googlecloudsdk.command_lib.util.conceptsr   r   r   r<   r9   rK   rP   rS   rU   rZ   ra   rJ   rR   rk   rn   r!   r   r   <module>rv      sp    : &  ' 7 / 9 < : D**}2@6r:;LB
r   