
    ,                     N    S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      rg)	z5Overwatch Object to run all commands under overwatch.    )absolute_import)division)unicode_literals)	instancesc                   X    \ rS rSrSrS rSS jrS rS rS r	S	 r
S
 rS rS rS rSrg)SLZOverwatchClient   z/Implements overwatch commands using API Client.c                     [         R                  " 5       U l        [         R                  " 5       U l        [         R
                  " 5       U l        [         R                  " 5       U l        g )N)	r   get_overwatch_message	_messagesget_overwatch_service_overwatch_serviceget_organization_service_organization_serviceget_operations_service_operation_service)selfs    9lib/googlecloudsdk/api_lib/scc/slz_overwatch/overwatch.py__init__SLZOverwatchClient.__init__   sE    446DN'==?D!*!C!C!ED'>>@D    Nc                     Ub  [        U5      nU R                  R                  XUS9nU R                  R	                  U5      nU$ )a  Implements method for the overwatch command `list`.

Args:
  parent: The organization ID and location in the format
    organizations/<ORG_ID>/locations/<LOCATION-ID>.
  page_size: The entries required at a time.
  page_token: The page token for the specific page. If the page_token is
    empty, then it indicates to return results from the start.

Returns:
  response: The response from the List method of API client.
)parentpageSize	pageToken)intr   >SecuredlandingzoneOrganizationsLocationsOverwatchesListRequestr   List)r   r   	page_size
page_tokenrequestresponses         r   r   SLZOverwatchClient.List!   sN     i.inn[[Z \ AG&&++G4HOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a  Implements method for the overwatch command `get`.

Args:
  overwatch_path: The complete overwatch path. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/overwatches/<OVERWATCH_ID>.

Returns:
  response: The json response from the Get method of API client.
name)r   =SecuredlandingzoneOrganizationsLocationsOverwatchesGetRequestr   Getr   overwatch_pathr!   r"   s       r   r(   SLZOverwatchClient.Get5   s<     nnZZ [ G&&**73HOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a  Implements method for the overwatch command `delete`.

Args:
  overwatch_path: The complete overwatch path. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/overwatches/<OVERWATCH_ID>.

Returns:
  response: The json response from the Delete method of API client.
r%   )r   @SecuredlandingzoneOrganizationsLocationsOverwatchesDeleteRequestr   Deleter)   s       r   r.   SLZOverwatchClient.DeleteD   s<     nn]] ^ G&&--g6HOr   c                 h   U R                   R                  UR                  5       U R                   R                  R                  R                  US9nU R                   R                  UR                  5       R                  5       UUR                  5       S9nU R                  R                  U5      nU$ )zImplements method for the overwatch command `create`.

Args:
  overwatch: The overwatch resource.
  blueprint_plan: Base64 encoded blueprint plan message.

Returns:
  response: The json response from the Create method of API client.
)r&   stateplanData)r   ,googleCloudSecuredlandingzoneV1betaOverwatchoverwatchId)
r   ,GoogleCloudSecuredlandingzoneV1betaOverwatchRelativeNameStateValueValuesEnumACTIVE@SecuredlandingzoneOrganizationsLocationsOverwatchesCreateRequestParentNamer   Create)r   	overwatchblueprint_planreq_overwatchr!   r"   s         r   r<   SLZOverwatchClient.CreateS   s     NNOO##%nnII		ff P !M nn]]!..05BNN$ ^ &G &&--g6HOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a  Implements method for the overwatch command `suspend`.

Args:
  overwatch_path: The complete overwatch path. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/overwatches/<OVERWATCH_ID>.

Returns:
  response: The json response from the Suspend method of API client.
r%   )r   ASecuredlandingzoneOrganizationsLocationsOverwatchesSuspendRequestr   Suspendr)   s       r   rC   SLZOverwatchClient.Suspendj   s<     nn^^ _ G&&..w7HOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a  Implements method for the overwatch command `activate`.

Args:
  overwatch_path: The complete overwatch path. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/overwatches/<OVERWATCH_ID>.

Returns:
  response: The json response from the Activate method of API client.
r%   )r   BSecuredlandingzoneOrganizationsLocationsOverwatchesActivateRequestr   Activater)   s       r   rG   SLZOverwatchClient.Activatey   s<     nn__ ` G&&//8HOr   c                     U R                   R                  XS9nU R                   R                  UUUS9nU R                  R	                  U5      nU$ )a  Implements method for the overwatch command `update`.

Args:
  overwatch_path: The complete overwatch path. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/overwatches/<OVERWATCH_ID>.
  blueprint_plan: Base64 encoded blueprint plan message.
  update_mask: The name of the field that will be updated.

Returns:
  response: The json response from the Update method of API client.
)r&   r2   )r&   r3   
updateMask)r   r5   ?SecuredlandingzoneOrganizationsLocationsOverwatchesPatchRequestr   Patch)r   r*   r>   update_maskr=   r!   r"   s          r   rL   SLZOverwatchClient.Patch   sa     KK L 6Inn\\5> ]  G &&,,W5HOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a  Implements method for the overwatch command `enable`.

Args:
  parent: The parent where overwatch service needs to be enabled. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>

Returns:
  response: The json response from the Enable method of API client.
)organization)r   >SecuredlandingzoneOrganizationsLocationsEnableOverwatchRequestr   EnableOverwatch)r   r   r!   r"   s       r   EnableSLZOverwatchClient.Enable   s<     nn[[ \ G))99'BHOr   c                 n    U R                   R                  US9nU R                  R                  U5      nU$ )a)  Implements method for the overwatch command  `operation`.

Args:
  operation_id: The operation ID of google.lonrunning.operation. Format:
    organizations/<ORG_ID>/locations/<LOCATION_ID>/operations/<OPERATION_ID>.

Returns:
  response: The json response from the Operation method of API client.
r%   )r   <SecuredlandingzoneOrganizationsLocationsOperationsGetRequestr   r(   )r   operation_idr!   r"   s       r   	OperationSLZOverwatchClient.Operation   s<     nnYY Z G&&**73HOr   )r   r   r   r   )NN)__name__
__module____qualname____firstlineno____doc__r   r   r(   r.   r<   rC   rG   rL   rS   rX   __static_attributes__ r   r   r   r      s8    7A(.*r   r   N)	r^   
__future__r   r   r   ,googlecloudsdk.command_lib.scc.slz_overwatchr   objectr   r`   r   r   <module>rd      s$    < &  ' Ba ar   