
                             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  G d dej$                        Zy)zCCommand to delete a Cloud CDN Signed URL key from a backend bucket.    )absolute_import)division)unicode_literals)base_classes)poller)waiter)base)flags)signed_url_flagsc                   &    e Zd ZdZed        Zd Zy)DeleteSignedUrlKeya#  Delete Cloud CDN Signed URL key from a backend bucket.

  *{command}* deletes an existing Cloud CDN Signed URL key from a backend
  bucket.

  Cloud CDN Signed URLs give you a way to serve responses from the
  globally distributed CDN cache, even if the request needs to be
  authorized.

  Signed URLs are a mechanism to temporarily give a client access to a
  private resource without requiring additional authorization. To achieve
  this, the full request URL that should be allowed is hashed
  and cryptographically signed. By using the signed URL you give it, that
  one request will be considered authorized to receive the requested
  content.

  Generally, a signed URL can be used by anyone who has it. However, it
  is usually only intended to be used by the client that was directly
  given the URL. To mitigate this, they expire at a time chosen by the
  issuer. To minimize the risk of a signed URL being shared, it is recommended
  that the signed URL be set to expire as soon as possible.

  A 128-bit secret key is used for signing the URLs.
  c                     t        j                         t        _        t        j                  j	                  | d       t        j                  | d       y)z"Set up arguments for this command.zdelete CDN signed URL key from)operation_typeT)requiredN)r
   BackendBucketArgumentr   BACKEND_BUCKET_ARGAddArgumentr   AddCdnSignedUrlKeyName)parsers    <lib/surface/compute/backend_buckets/delete_signed_url_key.pyArgszDeleteSignedUrlKey.Args8   sF     -2,G,G,I)))55? 6 A++FTB    c                    t        j                  | j                               }|j                  j                  }|j                  j
                  }|j                  }| j                  j                  ||j                  t        j                  |j                              }|j                  |j                  |j                         |j                        }|j!                  |      }|j                  j#                  |j$                  d      }	t'        j(                  |      }
t+        j,                  |
|	dj/                  |j                                     S )zEIssues the request to delete Signed URL key from the backend service.)scope_lister)projectbackendBucketkeyNamezcompute.globalOperations)
collectionz,Deleting Cloud CDN Signed URL key from [{0}])r   ComputeApiHolderReleaseTrackclientapitools_clientmessagesbackendBucketsr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeLister.ComputeBackendBucketsDeleteSignedUrlKeyRequestr   Namekey_namer   ParseselfLinkr   Pollerr   WaitForformat)selfargsholder
api_clientr#   servicebackend_bucket_refrequest	operationoperation_refoperation_pollers              r   RunzDeleteSignedUrlKey.Run@   s/   **4+<+<+>?F..J}}%%H''G00BB"88G C I EE"**(--/ F G
 **73I$$**'A + CM }}W->>*MHOO05579: :r   N)__name__
__module____qualname____doc__staticmethodr   r;    r   r   r   r      s"    2 C C:r   r   N)r?   
__future__r   r   r   googlecloudsdk.api_lib.computer   )googlecloudsdk.api_lib.compute.operationsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r'   r   2googlecloudsdk.command_lib.compute.backend_bucketsUpdateCommandr   rA   r   r   <module>rJ      s;    J &  ' 7 < . ( E ? D9:++ 9:r   