
    .                        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	S
SS.r\R                  " \R                  R                   5      \R"                   " S S\R$                  5      5       5       rg)z)Command to infer connections for a space.    )absolute_import)division)unicode_literals)utils)base)flags)logzInfers connections for catalog and shared template revisions within a space. If no URIs are provided, it processes all templates in the space, but may fail if a shared template is unexpectedly missing.a           To infer connections for a space named `my-space` in location `us-central1` and project `my-project`, run:

          $ {command} my-space --project=my-project --location=us-central1

        To infer connections for a space named `my-space` in location `us-central1` and project `my-project`, with specific catalog template revision URIs and using Gemini, run:

          $ {command} platform --project=my-project --location=us-central1 \
            --catalog-template-revision-uris=projects/my-project/locations/us-central1/spaces/security/catalogs/security/templates/certificate-authority/revisions/rev1,projects/my-project/locations/us-central1/spaces/security/catalogs/security/templates/certificate-authority/revisions/rev2 \
            --use-gemini

        To infer connections for a space using the full resource name, run:

          $ {command} projects/cloud-appcenter-e2e-testing/locations/us-central1/spaces/platform \
            --catalog-template-revision-uris=projects/cloud-appcenter-e2e-testing/locations/us-central1/spaces/security/catalogs/security/templates/certificate-authority/revisions/rev1 \
            --use-gemini
        z     This command uses the designcenter/v1alpha API. The full documentation for
    this API can be found at:
    http://cloud.google.com/application-design-center/docs
    )DESCRIPTIONEXAMPLESzAPI REFERENCEc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)InferConnections9   zInfer connections for a space.c                 0    [         R                  " U 5        g)z Register flags for this command.N)r   AddInferConnectionsFlags)parsers    5lib/surface/design_center/spaces/infer_connections.pyArgsInferConnections.Args@   s     
""6*    c                 f   [         R                  " U R                  5       5      n[         R                  " U R                  5       5      nUR                  R
                  R                  5       nUR                  5       nUR                  5       nUR                  S5      (       a  UR                  Ul        UR                  (       a  UR                  Ul        UR                  XVS9nUR                  R!                  U5      n["        R$                  R'                  SR)                  UR+                  5       5      5        UR,                  (       a  U$ [         R.                  " UUSSU R                  5       S9n	["        R$                  R'                  SR)                  UR+                  5       5      5        U	$ )z9This is what gets called when the user runs this command.catalog_template_revision_uris)nameinferConnectionsRequestz+Infer connections request issued for: [{0}]z)Waiting for infer connections to completei   )max_wait_secrelease_trackz/Finished inferring connections for space [{0}].)r   GetClientInstanceReleaseTrackGetMessagesModuleCONCEPTSspaceParseRelativeNameInferConnectionsRequestIsSpecifiedr   catalogTemplateRevisionUris
use_gemini	useGemini:DesigncenterProjectsLocationsSpacesInferConnectionsRequestprojects_locations_spacesr   r	   statusPrintformatNameasync_"WaitForOperationWithEmbeddedResult)
selfargsclientmessages	space_refparentinfer_connections_request_msgrequest	operationresponse_dicts
             r   RunInferConnections.RunE   sj   $$T%6%6%89F&&t'8'8':;H##))+I##%F$,$D$D$F!899

-
- $? 04#- 	KK 	L 	
  00AA'JIJJ5<<Y^^=MN {{<<3'')M JJ9@@NN	

 r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r:   __static_attributes__r<   r   r   r   r   9   s#     ' -+ +,r   r   N)rA   
__future__r   r   r   $googlecloudsdk.api_lib.design_centerr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.design_centerr   googlecloudsdk.corer	   rB   ReleaseTracksr   ALPHAUniverseCompatibleCommandr   r<   r   r   <module>rO      sz    0 &  ' 6 ( : #	M"/> D%%++,6t|| 6  -6r   