
    *	                     Z    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Zy	)zHFunctions related to resource validation for Binary Authorization's CLI.    )absolute_import)division)unicode_literals)attestations)log)
console_ioc                 J   t        j                  |      }|j                  | |      }|j                  |j                  j
                  j                  j                  k(  rt        j                  d       y|j                  |j                  j
                  j                  j                  k(  r/t        j                  dj                  |j                               nt        j                  d       t        j                   dj                  |j#                               d       y)a  Returns the passed `image_url` with the scheme replaced.

  Args:
    occurrence: The AttestationOccurrence-kind Occurrence to be validated.
      (grafeas.v1.Occurrence)
    attestor_ref: The Attestor to validate the Attestation against. (Resource)
    api_version: The version of the Binary Authorization API to use. (string)
    action: The name of the action included in the confirmation prompt if the
      Attestation can't be validated. (string)
  z&Attestation was successfully validatedNz(Attestation could not be validated! ({})z9Attestation could not be validated! (Reason not provided)z{} Attestation anyway?T)prompt_stringcancel_on_no)r   ClientTestresultmessages%ValidateAttestationOccurrenceResponseResultValueValuesEnumVERIFIEDr   infoATTESTATION_NOT_VERIFIABLEwarningformatdenialReasonerrorr   PromptContinue
capitalize)
occurrenceattestor_refapi_versionactionclientvalidation_responses         ?lib/googlecloudsdk/command_lib/container/binauthz/validation.pyvalidate_attestationr"      s     {+&J=6??#X#X#n#n#w#wwHH56
!!V__%Z%Z%p%p  &L  &L  LKK:AA((* + IIIJ,33F4E4E4GH    N)create)__doc__
__future__r   r   r   )googlecloudsdk.api_lib.container.binauthzr   googlecloudsdk.corer   googlecloudsdk.core.consoler   r"    r#   r!   <module>r+      s'    O &  ' B # 2 !)r#   