
    ~                     ^   S r SSKJr  SSKJr  SSKJr  SSK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  \R                  " \R                  R                   \R                  R"                  \R                  R$                  5      \R&                   " S S\R(                  5      5       5       rg)z(gcloud datastore emulator start command.    )absolute_import)division)unicode_literalsN)arg_parsers)base)firestore_util)util)javac                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Start   zSStart a local Firestore emulator.

This command starts a local Firestore emulator.
EXAMPLESa            To start the local Firestore emulator, run:

            $ {command}

          To bind to a specific host and port, run:

            $ {command} --host-port=0.0.0.0:8080

          To run the local Firestore emulator with a Firebase Rules set, run:

            $ {command} --rules=firestore.rules

          To run the local Firestore emulator in Datastore Mode, run:

            $ {command} --database-mode=datastore-mode

          To import data at the start of the Firestore emulator, run:

            $ {command} --import-data=<path/to/file>

          To export emulator data upon emulator shutdown, run:

            $ {command} --export-on-exit=<path/to/directory>
          c                     U R                  SSSS9  U R                  SSS SS9  U R                  S	SS
S9  U R                  SSSSSS9  U R                  SSSS9  U R                  SSSS9  U R                  SSSSS9  g )Nz--rulesFzIf set, all projects will use the security rules in this file. More information on Firebase Rules and the syntax for this file is available at https://firebase.google.com/docs/rules.)requiredhelpz--host-portc                 >    [         R                  R                  U SS9$ )NTipv6_enabled)r   HostPortParse)args    (lib/surface/emulators/firestore/start.py<lambda>Start.Args.<locals>.<lambda>N   s    --33Cd3K    a*  The host:port to which the emulator should be bound. Can take the form of a single address (hostname, IPv4, or IPv6) and/or port:

  [ADDRESS][:PORT]

In this format you must enclose IPv6 addresses in square brackets: e.g.

  [2001:db8:0:0:0:ff00:42:8329]:8080

The default value is localhost:8080.)r   typer   z--database-modezThe database mode to start the Firestore Emulator in. The valid options are: 

  `firestore-native` (default): start the emulator in Firestore Native
  `datastore-mode`: start the emulator in Datastore Modez!--use-firestore-in-datastore-mode
store_trueTz$Runs the emulator in Datastore Mode.)defaultactionhiddenr   z--import-datazFile path to the data to be loaded into the emulator upon start up. Example:`/home/user/myexports/sampleExport/sampleExport.overall_export_metadata.`z--export-on-exitzmDirectory path in which emulator data will be saved upon shutdown. Example:`/home/user/myexports/2024-03-26/`z
--licenseszQIf set, the emulator will print open-source dependencies and licenses, then exit.)r   r   r   )add_argument)parsers    r   Args
Start.ArgsC   s    
B  C K/	  
0 C  D +3  5 `  a
 ?  @
 	   r   c                    UR                   (       dD  [        R                  R                  [        R
                  " 5       [        R                  S9Ul         UR                   R                  =(       d    SUR                   l        UR                   R                  =(       d    SUR                   l	        UR                  =(       d    SUl
        [        R                  " U5        [        R                  " [        R                  SS9  [        R                  " U5       n[         R"                  " US5        S S S 5        g ! , (       d  f       g = f)Nr   	localhost8080zfirestore-native   )min_version	firestore)	host_portr   r   r   r   GetHostPortsockethas_ipv6hostportdatabase_modeValidateStartArgsr
   RequireJavaInstalledFIRESTORE_TITLEStartFirestoreEmulatorr	   PrefixOutput)selfargsprocs      r   Run	Start.Runu   s    >>"++11

$
$
&V__ 2 Fdn..--<DNN..--7DNN++A/AD$$T*n<<"M		.	.t	4
k* 
5	4	4s   D<<
E
 N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr#   r:   __static_attributes__r<   r   r   r   r      s2     -: /  / b
+r   r   )rA   
__future__r   r   r   r-   googlecloudsdk.callioper   r   $googlecloudsdk.command_lib.emulatorsr   r	   googlecloudsdk.command_lib.utilr
   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyCommandr   r<   r   r   <module>rP      s    / &  '  / ( ? 5 0 D%%++T->->-C-C%%((*_+DLL _+ *_+r   