
                         x    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	 r " S
 S\5      rg)z5Utilities Assured Workloads API, Workloads Endpoints.    )absolute_import)division)unicode_literals)
list_pager)message_util)util)	resourcesc                 r    [         R                  R                  U R                  SS9nUR	                  5       $ )Nz=assuredworkloads.organizations.locations.workloads.violations)
collection)r	   REGISTRYParseRelativeNamenameSelfLink)resource	violations     0lib/googlecloudsdk/api_lib/assured/violations.pyGetViolationURIr      s8      22mmP 3 ) 
			    c                   >    \ rS rSrSrS	S jrS
S jrS r SS jrSr	g)ViolationsClient#   z/Client for Violations in Assured Workloads API.c                     [         R                  " X5      U l        [         R                  " U5      U l        Xl        U R                  R                  U l        g N)r   GetClientInstanceclientGetMessagesModulemessages_release_track,organizations_locations_workloads_violations_service)selfrelease_trackno_https      r   __init__ViolationsClient.__init__&   s=    ((@DK**=9DM'KKLLDMr   Nc           	      z    U R                   R                  XS9n[        R                  " U R                  USUUSS9$ )a  List all Assured Workloads violations belonging to the given workload.

Args:
  parent: str, the parent workload of the Assured Workloads Violations to be
    listed, in the form:
    organizations/{ORG_ID}/locations/{LOCATION}/workloads/{WORKLOAD}.
  limit: int or None, the total number of results to return.
  page_size: int, the number of entries in each batch (affects requests
    made, but not the yielded results).

Returns:
  A list of all Assured Workloads violations belonging to a given workload.
)parentpageSize
violationsN)field
batch_sizelimitbatch_size_attribute)r   DAssuredworkloadsOrganizationsLocationsWorkloadsViolationsListRequestr   YieldFromListr    )r!   r'   r,   	page_sizelist_reqs        r   ListViolationsClient.List,   sL     }}aa b H ##! r   c                 ~    U R                   R                  US9nU R                  R                  R	                  U5      $ )a5  Describe an existing Assured Workloads compliance violation.

Args:
  name: str, the name for the Assured Workloads Violation being described in
    the form:
    organizations/{ORG_ID}/locations/{LOCATION}/workloads/{WORKLOAD_ID}/violations/{VIOLATION_ID}.

Returns:
  Specified Assured Workloads Violation.
)r   )r   CAssuredworkloadsOrganizationsLocationsWorkloadsViolationsGetRequestr   r   Get)r!   r   describe_reqs      r   DescribeViolationsClient.DescribeF   sC     ==dd e L ;;CCGG r   c                     [         R                  " XX0R                  5      nU R                  R                  R                  U5      $ )a  Acknowledge an existing Assured Workloads compliance violation.

Args:
  name: str, the name for the Assured Workloads violation being described in
    the form:
    organizations/{ORG_ID}/locations/{LOCATION}/workloads/{WORKLOAD_ID}/violations/{VIOLATION_ID}.
  comment: str, the business justification which the user wants to add while
    acknowledging a violation.
  acknowledge_type: str, 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.

Returns:
  Specified Assured Workloads Violation.
)r   CreateAcknowledgeRequestr   r   r   Acknowledge)r!   r   commentacknowledge_typeacknowledgement_reqs        r   r<   ViolationsClient.AcknowledgeX   sC    , '??')<)< ;;CCOO r   )r   r    r   r   )F)Nd   r   )
__name__
__module____qualname____firstlineno____doc__r$   r2   r8   r<   __static_attributes__ r   r   r   r   #   s    7M4, 	r   r   N)rF   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.assuredr   r   googlecloudsdk.corer	   r   objectr   rH   r   r   <module>rN      s2    < &  ' ' 7 / )Pv Pr   