
    %                        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rS	rS
r\R                   \R"                  " \R$                  R&                  5       " S S\R(                  5      5       5       r\R,                  " SSS9\R"                  " \R$                  R.                  5       " S S\5      5       5       rg)z7Command to create connection profiles for a datastream.    )connection_profiles)util)base)flags)resource_args)
console_ioz&Create a Datastream connection profileaA      To create a connection profile for Oracle:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=oracle --oracle-password=fakepassword --oracle-username=fakeuser --display-name=my-profile --oracle-hostname=35.188.150.50 --oracle-port=1521 --database-service=ORCL --static-ip-connectivity

    To create a connection profile for MySQL:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=mysql --mysql-password=fakepassword --mysql-username=fakeuser --display-name=my-profile --mysql-hostname=35.188.150.50 --mysql-port=3306 --static-ip-connectivity

    To create a connection profile for PostgreSQL:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=postgresql --postgresql-password=fakepassword --postgresql-username=fakeuser --display-name=my-profile --postgresql-hostname=35.188.150.50 --postgresql-port=5432 --postgresql-database=db --static-ip-connectivity

    To create a connection profile for SQL Server:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=sqlserver --sqlserver-password=fakepassword --sqlserver-username=fakeuser --display-name=my-profile --sqlserver-hostname=35.188.150.50 --sqlserver-port=1433 --sqlserver-database=db --static-ip-connectivity

    To create a connection profile for Salesforce using Username, Password and Security Token:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=salesforce --salesforce-password=fakepassword --salesforce-username=fakeuser --salesforce-security-token=fakesecuritytoken --display-name=my-profile --salesforce-hostname=35.188.150.50 --salesforce-port=1433 --salesforce-database=db --static-ip-connectivity

    To create a connection profile for Salesforce using OAuth:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=salesforce --salesforce-client-secret=fakesecret --salesforce-client-id=fake-client-id --display-name=my-profile --salesforce-domain=fakecompany.my.salesforce.com --static-ip-connectivity

        To create a connection profile for Spanner:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=spanner --spanner-database=projects/fake-project/instances/fake-instance/databases/fake-database --display-name=my-profile

    To create a connection profile for Google Cloud Storage:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=google-cloud-storage --bucket=fake-bucket --root-path=/root/path --display-name=my-profile

    To create a connection profile for BigQuery:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=bigquery --display-name=my-profile

    To create a connection profile for MongoDB:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=mongodb --mongodb-password=fakepassword --mongodb-username=fakeuser --display-name=my-profile --mongodb-host-addresses=35.188.150.50:27017

   aD      To create a connection profile for Oracle:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=oracle --oracle-password=fakepassword --oracle-username=fakeuser --display-name=my-profile --oracle-hostname=35.188.150.50 --oracle-port=1521 --database-service=ORCL --static-ip-connectivity

    To create a connection profile for MySQL:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=mysql --mysql-password=fakepassword --mysql-username=fakeuser --display-name=my-profile --mysql-hostname=35.188.150.50 --mysql-port=3306 --static-ip-connectivity

    To create a connection profile for Google Cloud Storage:

        $ {command} CONNECTION_PROFILE --location=us-central1 --type=google-cloud-storage --bucket-name=fake-bucket --root-path=/root/path --display-name=my-profile --no-connectivity
   c                   H    \ rS rSrSr\\S.r\S 5       r	\S 5       r
S rSrg)	CreateT   'Create a Datastream connection profile.DESCRIPTIONEXAMPLESc                    [         R                  " U SU5        [        R                  " U 5        [        R                  " U 5        U[
        R                  R                  :X  a  [        R                  " U S5        U R                  SS9n[        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                   " X!5        [        R"                  " U5        [$        R&                  " U 5        g)a  Common arguments for all release tracks.

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.
  release_track: Some arguments are added based on the command release
    track.
z	to creater
   T)mutexN)r   AddConnectionProfileResourceArgcp_flagsAddTypeFlagAddDisplayNameFlagr   ReleaseTrackGAAddValidationGroup	add_groupAddMysqlProfileGroupAddOracleProfileGroupAddPostgresqlProfileGroupAddSqlServerProfileGroupAddSalesforceProfileGroupAddSpannerProfileCreateGroupAddGcsProfileGroupAddMongodbProfileGroupr   AddLabelsCreateFlags)parserrelease_trackprofile_flagss      4lib/surface/datastream/connection_profiles/create.py
CommonArgsCreate.CommonArgsZ   s     11&+2?A  ')),,,!!&(3$$4$0M!!-0""=1&&}5%%m4&&}5))-8=##M2	v&    c                 `    [         R                  U [        R                  R                  5        gz@Args is called by calliope to gather arguments for this command.N)r
   r'   r   r   r   r#   s    r&   ArgsCreate.Argsw   s      fd//223r)   c                 >   UR                   R                  R                  5       nUR                  5       R	                  5       nUR
                  (       a  [        R                  " S5      Ul        UR                  (       a  [        R                  " S5      Ul
        UR                  (       a  [        R                  " S5      Ul        UR                  (       a  [        R                  " S5      Ul        UR                  (       a  [        R                  " S5      Ul        UR"                  (       a  [        R                  " S5      Ul        UR&                  (       a  [        R                  " S5      Ul        UR*                  (       a  [        R                  " S5      Ul        UR.                  R1                  5       n[2        R4                  " 5       nUR7                  X2R8                  UU R;                  5       U5      n[<        R>                  " 5       n[<        R@                  " 5       n[<        RB                  " 5       n	U	R7                  SURD                  URF                  URH                  S9n
URJ                  RM                  URO                  U
RP                  S95      $ )a   Create a Datastream connection profile.

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

Returns:
  A dict object representing the operations resource describing the create
  operation if the create was successful.
zPlease Enter Password: zPlease Enter Security Token: z&Please Enter OAuth 2.0 Client Secret: z(datastream.projects.locations.operations)operationsId
projectsIdlocationsId)name))CONCEPTSconnection_profileParseParentRelativeNameoracle_prompt_for_passwordr   PromptPasswordoracle_passwordmysql_prompt_for_passwordmysql_passwordpostgresql_prompt_for_passwordpostgresql_passwordsqlserver_prompt_for_passwordsqlserver_passwordsalesforce_prompt_for_passwordsalesforce_password$salesforce_prompt_for_security_tokensalesforce_security_token*salesforce_prompt_for_oauth2_client_secretsalesforce_oauth2_client_secretmongodb_prompt_for_passwordmongodb_passwordtypeupperr   ConnectionProfilesClientr
   connectionProfilesIdr   r   GetClientInstanceGetMessagesModuleGetResourceParserr3   r1   r2   projects_locations_operationsGet/DatastreamProjectsLocationsOperationsGetRequestr0   )selfargsconnection_profile_ref
parent_refcp_type	cp_clientresult_operationclientmessagesresource_parseroperation_refs              r&   Run
Create.Run|   s    "]]==CCE'..0==?J&&'66
#%d %%&556OPd**!+!:!:
#"%d )) * 9 9
#!d **!+!:!:
#"d 00'1'@'@
)(d$ 66-7-F-F
2.d* ''(77
#d yy!G#<<>I ''??T# ##%F%%'H,,.O#**2%**)44*66	 + 8M //33@@++ 	A 	-. .r)    N)__name__
__module____qualname____firstlineno____doc__r   r   detailed_helpstaticmethodr'   r-   r_   __static_attributes__ra   r)   r&   r
   r
   T   s=     0"-8D-' '8 4 4C.r)   r
   FzpDatastream beta version is deprecated. Please use`gcloud datastream connection-profiles create` command instead.)
is_removedwarningc                   2    \ rS rSrSr\\S.r\S 5       r	Sr
g)
CreateBeta   r   r   c                 `    [         R                  U [        R                  R                  5        gr+   )r
   r'   r   r   BETAr,   s    r&   r-   CreateBeta.Args   s      fd//445r)   ra   N)rb   rc   rd   re   rf   r   EXAMPLES_BETArg   rh   r-   ri   ra   r)   r&   rm   rm      s#     0"-=I-6 6r)   rm   N)rf   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr   r   9googlecloudsdk.command_lib.datastream.connection_profilesr   googlecloudsdk.core.consoler   r   r   rr   DefaultUniverseOnlyReleaseTracksr   r   Commandr
   	Deprecaterp   rm   ra   r)   r&   <module>r|      s    > B 2 ( 7 ? W 27)T D%%(()i.T\\ i. * i.X GI D%%**+6 6 ,	I
6r)   