
    Z'                     6   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	KJr  S
SS.r\R                   " \R"                  R$                  \R"                  R&                  5      \R(                   " S S\R*                  5      5       5       rg)zCommand to create a pipeline.    )absolute_import)division)unicode_literals)	pipelines)base)flags)labels_util)logz{description}a           To create a new pipeline `my-pipeline` in location `us-central1` with its destination targeting HTTP endpoint URI 'https://example-endpoint.com', run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination and a message binding template, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',http_endpoint_message_binding_template='{"headers": {"new-header-key": "new-header-value"}}'

        To create a new pipeline `my-pipeline` in location `us-central1` with a Cloud Workflow destination `my-workflow`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=workflow=my-workflow

        To create a new pipeline `my-pipeline` in location `us-central1` with a message bus destination `my-message-bus`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=message_bus=my-message-bus

        To create a new pipeline `my-pipeline` in location `us-central1` with a Cloud Pub/Sub Topic destination `my-topic`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=pubsub_topic=my-topic

        To create a new pipeline `my-pipeline` in location `us-central1` with a Cloud Workflow in project `example-project` and location `us-east1`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=workflow=my-workflow,project=example-project,location=us-east1

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a service account `example-service-account@example-project.gserviceaccount.iam.com` for OIDC authentication, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',google_oidc_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a service account `example-service-account@example-project.gserviceaccount.iam.com` for OIDC authentication with audience `https://example.com`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',google_oidc_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com,google_oidc_authentication_audience='https://example.com'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a service account `example-service-account@example-project.gserviceaccount.iam.com` for OAuth token authentication, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',oauth_token_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a service account `example-service-account@example-project.gserviceaccount.iam.com` for OAuth token authentication with scope `https://www.googleapis.com/auth/cloud-platform`, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',oauth_token_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com,oauth_token_authentication_scope='https://www.googleapis.com/auth/cloud-platform'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and the JSON input and output payload formats, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',output_payload_format_json= --input-payload-format-json=

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and the Avro input and output payload formats, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',output_payload_format_avro_schema_definition='{"type": "record", "name": "my_record", "fields": [{"name": "my_field", "type": "string"}]}' --input-payload-format-avro-schema-definition='{"type": "record", "name": "my_record", "fields": [{"name": "my_field", "type": "string"}]}'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and the Protobuf input and output payload formats, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',output_payload_format_protobuf_schema_definition='syntax = "proto3"; message Location { string home_address = 1; }' --input-payload-format-protobuf-schema-definition='syntax = "proto3"; message Location { string home_address = 1; }'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a transformation mediation, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com'--mediations=transformation_template='message.removeFields(["data.credit_card_number","data.ssn"])'

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a INFO level logging configuration, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com'--logging_config=INFO

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a custom retry policy, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com' --max-retry-attempts=10 --min-retry-delay=2s --max-retry-delay=64s

        To create a new pipeline `my-pipeline` in location `us-central1` with an HTTP endpoint URI destination `https://example-endpoint.com` and a Cloud KMS CryptoKey, run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com'  --crypto-key=projects/PROJECT_ID/locations/KMS_LOCATION/keyRings/KEYRING/cryptoKeys/KEY
        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Createe   zCreate an Eventarc pipeline.c                    [         R                  " U5        [         R                  " USS9  [         R                  " U5        [         R                  " U5        [         R
                  " US5        [         R                  " U5        [         R                  " USSS9  [        R                  " U5        [        R                  R                  U5        g )NT)requiredz#The logging config of the pipeline.F)
with_clearhidden)r   AddCreatePipelineResourceArgsAddPipelineDestinationsArgAddInputPayloadFormatArgsAddMediationsArgAddLoggingConfigArgAddRetryPolicyArgsAddCryptoKeyArgr	   AddCreateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     (lib/surface/eventarc/pipelines/create.pyArgsCreate.Argsl   s    	''/	$$Vd;	##F+	6"	f&KL	V$	&U5A$$V,OO'    c                    [         R                  " 5       nUR                  R                  R	                  5       nUR                  R
                  R	                  5       n[        R                  " SR                  UR                  UR                  UR                  5      5        UR                  UUR                  UUR                  UR                  UR                   UR"                  UR$                  UR&                  UR(                  UR*                  UR,                  UR.                  [0        R2                  " XR5                  5       5      US95      nUR6                  (       a  U$ UR9                  USU5      $ )zRun the create command.z2Creating pipeline {} for project {} in location {})pipeline_refdestinationsinput_payload_format_json+input_payload_format_avro_schema_definition/input_payload_format_protobuf_schema_definition
mediationslogging_configmax_retry_attemptsmin_retry_delaymax_retry_delaycrypto_key_namelabelserror_message_bus_refCreating)r   PipelineClientV1CONCEPTSpipelineParseerror_message_busr
   debugformatpipelinesId
projectsIdlocationsIdr   BuildPipeliner&   r'   r(   r)   r*   r+   r,   r-   r.   
crypto_keyr	   ParseCreateArgsLabelsValueClassasync_WaitFor)selfargsclientpipelines_refr1   	operations         r    Run
Create.Runx   s1   '')FMM**002M MM;;AACII<CC%%$$%%	
 &**&*&D&D8<8h8h<@<p<p..#66 00 00 OO..t5L5L5NO"7 	 	
I& {{>>)Z??r#    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr!   rH   __static_attributes__rJ   r#   r    r   r   e   s$     % -	( 	("@r#   r   N)rO   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rP   ReleaseTracksReleaseTrackBETAGADefaultUniverseOnlyCreateCommandr   rJ   r#   r    <module>r`      s    $ &  ' 5 ( 5 < # #DGT D%%**D,=,=,@,@A3@T 3@  B3@r#   