
    1.                         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 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.    )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   /   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>l   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"   s   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   AddCreateWorkloadFlagsr9   D   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   r4   strr7   s     r   r6   r6      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   AddDeleteWorkloadFlagsrH      s'     h7  r   c                     [        U SS9  g NdescriberD   rG   r   s    r   AddDescribeWorkloadFlagsrM     s     j9r   c                     [        U SS9  g rJ   )AddViolationResourceArgToParserr   s    r   AddDescribeViolationFlagsrP     s    !&z:r   c                     [        U SS9  g )Nzenable-resource-monitoringrD   rL   r   s    r    AddEnableResourceMonitoringFlagsrR     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.updaterD   rF   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.r-   r)   zmThe new labels of the Assured Workloads environment, for example, LabelKey1=LabelValue1,LabelKey2=LabelValue2)r,   r+   r   N)rG   r   	add_groupr   r4   )r   updatable_fieldss     r   AddUpdateWorkloadFlagsrW     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   GetOperationResourceSpecr2   r   s    r   AddDescribeOperationFlagsr^   5  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 {}.TrZ   )r   r[   r\   r   GetWorkloadResourceSpecformatr2   r   rE   s     r   rG   rG   >  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 {}.TrZ   )r   r[   r\   r   GetViolationResourceSpecrb   r2   rc   s     r   rO   rO   G  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   AddListViolationsFlagsrh   P  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.acknowledgerD   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)rO   r   r   s    r   AddAcknowledgeViolationsFlagsrk   ]  sF    !&}=J  
 	A  r   N)__doc__googlecloudsdk.api_lib.assuredr   googlecloudsdk.callioper   r   r>   "googlecloudsdk.command_lib.assuredr   $googlecloudsdk.command_lib.util.apisr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r9   r6   rH   rM   rP   rR   rW   r^   rG   rO   rh   rk   r   r   r   <module>rr      si    : 8 / 9 < : D**}2@6r:;LB
r   