@@ -79,29 +79,23 @@ async def list_sandboxes_for_user(self, timezone: Optional[str] = None) -> Dict[
7979 "sandboxes" : await self ._request ("GET" , "/SandboxGetRunningInstancesForUser" , params = params ),
8080 }
8181
82- async def start_sandbox (self , usecase : str , cease_emails : Optional [ bool ] = None , draft_only : Optional [ bool ] = None , auth_token : Optional [ str ] = None ) -> Dict [str , Any ]:
82+ async def start_sandbox (self , usecase : str ) -> Dict [str , Any ]:
8383 """
8484 Creates and deploys a new sandbox instance or returns an existing one if duplicates are not allowed and one exists.
8585 Corresponds to POST /SandboxRunInstance in swagger.
8686
8787 Args:
88- usecase (str): The name of the use case for the sandbox.
89- cease_emails (Optional[bool]): If true, no emails will be sent regarding this sandbox. (default: false)
90- draft_only (Optional[bool]): If true, only a draft record is created, and the instance is not deployed. (default: false)
91- auth_token (Optional[str]): Optional authentication token for certain flows.
88+ usecase (str): The name of the use case for the sandbox. Possible values are:
89+ blank-sandbox,bloom,citations,contact-tracing,cybersecurity,entity-resolution,fincen,
90+ fraud-detection,graph-data-science,graph-data-science-blank-sandbox,healthcare-analytics,
91+ icij-offshoreleaks,icij-paradise-papers,legis-graph,movies,network-management,
92+ openstreetmap,pole,recommendations,twitch,twitter-trolls,wwc2019,yelp,twitter-v2
9293
9394 Returns:
9495 Dict[str, Any]: Sandbox instance details or draft confirmation.
9596 See #/components/schemas/RunInstanceResponse in swagger.
9697 """
97- json_data : Dict [str , Any ] = {"usecase" : usecase }
98- if cease_emails is not None :
99- json_data ["cease_emails" ] = cease_emails
100- if draft_only is not None :
101- json_data ["draft_only" ] = draft_only
102- if auth_token is not None :
103- json_data ["auth_token" ] = auth_token
104- return await self ._request ("POST" , "/SandboxRunInstance" , json_data = json_data )
98+ return await self ._request ("POST" , "/SandboxRunInstance" , json_data = {"usecase" : usecase })
10599
106100 async def stop_sandbox (self , sandbox_hash_key : str ) -> Optional [Dict [str , Any ]]:
107101 """
@@ -118,24 +112,21 @@ async def stop_sandbox(self, sandbox_hash_key: str) -> Optional[Dict[str, Any]]:
118112 json_data = {"sandboxHashKey" : sandbox_hash_key }
119113 return await self ._request ("POST" , "/SandboxStopInstance" , json_data = json_data )
120114
121- async def extend_sandbox (self , sandbox_hash_key : Optional [str ] = None , profile_data : Optional [ Dict [ str , Any ]] = None ) -> Dict [str , Any ]:
115+ async def extend_sandbox (self , sandbox_hash_key : Optional [str ] = None ) -> Dict [str , Any ]:
122116 """
123117 Extends the lifetime of a user's sandbox(es). User profile details can be submitted with this request.
124118 Corresponds to POST /SandboxExtend in swagger.
125119
126120 Args:
127121 sandbox_hash_key (Optional[str]): Specific sandbox to extend. If not provided, all user's sandboxes are extended.
128- profile_data (Optional[Dict[str, Any]]): User profile information to submit.
129- Expected keys can include 'email', 'company', 'country', 'industry', 'telephone', 'jobrole', 'whyneo4j'.
130- See #/components/schemas/ExtendRequest in swagger.
131122
132123 Returns:
133124 Dict[str, Any]: Sandbox lifetime extension status. See #/components/schemas/ExtendResponse.
134125 """
135- json_data = profile_data if profile_data is not None else {}
126+ json_data : Dict [ str , Any ] = {}
136127 if sandbox_hash_key :
137128 json_data ["sandboxHashKey" ] = sandbox_hash_key
138- return await self ._request ("POST" , "/SandboxExtend" , json_data = json_data if json_data else {} )
129+ return await self ._request ("POST" , "/SandboxExtend" , json_data = json_data )
139130
140131 async def get_sandbox_details (self , sandbox_hash_key : str , verify_connect : Optional [bool ] = False ) -> Dict [str , Any ]:
141132 """
@@ -155,26 +146,6 @@ async def get_sandbox_details(self, sandbox_hash_key: str, verify_connect: Optio
155146 params ["verifyConnect" ] = verify_connect
156147 return await self ._request ("GET" , "/SandboxAuthdGetInstanceByHashKey" , params = params )
157148
158- async def invite_collaborator (self , sandbox_hash_key : str , email : str , message : str ) -> Dict [str , Any ]:
159- """
160- Invites another user to share one of the authenticated user's sandboxes.
161- Corresponds to POST /SandboxShare in swagger.
162-
163- Args:
164- sandbox_hash_key (str): The unique hash key identifying the sandbox to share.
165- email (str): Email address of the user to invite.
166- message (str): A personal message to include in the invitation.
167-
168- Returns:
169- Dict[str, Any]: Invitation creation status. See #/components/schemas/ShareResponse.
170- """
171- json_data = {
172- "sandboxHashKey" : sandbox_hash_key ,
173- "email" : email ,
174- "message" : message
175- }
176- return await self ._request ("POST" , "/SandboxShare" , json_data = json_data )
177-
178149 async def request_backup (self , sandbox_hash_key : str ) -> Dict [str , Any ]:
179150 """
180151 Initiates a backup process for a specific sandbox.
@@ -272,22 +243,22 @@ async def get_aura_upload_result(self, result_id: str) -> Dict[str, Any]:
272243 endpoint = f"/SandboxAuraUpload/result/{ result_id } "
273244 return await self ._request ("GET" , endpoint )
274245
275- async def get_user_info (self ) -> Dict [str , Any ]:
276- """
277- Retrieves user information for the authenticated user.
278- Corresponds to GET /SandboxGetUserInfo in swagger.
279-
280- Returns:
281- Dict[str, Any]: User information. See #/components/schemas/UserInfoResponse.
282- """
283- return await self ._request ("GET" , "/SandboxGetUserInfo" )
284-
285246 async def get_schema (self , hash_key : str ) -> FastApiReadCypherQueryResponse :
286247 """
287248 Retrieves the schema of the Neo4j database.
288249 Corresponds to POST /SandboxQuery in swagger.
289250 """
290- return await self .read_query (hash_key , "call apoc.meta.data() yield label, property, type, other, unique, index, elementType where elementType = 'node' and not label starts with '_' with label, collect(case when type <> 'RELATIONSHIP' then [property, type + case when unique then ' unique' else '' end + case when index then ' indexed' else '' end] end) as attributes, collect(case when type = 'RELATIONSHIP' then [property, head(other)] end) as relationships return label, apoc.map.fromPairs(attributes) as attributes, apoc.map.fromPairs(relationships) as relationships" )
251+ schema_query = (
252+ "call apoc.meta.data() yield label, property, type, other, unique, index, elementType "
253+ "where elementType = 'node' and not label starts with '_' "
254+ "with label, collect(case when type <> 'RELATIONSHIP' "
255+ "then [property, type + case when unique then ' unique' else '' end + "
256+ "case when index then ' indexed' else '' end] end) as attributes, "
257+ "collect(case when type = 'RELATIONSHIP' then [property, head(other)] end) as relationships "
258+ "return label, apoc.map.fromPairs(attributes) as attributes, "
259+ "apoc.map.fromPairs(relationships) as relationships"
260+ )
261+ return await self .read_query (hash_key , schema_query )
291262
292263 async def read_query (self , hash_key : str , query : str , params : Optional [Dict [str , Any ]] = None ) -> FastApiReadCypherQueryResponse :
293264 """
0 commit comments