
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 dd	lmZ dd
lmZ ddlmZ dZdZeedZ e
j&                  e
j(                  j*                         G d de
j,                               Zy)GReleases a SQL Server Reporting Services lease on a Cloud SQL instance.    )absolute_import)division)unicode_literals)api_util)
operations)validate)base)flags)log)
propertieszO    Release a SQL Server Reporting Services lease on a Cloud SQL instance.
    zg    To release a SQL Server Reporting Services lease on an instance:

    $ {command} instance-foo
    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)ReleaseSsrsLeaser   c                 H    | j                  dt        j                  d       y)a  Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.

    Returns:
      A dict object representing the operations resource describing the release
      SSRS lease operation if the operation was successful.
    instancezCloud SQL instance ID.)	completerhelpN)add_argumentr   InstanceCompleter)parsers    /lib/surface/sql/instances/release_ssrs_lease.pyArgszReleaseSsrsLease.Args4   s&     ))%      c                    t        j                  t         j                        }|j                  }|j                  }t        j                  |j                         |j                  j                  |j                  dt        j                  j                  j                  j                  id      }|j                  |j                  |j                        }|j                   j#                  |      }|j                  j%                  d|j&                  |j                        }t(        j*                  j-                  ||d       t.        j0                  j3                  d       y	)
aV  Releases a SQL Server Reporting Services lease on a Cloud SQL instance.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      A dict object representing the operations resource describing the
      release-ssrs-lease operation if the release-ssrs-lease was successful.
    projectzsql.instances)params
collection)r   r   zsql.operations)	operationr   zReleasing SSRS leasez"Successfully released SSRS lease.
N)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr	   ValidateInstanceNamer   resource_parserParser   VALUEScorer   	GetOrFail#SqlInstancesReleaseSsrsLeaseRequest	instancesr   CreateoperationIdr   OperationsV1Beta4WaitForOperationr   statuswrite)	selfargsclientr#   r$   instance_refrequestresultoperation_refs	            r   RunzReleaseSsrsLease.RunF   s+     < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L
 >>&&$$ ? G
 !!227;F**11$$$$ 2 &M
   11*m2HJ JJ:;r   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r:    r   r   r   r   .   s!    O- "$<r   r   N)r>   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   r	   googlecloudsdk.callioper
   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   r   r   r   r?   ReleaseTracksReleaseTrackGACommandr   rB   r   r   <module>rL      s~    N &  ' / 1 / ( 0 # *  D%%(();<t|| ;< *;<r   