11from __future__ import annotations
22
3+ import warnings
34from typing import TYPE_CHECKING , Any , Optional , Union
45from urllib .parse import urlencode
56
@@ -77,10 +78,20 @@ async def create(
7778 branch_name : str ,
7879 sync_with_git : bool = True ,
7980 description : str = "" ,
80- background_execution : bool = False ,
81+ wait_until_completion : bool = False ,
82+ background_execution : Optional [bool ] = False ,
8183 ) -> BranchData :
84+
85+ if background_execution is not None :
86+ warnings .warn (
87+ "`background_execution` is deprecated, please use `wait_until_completion` instead." ,
88+ DeprecationWarning ,
89+ stacklevel = 2
90+ )
91+
92+ wait_until_completion = background_execution or wait_until_completion
8293 input_data = {
83- "background_execution " : background_execution ,
94+ "wait_until_completion " : wait_until_completion ,
8495 "data" : {
8596 "name" : branch_name ,
8697 "description" : description ,
@@ -90,7 +101,8 @@ async def create(
90101
91102 query = Mutation (mutation = "BranchCreate" , input_data = input_data , query = MUTATION_QUERY_DATA )
92103 response = await self .client .execute_graphql (query = query .render (), tracker = "mutation-branch-create" )
93-
104+ if not wait_until_completion :
105+ return BranchData (** response ["BranchCreate" ]["task" ])
94106 return BranchData (** response ["BranchCreate" ]["object" ])
95107
96108 async def delete (self , branch_name : str ) -> bool :
0 commit comments