cogbox_toolbox_api_client 0.190.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. cogbox_toolbox_api_client/__init__.py +386 -0
  2. cogbox_toolbox_api_client/api/__init__.py +46 -0
  3. cogbox_toolbox_api_client/api/computer_use_api.py +9075 -0
  4. cogbox_toolbox_api_client/api/file_system_api.py +3583 -0
  5. cogbox_toolbox_api_client/api/git_api.py +2969 -0
  6. cogbox_toolbox_api_client/api/info_api.py +773 -0
  7. cogbox_toolbox_api_client/api/interpreter_api.py +1075 -0
  8. cogbox_toolbox_api_client/api/lsp_api.py +1971 -0
  9. cogbox_toolbox_api_client/api/port_api.py +543 -0
  10. cogbox_toolbox_api_client/api/process_api.py +4865 -0
  11. cogbox_toolbox_api_client/api/server_api.py +298 -0
  12. cogbox_toolbox_api_client/api_client.py +809 -0
  13. cogbox_toolbox_api_client/api_response.py +21 -0
  14. cogbox_toolbox_api_client/configuration.py +626 -0
  15. cogbox_toolbox_api_client/exceptions.py +218 -0
  16. cogbox_toolbox_api_client/models/__init__.py +224 -0
  17. cogbox_toolbox_api_client/models/accessibility_bounds.py +108 -0
  18. cogbox_toolbox_api_client/models/accessibility_invoke_request.py +104 -0
  19. cogbox_toolbox_api_client/models/accessibility_node_request.py +102 -0
  20. cogbox_toolbox_api_client/models/accessibility_nodes_response.py +112 -0
  21. cogbox_toolbox_api_client/models/accessibility_set_value_request.py +104 -0
  22. cogbox_toolbox_api_client/models/accessibility_tree_response.py +108 -0
  23. cogbox_toolbox_api_client/models/chart.py +132 -0
  24. cogbox_toolbox_api_client/models/chart_element.py +134 -0
  25. cogbox_toolbox_api_client/models/code_run_artifacts.py +110 -0
  26. cogbox_toolbox_api_client/models/code_run_request.py +110 -0
  27. cogbox_toolbox_api_client/models/code_run_response.py +110 -0
  28. cogbox_toolbox_api_client/models/command.py +106 -0
  29. cogbox_toolbox_api_client/models/completion_context.py +104 -0
  30. cogbox_toolbox_api_client/models/completion_item.py +114 -0
  31. cogbox_toolbox_api_client/models/completion_list.py +112 -0
  32. cogbox_toolbox_api_client/models/computer_use_accessibility_node.py +129 -0
  33. cogbox_toolbox_api_client/models/computer_use_start_response.py +117 -0
  34. cogbox_toolbox_api_client/models/computer_use_status_response.py +102 -0
  35. cogbox_toolbox_api_client/models/computer_use_stop_response.py +117 -0
  36. cogbox_toolbox_api_client/models/create_context_request.py +104 -0
  37. cogbox_toolbox_api_client/models/create_session_request.py +102 -0
  38. cogbox_toolbox_api_client/models/display_info.py +112 -0
  39. cogbox_toolbox_api_client/models/display_info_response.py +110 -0
  40. cogbox_toolbox_api_client/models/execute_request.py +108 -0
  41. cogbox_toolbox_api_client/models/execute_response.py +104 -0
  42. cogbox_toolbox_api_client/models/file_info.py +118 -0
  43. cogbox_toolbox_api_client/models/file_status.py +109 -0
  44. cogbox_toolbox_api_client/models/files_download_request.py +102 -0
  45. cogbox_toolbox_api_client/models/find_accessibility_nodes_request.py +114 -0
  46. cogbox_toolbox_api_client/models/git_add_request.py +104 -0
  47. cogbox_toolbox_api_client/models/git_branch_request.py +104 -0
  48. cogbox_toolbox_api_client/models/git_checkout_request.py +104 -0
  49. cogbox_toolbox_api_client/models/git_clone_request.py +114 -0
  50. cogbox_toolbox_api_client/models/git_commit_info.py +110 -0
  51. cogbox_toolbox_api_client/models/git_commit_request.py +110 -0
  52. cogbox_toolbox_api_client/models/git_commit_response.py +102 -0
  53. cogbox_toolbox_api_client/models/git_delete_branch_request.py +104 -0
  54. cogbox_toolbox_api_client/models/git_repo_request.py +106 -0
  55. cogbox_toolbox_api_client/models/git_status.py +118 -0
  56. cogbox_toolbox_api_client/models/initialize_request.py +102 -0
  57. cogbox_toolbox_api_client/models/interpreter_context.py +110 -0
  58. cogbox_toolbox_api_client/models/is_port_in_use_response.py +102 -0
  59. cogbox_toolbox_api_client/models/keyboard_hotkey_request.py +102 -0
  60. cogbox_toolbox_api_client/models/keyboard_press_request.py +104 -0
  61. cogbox_toolbox_api_client/models/keyboard_type_request.py +104 -0
  62. cogbox_toolbox_api_client/models/list_branch_response.py +102 -0
  63. cogbox_toolbox_api_client/models/list_contexts_response.py +110 -0
  64. cogbox_toolbox_api_client/models/list_recordings_response.py +110 -0
  65. cogbox_toolbox_api_client/models/lsp_completion_params.py +118 -0
  66. cogbox_toolbox_api_client/models/lsp_document_request.py +106 -0
  67. cogbox_toolbox_api_client/models/lsp_location.py +108 -0
  68. cogbox_toolbox_api_client/models/lsp_position.py +104 -0
  69. cogbox_toolbox_api_client/models/lsp_range.py +111 -0
  70. cogbox_toolbox_api_client/models/lsp_server_request.py +104 -0
  71. cogbox_toolbox_api_client/models/lsp_symbol.py +110 -0
  72. cogbox_toolbox_api_client/models/match.py +106 -0
  73. cogbox_toolbox_api_client/models/mouse_click_request.py +108 -0
  74. cogbox_toolbox_api_client/models/mouse_click_response.py +104 -0
  75. cogbox_toolbox_api_client/models/mouse_drag_request.py +110 -0
  76. cogbox_toolbox_api_client/models/mouse_drag_response.py +104 -0
  77. cogbox_toolbox_api_client/models/mouse_move_request.py +104 -0
  78. cogbox_toolbox_api_client/models/mouse_position_response.py +104 -0
  79. cogbox_toolbox_api_client/models/mouse_scroll_request.py +109 -0
  80. cogbox_toolbox_api_client/models/port_list.py +102 -0
  81. cogbox_toolbox_api_client/models/position.py +104 -0
  82. cogbox_toolbox_api_client/models/process_errors_response.py +104 -0
  83. cogbox_toolbox_api_client/models/process_logs_response.py +104 -0
  84. cogbox_toolbox_api_client/models/process_restart_response.py +104 -0
  85. cogbox_toolbox_api_client/models/process_status.py +108 -0
  86. cogbox_toolbox_api_client/models/process_status_response.py +104 -0
  87. cogbox_toolbox_api_client/models/pty_create_request.py +112 -0
  88. cogbox_toolbox_api_client/models/pty_create_response.py +102 -0
  89. cogbox_toolbox_api_client/models/pty_list_response.py +110 -0
  90. cogbox_toolbox_api_client/models/pty_resize_request.py +105 -0
  91. cogbox_toolbox_api_client/models/pty_session_info.py +116 -0
  92. cogbox_toolbox_api_client/models/recording.py +116 -0
  93. cogbox_toolbox_api_client/models/replace_request.py +106 -0
  94. cogbox_toolbox_api_client/models/replace_result.py +106 -0
  95. cogbox_toolbox_api_client/models/screenshot_response.py +110 -0
  96. cogbox_toolbox_api_client/models/scroll_response.py +102 -0
  97. cogbox_toolbox_api_client/models/search_files_response.py +102 -0
  98. cogbox_toolbox_api_client/models/session.py +112 -0
  99. cogbox_toolbox_api_client/models/session_command_logs_response.py +106 -0
  100. cogbox_toolbox_api_client/models/session_execute_request.py +108 -0
  101. cogbox_toolbox_api_client/models/session_execute_response.py +110 -0
  102. cogbox_toolbox_api_client/models/session_send_input_request.py +102 -0
  103. cogbox_toolbox_api_client/models/start_recording_request.py +102 -0
  104. cogbox_toolbox_api_client/models/status.py +48 -0
  105. cogbox_toolbox_api_client/models/stop_recording_request.py +102 -0
  106. cogbox_toolbox_api_client/models/user_home_dir_response.py +102 -0
  107. cogbox_toolbox_api_client/models/window_info.py +114 -0
  108. cogbox_toolbox_api_client/models/windows_response.py +110 -0
  109. cogbox_toolbox_api_client/models/work_dir_response.py +102 -0
  110. cogbox_toolbox_api_client/py.typed +0 -0
  111. cogbox_toolbox_api_client/rest.py +263 -0
  112. cogbox_toolbox_api_client-0.190.1.dist-info/METADATA +251 -0
  113. cogbox_toolbox_api_client-0.190.1.dist-info/RECORD +116 -0
  114. cogbox_toolbox_api_client-0.190.1.dist-info/WHEEL +5 -0
  115. cogbox_toolbox_api_client-0.190.1.dist-info/licenses/LICENSE +190 -0
  116. cogbox_toolbox_api_client-0.190.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2969 @@
1
+ """
2
+ Cogbox Toolbox API
3
+
4
+ Cogbox Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Cogbox API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Cogbox Cloud: `https://proxy.cogbox.pazity.com/toolbox/{sandboxId}`.
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictStr
19
+ from typing import List
20
+ from typing_extensions import Annotated
21
+ from cogbox_toolbox_api_client.models.git_add_request import GitAddRequest
22
+ from cogbox_toolbox_api_client.models.git_branch_request import GitBranchRequest
23
+ from cogbox_toolbox_api_client.models.git_checkout_request import GitCheckoutRequest
24
+ from cogbox_toolbox_api_client.models.git_clone_request import GitCloneRequest
25
+ from cogbox_toolbox_api_client.models.git_commit_info import GitCommitInfo
26
+ from cogbox_toolbox_api_client.models.git_commit_request import GitCommitRequest
27
+ from cogbox_toolbox_api_client.models.git_commit_response import GitCommitResponse
28
+ from cogbox_toolbox_api_client.models.git_delete_branch_request import GitDeleteBranchRequest
29
+ from cogbox_toolbox_api_client.models.git_repo_request import GitRepoRequest
30
+ from cogbox_toolbox_api_client.models.git_status import GitStatus
31
+ from cogbox_toolbox_api_client.models.list_branch_response import ListBranchResponse
32
+
33
+ from cogbox_toolbox_api_client.api_client import ApiClient, RequestSerialized
34
+ from cogbox_toolbox_api_client.api_response import ApiResponse
35
+ from cogbox_toolbox_api_client.rest import RESTResponseType
36
+
37
+
38
+ class GitApi:
39
+ """NOTE: This class is auto generated by OpenAPI Generator
40
+ Ref: https://openapi-generator.tech
41
+
42
+ Do not edit the class manually.
43
+ """
44
+
45
+ def __init__(self, api_client=None) -> None:
46
+ if api_client is None:
47
+ api_client = ApiClient.get_default()
48
+ self.api_client = api_client
49
+
50
+
51
+ @validate_call
52
+ def add_files(
53
+ self,
54
+ request: Annotated[GitAddRequest, Field(description="Add files request")],
55
+ _request_timeout: Union[
56
+ None,
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Tuple[
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Annotated[StrictFloat, Field(gt=0)]
61
+ ]
62
+ ] = None,
63
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
64
+ _content_type: Optional[StrictStr] = None,
65
+ _headers: Optional[Dict[StrictStr, Any]] = None,
66
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
67
+ ) -> None:
68
+ """Add files to Git staging
69
+
70
+ Add files to the Git staging area
71
+
72
+ :param request: Add files request (required)
73
+ :type request: GitAddRequest
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._add_files_serialize(
97
+ request=request,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index
102
+ )
103
+
104
+ _response_types_map: Dict[str, Optional[str]] = {
105
+ '200': None,
106
+ }
107
+ response_data = self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ def add_files_with_http_info(
120
+ self,
121
+ request: Annotated[GitAddRequest, Field(description="Add files request")],
122
+ _request_timeout: Union[
123
+ None,
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Tuple[
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Annotated[StrictFloat, Field(gt=0)]
128
+ ]
129
+ ] = None,
130
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
+ _content_type: Optional[StrictStr] = None,
132
+ _headers: Optional[Dict[StrictStr, Any]] = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[None]:
135
+ """Add files to Git staging
136
+
137
+ Add files to the Git staging area
138
+
139
+ :param request: Add files request (required)
140
+ :type request: GitAddRequest
141
+ :param _request_timeout: timeout setting for this request. If one
142
+ number provided, it will be total request
143
+ timeout. It can also be a pair (tuple) of
144
+ (connection, read) timeouts.
145
+ :type _request_timeout: int, tuple(int, int), optional
146
+ :param _request_auth: set to override the auth_settings for an a single
147
+ request; this effectively ignores the
148
+ authentication in the spec for a single request.
149
+ :type _request_auth: dict, optional
150
+ :param _content_type: force content-type for the request.
151
+ :type _content_type: str, Optional
152
+ :param _headers: set to override the headers for a single
153
+ request; this effectively ignores the headers
154
+ in the spec for a single request.
155
+ :type _headers: dict, optional
156
+ :param _host_index: set to override the host_index for a single
157
+ request; this effectively ignores the host_index
158
+ in the spec for a single request.
159
+ :type _host_index: int, optional
160
+ :return: Returns the result object.
161
+ """ # noqa: E501
162
+
163
+ _param = self._add_files_serialize(
164
+ request=request,
165
+ _request_auth=_request_auth,
166
+ _content_type=_content_type,
167
+ _headers=_headers,
168
+ _host_index=_host_index
169
+ )
170
+
171
+ _response_types_map: Dict[str, Optional[str]] = {
172
+ '200': None,
173
+ }
174
+ response_data = self.api_client.call_api(
175
+ *_param,
176
+ _request_timeout=_request_timeout
177
+ )
178
+ response_data.read()
179
+ return self.api_client.response_deserialize(
180
+ response_data=response_data,
181
+ response_types_map=_response_types_map,
182
+ )
183
+
184
+
185
+ @validate_call
186
+ def add_files_without_preload_content(
187
+ self,
188
+ request: Annotated[GitAddRequest, Field(description="Add files request")],
189
+ _request_timeout: Union[
190
+ None,
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Tuple[
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Annotated[StrictFloat, Field(gt=0)]
195
+ ]
196
+ ] = None,
197
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
198
+ _content_type: Optional[StrictStr] = None,
199
+ _headers: Optional[Dict[StrictStr, Any]] = None,
200
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
201
+ ) -> RESTResponseType:
202
+ """Add files to Git staging
203
+
204
+ Add files to the Git staging area
205
+
206
+ :param request: Add files request (required)
207
+ :type request: GitAddRequest
208
+ :param _request_timeout: timeout setting for this request. If one
209
+ number provided, it will be total request
210
+ timeout. It can also be a pair (tuple) of
211
+ (connection, read) timeouts.
212
+ :type _request_timeout: int, tuple(int, int), optional
213
+ :param _request_auth: set to override the auth_settings for an a single
214
+ request; this effectively ignores the
215
+ authentication in the spec for a single request.
216
+ :type _request_auth: dict, optional
217
+ :param _content_type: force content-type for the request.
218
+ :type _content_type: str, Optional
219
+ :param _headers: set to override the headers for a single
220
+ request; this effectively ignores the headers
221
+ in the spec for a single request.
222
+ :type _headers: dict, optional
223
+ :param _host_index: set to override the host_index for a single
224
+ request; this effectively ignores the host_index
225
+ in the spec for a single request.
226
+ :type _host_index: int, optional
227
+ :return: Returns the result object.
228
+ """ # noqa: E501
229
+
230
+ _param = self._add_files_serialize(
231
+ request=request,
232
+ _request_auth=_request_auth,
233
+ _content_type=_content_type,
234
+ _headers=_headers,
235
+ _host_index=_host_index
236
+ )
237
+
238
+ _response_types_map: Dict[str, Optional[str]] = {
239
+ '200': None,
240
+ }
241
+ response_data = self.api_client.call_api(
242
+ *_param,
243
+ _request_timeout=_request_timeout
244
+ )
245
+ return response_data.response
246
+
247
+
248
+ def _add_files_serialize(
249
+ self,
250
+ request,
251
+ _request_auth,
252
+ _content_type,
253
+ _headers,
254
+ _host_index,
255
+ ) -> RequestSerialized:
256
+
257
+ _host = None
258
+
259
+ _collection_formats: Dict[str, str] = {
260
+ }
261
+
262
+ _path_params: Dict[str, str] = {}
263
+ _query_params: List[Tuple[str, str]] = []
264
+ _header_params: Dict[str, Optional[str]] = _headers or {}
265
+ _form_params: List[Tuple[str, str]] = []
266
+ _files: Dict[
267
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
268
+ ] = {}
269
+ _body_params: Optional[bytes] = None
270
+
271
+ # process the path parameters
272
+ # process the query parameters
273
+ # process the header parameters
274
+ # process the form parameters
275
+ # process the body parameter
276
+ if request is not None:
277
+ _body_params = request
278
+
279
+
280
+
281
+ # set the HTTP header `Content-Type`
282
+ if _content_type:
283
+ _header_params['Content-Type'] = _content_type
284
+ else:
285
+ _default_content_type = (
286
+ self.api_client.select_header_content_type(
287
+ [
288
+ 'application/json'
289
+ ]
290
+ )
291
+ )
292
+ if _default_content_type is not None:
293
+ _header_params['Content-Type'] = _default_content_type
294
+
295
+ # authentication setting
296
+ _auth_settings: List[str] = [
297
+ ]
298
+
299
+ return self.api_client.param_serialize(
300
+ method='POST',
301
+ resource_path='/git/add',
302
+ path_params=_path_params,
303
+ query_params=_query_params,
304
+ header_params=_header_params,
305
+ body=_body_params,
306
+ post_params=_form_params,
307
+ files=_files,
308
+ auth_settings=_auth_settings,
309
+ collection_formats=_collection_formats,
310
+ _host=_host,
311
+ _request_auth=_request_auth
312
+ )
313
+
314
+
315
+
316
+
317
+ @validate_call
318
+ def checkout_branch(
319
+ self,
320
+ request: Annotated[GitCheckoutRequest, Field(description="Checkout request")],
321
+ _request_timeout: Union[
322
+ None,
323
+ Annotated[StrictFloat, Field(gt=0)],
324
+ Tuple[
325
+ Annotated[StrictFloat, Field(gt=0)],
326
+ Annotated[StrictFloat, Field(gt=0)]
327
+ ]
328
+ ] = None,
329
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
330
+ _content_type: Optional[StrictStr] = None,
331
+ _headers: Optional[Dict[StrictStr, Any]] = None,
332
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
333
+ ) -> None:
334
+ """Checkout branch or commit
335
+
336
+ Switch to a different branch or commit in the Git repository
337
+
338
+ :param request: Checkout request (required)
339
+ :type request: GitCheckoutRequest
340
+ :param _request_timeout: timeout setting for this request. If one
341
+ number provided, it will be total request
342
+ timeout. It can also be a pair (tuple) of
343
+ (connection, read) timeouts.
344
+ :type _request_timeout: int, tuple(int, int), optional
345
+ :param _request_auth: set to override the auth_settings for an a single
346
+ request; this effectively ignores the
347
+ authentication in the spec for a single request.
348
+ :type _request_auth: dict, optional
349
+ :param _content_type: force content-type for the request.
350
+ :type _content_type: str, Optional
351
+ :param _headers: set to override the headers for a single
352
+ request; this effectively ignores the headers
353
+ in the spec for a single request.
354
+ :type _headers: dict, optional
355
+ :param _host_index: set to override the host_index for a single
356
+ request; this effectively ignores the host_index
357
+ in the spec for a single request.
358
+ :type _host_index: int, optional
359
+ :return: Returns the result object.
360
+ """ # noqa: E501
361
+
362
+ _param = self._checkout_branch_serialize(
363
+ request=request,
364
+ _request_auth=_request_auth,
365
+ _content_type=_content_type,
366
+ _headers=_headers,
367
+ _host_index=_host_index
368
+ )
369
+
370
+ _response_types_map: Dict[str, Optional[str]] = {
371
+ '200': None,
372
+ }
373
+ response_data = self.api_client.call_api(
374
+ *_param,
375
+ _request_timeout=_request_timeout
376
+ )
377
+ response_data.read()
378
+ return self.api_client.response_deserialize(
379
+ response_data=response_data,
380
+ response_types_map=_response_types_map,
381
+ ).data
382
+
383
+
384
+ @validate_call
385
+ def checkout_branch_with_http_info(
386
+ self,
387
+ request: Annotated[GitCheckoutRequest, Field(description="Checkout request")],
388
+ _request_timeout: Union[
389
+ None,
390
+ Annotated[StrictFloat, Field(gt=0)],
391
+ Tuple[
392
+ Annotated[StrictFloat, Field(gt=0)],
393
+ Annotated[StrictFloat, Field(gt=0)]
394
+ ]
395
+ ] = None,
396
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
397
+ _content_type: Optional[StrictStr] = None,
398
+ _headers: Optional[Dict[StrictStr, Any]] = None,
399
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
400
+ ) -> ApiResponse[None]:
401
+ """Checkout branch or commit
402
+
403
+ Switch to a different branch or commit in the Git repository
404
+
405
+ :param request: Checkout request (required)
406
+ :type request: GitCheckoutRequest
407
+ :param _request_timeout: timeout setting for this request. If one
408
+ number provided, it will be total request
409
+ timeout. It can also be a pair (tuple) of
410
+ (connection, read) timeouts.
411
+ :type _request_timeout: int, tuple(int, int), optional
412
+ :param _request_auth: set to override the auth_settings for an a single
413
+ request; this effectively ignores the
414
+ authentication in the spec for a single request.
415
+ :type _request_auth: dict, optional
416
+ :param _content_type: force content-type for the request.
417
+ :type _content_type: str, Optional
418
+ :param _headers: set to override the headers for a single
419
+ request; this effectively ignores the headers
420
+ in the spec for a single request.
421
+ :type _headers: dict, optional
422
+ :param _host_index: set to override the host_index for a single
423
+ request; this effectively ignores the host_index
424
+ in the spec for a single request.
425
+ :type _host_index: int, optional
426
+ :return: Returns the result object.
427
+ """ # noqa: E501
428
+
429
+ _param = self._checkout_branch_serialize(
430
+ request=request,
431
+ _request_auth=_request_auth,
432
+ _content_type=_content_type,
433
+ _headers=_headers,
434
+ _host_index=_host_index
435
+ )
436
+
437
+ _response_types_map: Dict[str, Optional[str]] = {
438
+ '200': None,
439
+ }
440
+ response_data = self.api_client.call_api(
441
+ *_param,
442
+ _request_timeout=_request_timeout
443
+ )
444
+ response_data.read()
445
+ return self.api_client.response_deserialize(
446
+ response_data=response_data,
447
+ response_types_map=_response_types_map,
448
+ )
449
+
450
+
451
+ @validate_call
452
+ def checkout_branch_without_preload_content(
453
+ self,
454
+ request: Annotated[GitCheckoutRequest, Field(description="Checkout request")],
455
+ _request_timeout: Union[
456
+ None,
457
+ Annotated[StrictFloat, Field(gt=0)],
458
+ Tuple[
459
+ Annotated[StrictFloat, Field(gt=0)],
460
+ Annotated[StrictFloat, Field(gt=0)]
461
+ ]
462
+ ] = None,
463
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
464
+ _content_type: Optional[StrictStr] = None,
465
+ _headers: Optional[Dict[StrictStr, Any]] = None,
466
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
467
+ ) -> RESTResponseType:
468
+ """Checkout branch or commit
469
+
470
+ Switch to a different branch or commit in the Git repository
471
+
472
+ :param request: Checkout request (required)
473
+ :type request: GitCheckoutRequest
474
+ :param _request_timeout: timeout setting for this request. If one
475
+ number provided, it will be total request
476
+ timeout. It can also be a pair (tuple) of
477
+ (connection, read) timeouts.
478
+ :type _request_timeout: int, tuple(int, int), optional
479
+ :param _request_auth: set to override the auth_settings for an a single
480
+ request; this effectively ignores the
481
+ authentication in the spec for a single request.
482
+ :type _request_auth: dict, optional
483
+ :param _content_type: force content-type for the request.
484
+ :type _content_type: str, Optional
485
+ :param _headers: set to override the headers for a single
486
+ request; this effectively ignores the headers
487
+ in the spec for a single request.
488
+ :type _headers: dict, optional
489
+ :param _host_index: set to override the host_index for a single
490
+ request; this effectively ignores the host_index
491
+ in the spec for a single request.
492
+ :type _host_index: int, optional
493
+ :return: Returns the result object.
494
+ """ # noqa: E501
495
+
496
+ _param = self._checkout_branch_serialize(
497
+ request=request,
498
+ _request_auth=_request_auth,
499
+ _content_type=_content_type,
500
+ _headers=_headers,
501
+ _host_index=_host_index
502
+ )
503
+
504
+ _response_types_map: Dict[str, Optional[str]] = {
505
+ '200': None,
506
+ }
507
+ response_data = self.api_client.call_api(
508
+ *_param,
509
+ _request_timeout=_request_timeout
510
+ )
511
+ return response_data.response
512
+
513
+
514
+ def _checkout_branch_serialize(
515
+ self,
516
+ request,
517
+ _request_auth,
518
+ _content_type,
519
+ _headers,
520
+ _host_index,
521
+ ) -> RequestSerialized:
522
+
523
+ _host = None
524
+
525
+ _collection_formats: Dict[str, str] = {
526
+ }
527
+
528
+ _path_params: Dict[str, str] = {}
529
+ _query_params: List[Tuple[str, str]] = []
530
+ _header_params: Dict[str, Optional[str]] = _headers or {}
531
+ _form_params: List[Tuple[str, str]] = []
532
+ _files: Dict[
533
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
534
+ ] = {}
535
+ _body_params: Optional[bytes] = None
536
+
537
+ # process the path parameters
538
+ # process the query parameters
539
+ # process the header parameters
540
+ # process the form parameters
541
+ # process the body parameter
542
+ if request is not None:
543
+ _body_params = request
544
+
545
+
546
+
547
+ # set the HTTP header `Content-Type`
548
+ if _content_type:
549
+ _header_params['Content-Type'] = _content_type
550
+ else:
551
+ _default_content_type = (
552
+ self.api_client.select_header_content_type(
553
+ [
554
+ 'application/json'
555
+ ]
556
+ )
557
+ )
558
+ if _default_content_type is not None:
559
+ _header_params['Content-Type'] = _default_content_type
560
+
561
+ # authentication setting
562
+ _auth_settings: List[str] = [
563
+ ]
564
+
565
+ return self.api_client.param_serialize(
566
+ method='POST',
567
+ resource_path='/git/checkout',
568
+ path_params=_path_params,
569
+ query_params=_query_params,
570
+ header_params=_header_params,
571
+ body=_body_params,
572
+ post_params=_form_params,
573
+ files=_files,
574
+ auth_settings=_auth_settings,
575
+ collection_formats=_collection_formats,
576
+ _host=_host,
577
+ _request_auth=_request_auth
578
+ )
579
+
580
+
581
+
582
+
583
+ @validate_call
584
+ def clone_repository(
585
+ self,
586
+ request: Annotated[GitCloneRequest, Field(description="Clone repository request")],
587
+ _request_timeout: Union[
588
+ None,
589
+ Annotated[StrictFloat, Field(gt=0)],
590
+ Tuple[
591
+ Annotated[StrictFloat, Field(gt=0)],
592
+ Annotated[StrictFloat, Field(gt=0)]
593
+ ]
594
+ ] = None,
595
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
596
+ _content_type: Optional[StrictStr] = None,
597
+ _headers: Optional[Dict[StrictStr, Any]] = None,
598
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
599
+ ) -> None:
600
+ """Clone a Git repository
601
+
602
+ Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.
603
+
604
+ :param request: Clone repository request (required)
605
+ :type request: GitCloneRequest
606
+ :param _request_timeout: timeout setting for this request. If one
607
+ number provided, it will be total request
608
+ timeout. It can also be a pair (tuple) of
609
+ (connection, read) timeouts.
610
+ :type _request_timeout: int, tuple(int, int), optional
611
+ :param _request_auth: set to override the auth_settings for an a single
612
+ request; this effectively ignores the
613
+ authentication in the spec for a single request.
614
+ :type _request_auth: dict, optional
615
+ :param _content_type: force content-type for the request.
616
+ :type _content_type: str, Optional
617
+ :param _headers: set to override the headers for a single
618
+ request; this effectively ignores the headers
619
+ in the spec for a single request.
620
+ :type _headers: dict, optional
621
+ :param _host_index: set to override the host_index for a single
622
+ request; this effectively ignores the host_index
623
+ in the spec for a single request.
624
+ :type _host_index: int, optional
625
+ :return: Returns the result object.
626
+ """ # noqa: E501
627
+
628
+ _param = self._clone_repository_serialize(
629
+ request=request,
630
+ _request_auth=_request_auth,
631
+ _content_type=_content_type,
632
+ _headers=_headers,
633
+ _host_index=_host_index
634
+ )
635
+
636
+ _response_types_map: Dict[str, Optional[str]] = {
637
+ '200': None,
638
+ }
639
+ response_data = self.api_client.call_api(
640
+ *_param,
641
+ _request_timeout=_request_timeout
642
+ )
643
+ response_data.read()
644
+ return self.api_client.response_deserialize(
645
+ response_data=response_data,
646
+ response_types_map=_response_types_map,
647
+ ).data
648
+
649
+
650
+ @validate_call
651
+ def clone_repository_with_http_info(
652
+ self,
653
+ request: Annotated[GitCloneRequest, Field(description="Clone repository request")],
654
+ _request_timeout: Union[
655
+ None,
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Tuple[
658
+ Annotated[StrictFloat, Field(gt=0)],
659
+ Annotated[StrictFloat, Field(gt=0)]
660
+ ]
661
+ ] = None,
662
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
663
+ _content_type: Optional[StrictStr] = None,
664
+ _headers: Optional[Dict[StrictStr, Any]] = None,
665
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
666
+ ) -> ApiResponse[None]:
667
+ """Clone a Git repository
668
+
669
+ Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.
670
+
671
+ :param request: Clone repository request (required)
672
+ :type request: GitCloneRequest
673
+ :param _request_timeout: timeout setting for this request. If one
674
+ number provided, it will be total request
675
+ timeout. It can also be a pair (tuple) of
676
+ (connection, read) timeouts.
677
+ :type _request_timeout: int, tuple(int, int), optional
678
+ :param _request_auth: set to override the auth_settings for an a single
679
+ request; this effectively ignores the
680
+ authentication in the spec for a single request.
681
+ :type _request_auth: dict, optional
682
+ :param _content_type: force content-type for the request.
683
+ :type _content_type: str, Optional
684
+ :param _headers: set to override the headers for a single
685
+ request; this effectively ignores the headers
686
+ in the spec for a single request.
687
+ :type _headers: dict, optional
688
+ :param _host_index: set to override the host_index for a single
689
+ request; this effectively ignores the host_index
690
+ in the spec for a single request.
691
+ :type _host_index: int, optional
692
+ :return: Returns the result object.
693
+ """ # noqa: E501
694
+
695
+ _param = self._clone_repository_serialize(
696
+ request=request,
697
+ _request_auth=_request_auth,
698
+ _content_type=_content_type,
699
+ _headers=_headers,
700
+ _host_index=_host_index
701
+ )
702
+
703
+ _response_types_map: Dict[str, Optional[str]] = {
704
+ '200': None,
705
+ }
706
+ response_data = self.api_client.call_api(
707
+ *_param,
708
+ _request_timeout=_request_timeout
709
+ )
710
+ response_data.read()
711
+ return self.api_client.response_deserialize(
712
+ response_data=response_data,
713
+ response_types_map=_response_types_map,
714
+ )
715
+
716
+
717
+ @validate_call
718
+ def clone_repository_without_preload_content(
719
+ self,
720
+ request: Annotated[GitCloneRequest, Field(description="Clone repository request")],
721
+ _request_timeout: Union[
722
+ None,
723
+ Annotated[StrictFloat, Field(gt=0)],
724
+ Tuple[
725
+ Annotated[StrictFloat, Field(gt=0)],
726
+ Annotated[StrictFloat, Field(gt=0)]
727
+ ]
728
+ ] = None,
729
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
730
+ _content_type: Optional[StrictStr] = None,
731
+ _headers: Optional[Dict[StrictStr, Any]] = None,
732
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
733
+ ) -> RESTResponseType:
734
+ """Clone a Git repository
735
+
736
+ Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.
737
+
738
+ :param request: Clone repository request (required)
739
+ :type request: GitCloneRequest
740
+ :param _request_timeout: timeout setting for this request. If one
741
+ number provided, it will be total request
742
+ timeout. It can also be a pair (tuple) of
743
+ (connection, read) timeouts.
744
+ :type _request_timeout: int, tuple(int, int), optional
745
+ :param _request_auth: set to override the auth_settings for an a single
746
+ request; this effectively ignores the
747
+ authentication in the spec for a single request.
748
+ :type _request_auth: dict, optional
749
+ :param _content_type: force content-type for the request.
750
+ :type _content_type: str, Optional
751
+ :param _headers: set to override the headers for a single
752
+ request; this effectively ignores the headers
753
+ in the spec for a single request.
754
+ :type _headers: dict, optional
755
+ :param _host_index: set to override the host_index for a single
756
+ request; this effectively ignores the host_index
757
+ in the spec for a single request.
758
+ :type _host_index: int, optional
759
+ :return: Returns the result object.
760
+ """ # noqa: E501
761
+
762
+ _param = self._clone_repository_serialize(
763
+ request=request,
764
+ _request_auth=_request_auth,
765
+ _content_type=_content_type,
766
+ _headers=_headers,
767
+ _host_index=_host_index
768
+ )
769
+
770
+ _response_types_map: Dict[str, Optional[str]] = {
771
+ '200': None,
772
+ }
773
+ response_data = self.api_client.call_api(
774
+ *_param,
775
+ _request_timeout=_request_timeout
776
+ )
777
+ return response_data.response
778
+
779
+
780
+ def _clone_repository_serialize(
781
+ self,
782
+ request,
783
+ _request_auth,
784
+ _content_type,
785
+ _headers,
786
+ _host_index,
787
+ ) -> RequestSerialized:
788
+
789
+ _host = None
790
+
791
+ _collection_formats: Dict[str, str] = {
792
+ }
793
+
794
+ _path_params: Dict[str, str] = {}
795
+ _query_params: List[Tuple[str, str]] = []
796
+ _header_params: Dict[str, Optional[str]] = _headers or {}
797
+ _form_params: List[Tuple[str, str]] = []
798
+ _files: Dict[
799
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
800
+ ] = {}
801
+ _body_params: Optional[bytes] = None
802
+
803
+ # process the path parameters
804
+ # process the query parameters
805
+ # process the header parameters
806
+ # process the form parameters
807
+ # process the body parameter
808
+ if request is not None:
809
+ _body_params = request
810
+
811
+
812
+
813
+ # set the HTTP header `Content-Type`
814
+ if _content_type:
815
+ _header_params['Content-Type'] = _content_type
816
+ else:
817
+ _default_content_type = (
818
+ self.api_client.select_header_content_type(
819
+ [
820
+ 'application/json'
821
+ ]
822
+ )
823
+ )
824
+ if _default_content_type is not None:
825
+ _header_params['Content-Type'] = _default_content_type
826
+
827
+ # authentication setting
828
+ _auth_settings: List[str] = [
829
+ ]
830
+
831
+ return self.api_client.param_serialize(
832
+ method='POST',
833
+ resource_path='/git/clone',
834
+ path_params=_path_params,
835
+ query_params=_query_params,
836
+ header_params=_header_params,
837
+ body=_body_params,
838
+ post_params=_form_params,
839
+ files=_files,
840
+ auth_settings=_auth_settings,
841
+ collection_formats=_collection_formats,
842
+ _host=_host,
843
+ _request_auth=_request_auth
844
+ )
845
+
846
+
847
+
848
+
849
+ @validate_call
850
+ def commit_changes(
851
+ self,
852
+ request: Annotated[GitCommitRequest, Field(description="Commit request")],
853
+ _request_timeout: Union[
854
+ None,
855
+ Annotated[StrictFloat, Field(gt=0)],
856
+ Tuple[
857
+ Annotated[StrictFloat, Field(gt=0)],
858
+ Annotated[StrictFloat, Field(gt=0)]
859
+ ]
860
+ ] = None,
861
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
862
+ _content_type: Optional[StrictStr] = None,
863
+ _headers: Optional[Dict[StrictStr, Any]] = None,
864
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
865
+ ) -> GitCommitResponse:
866
+ """Commit changes
867
+
868
+ Commit staged changes to the Git repository
869
+
870
+ :param request: Commit request (required)
871
+ :type request: GitCommitRequest
872
+ :param _request_timeout: timeout setting for this request. If one
873
+ number provided, it will be total request
874
+ timeout. It can also be a pair (tuple) of
875
+ (connection, read) timeouts.
876
+ :type _request_timeout: int, tuple(int, int), optional
877
+ :param _request_auth: set to override the auth_settings for an a single
878
+ request; this effectively ignores the
879
+ authentication in the spec for a single request.
880
+ :type _request_auth: dict, optional
881
+ :param _content_type: force content-type for the request.
882
+ :type _content_type: str, Optional
883
+ :param _headers: set to override the headers for a single
884
+ request; this effectively ignores the headers
885
+ in the spec for a single request.
886
+ :type _headers: dict, optional
887
+ :param _host_index: set to override the host_index for a single
888
+ request; this effectively ignores the host_index
889
+ in the spec for a single request.
890
+ :type _host_index: int, optional
891
+ :return: Returns the result object.
892
+ """ # noqa: E501
893
+
894
+ _param = self._commit_changes_serialize(
895
+ request=request,
896
+ _request_auth=_request_auth,
897
+ _content_type=_content_type,
898
+ _headers=_headers,
899
+ _host_index=_host_index
900
+ )
901
+
902
+ _response_types_map: Dict[str, Optional[str]] = {
903
+ '200': "GitCommitResponse",
904
+ }
905
+ response_data = self.api_client.call_api(
906
+ *_param,
907
+ _request_timeout=_request_timeout
908
+ )
909
+ response_data.read()
910
+ return self.api_client.response_deserialize(
911
+ response_data=response_data,
912
+ response_types_map=_response_types_map,
913
+ ).data
914
+
915
+
916
+ @validate_call
917
+ def commit_changes_with_http_info(
918
+ self,
919
+ request: Annotated[GitCommitRequest, Field(description="Commit request")],
920
+ _request_timeout: Union[
921
+ None,
922
+ Annotated[StrictFloat, Field(gt=0)],
923
+ Tuple[
924
+ Annotated[StrictFloat, Field(gt=0)],
925
+ Annotated[StrictFloat, Field(gt=0)]
926
+ ]
927
+ ] = None,
928
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
929
+ _content_type: Optional[StrictStr] = None,
930
+ _headers: Optional[Dict[StrictStr, Any]] = None,
931
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
932
+ ) -> ApiResponse[GitCommitResponse]:
933
+ """Commit changes
934
+
935
+ Commit staged changes to the Git repository
936
+
937
+ :param request: Commit request (required)
938
+ :type request: GitCommitRequest
939
+ :param _request_timeout: timeout setting for this request. If one
940
+ number provided, it will be total request
941
+ timeout. It can also be a pair (tuple) of
942
+ (connection, read) timeouts.
943
+ :type _request_timeout: int, tuple(int, int), optional
944
+ :param _request_auth: set to override the auth_settings for an a single
945
+ request; this effectively ignores the
946
+ authentication in the spec for a single request.
947
+ :type _request_auth: dict, optional
948
+ :param _content_type: force content-type for the request.
949
+ :type _content_type: str, Optional
950
+ :param _headers: set to override the headers for a single
951
+ request; this effectively ignores the headers
952
+ in the spec for a single request.
953
+ :type _headers: dict, optional
954
+ :param _host_index: set to override the host_index for a single
955
+ request; this effectively ignores the host_index
956
+ in the spec for a single request.
957
+ :type _host_index: int, optional
958
+ :return: Returns the result object.
959
+ """ # noqa: E501
960
+
961
+ _param = self._commit_changes_serialize(
962
+ request=request,
963
+ _request_auth=_request_auth,
964
+ _content_type=_content_type,
965
+ _headers=_headers,
966
+ _host_index=_host_index
967
+ )
968
+
969
+ _response_types_map: Dict[str, Optional[str]] = {
970
+ '200': "GitCommitResponse",
971
+ }
972
+ response_data = self.api_client.call_api(
973
+ *_param,
974
+ _request_timeout=_request_timeout
975
+ )
976
+ response_data.read()
977
+ return self.api_client.response_deserialize(
978
+ response_data=response_data,
979
+ response_types_map=_response_types_map,
980
+ )
981
+
982
+
983
+ @validate_call
984
+ def commit_changes_without_preload_content(
985
+ self,
986
+ request: Annotated[GitCommitRequest, Field(description="Commit request")],
987
+ _request_timeout: Union[
988
+ None,
989
+ Annotated[StrictFloat, Field(gt=0)],
990
+ Tuple[
991
+ Annotated[StrictFloat, Field(gt=0)],
992
+ Annotated[StrictFloat, Field(gt=0)]
993
+ ]
994
+ ] = None,
995
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
996
+ _content_type: Optional[StrictStr] = None,
997
+ _headers: Optional[Dict[StrictStr, Any]] = None,
998
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
999
+ ) -> RESTResponseType:
1000
+ """Commit changes
1001
+
1002
+ Commit staged changes to the Git repository
1003
+
1004
+ :param request: Commit request (required)
1005
+ :type request: GitCommitRequest
1006
+ :param _request_timeout: timeout setting for this request. If one
1007
+ number provided, it will be total request
1008
+ timeout. It can also be a pair (tuple) of
1009
+ (connection, read) timeouts.
1010
+ :type _request_timeout: int, tuple(int, int), optional
1011
+ :param _request_auth: set to override the auth_settings for an a single
1012
+ request; this effectively ignores the
1013
+ authentication in the spec for a single request.
1014
+ :type _request_auth: dict, optional
1015
+ :param _content_type: force content-type for the request.
1016
+ :type _content_type: str, Optional
1017
+ :param _headers: set to override the headers for a single
1018
+ request; this effectively ignores the headers
1019
+ in the spec for a single request.
1020
+ :type _headers: dict, optional
1021
+ :param _host_index: set to override the host_index for a single
1022
+ request; this effectively ignores the host_index
1023
+ in the spec for a single request.
1024
+ :type _host_index: int, optional
1025
+ :return: Returns the result object.
1026
+ """ # noqa: E501
1027
+
1028
+ _param = self._commit_changes_serialize(
1029
+ request=request,
1030
+ _request_auth=_request_auth,
1031
+ _content_type=_content_type,
1032
+ _headers=_headers,
1033
+ _host_index=_host_index
1034
+ )
1035
+
1036
+ _response_types_map: Dict[str, Optional[str]] = {
1037
+ '200': "GitCommitResponse",
1038
+ }
1039
+ response_data = self.api_client.call_api(
1040
+ *_param,
1041
+ _request_timeout=_request_timeout
1042
+ )
1043
+ return response_data.response
1044
+
1045
+
1046
+ def _commit_changes_serialize(
1047
+ self,
1048
+ request,
1049
+ _request_auth,
1050
+ _content_type,
1051
+ _headers,
1052
+ _host_index,
1053
+ ) -> RequestSerialized:
1054
+
1055
+ _host = None
1056
+
1057
+ _collection_formats: Dict[str, str] = {
1058
+ }
1059
+
1060
+ _path_params: Dict[str, str] = {}
1061
+ _query_params: List[Tuple[str, str]] = []
1062
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1063
+ _form_params: List[Tuple[str, str]] = []
1064
+ _files: Dict[
1065
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1066
+ ] = {}
1067
+ _body_params: Optional[bytes] = None
1068
+
1069
+ # process the path parameters
1070
+ # process the query parameters
1071
+ # process the header parameters
1072
+ # process the form parameters
1073
+ # process the body parameter
1074
+ if request is not None:
1075
+ _body_params = request
1076
+
1077
+
1078
+ # set the HTTP header `Accept`
1079
+ if 'Accept' not in _header_params:
1080
+ _header_params['Accept'] = self.api_client.select_header_accept(
1081
+ [
1082
+ 'application/json'
1083
+ ]
1084
+ )
1085
+
1086
+ # set the HTTP header `Content-Type`
1087
+ if _content_type:
1088
+ _header_params['Content-Type'] = _content_type
1089
+ else:
1090
+ _default_content_type = (
1091
+ self.api_client.select_header_content_type(
1092
+ [
1093
+ 'application/json'
1094
+ ]
1095
+ )
1096
+ )
1097
+ if _default_content_type is not None:
1098
+ _header_params['Content-Type'] = _default_content_type
1099
+
1100
+ # authentication setting
1101
+ _auth_settings: List[str] = [
1102
+ ]
1103
+
1104
+ return self.api_client.param_serialize(
1105
+ method='POST',
1106
+ resource_path='/git/commit',
1107
+ path_params=_path_params,
1108
+ query_params=_query_params,
1109
+ header_params=_header_params,
1110
+ body=_body_params,
1111
+ post_params=_form_params,
1112
+ files=_files,
1113
+ auth_settings=_auth_settings,
1114
+ collection_formats=_collection_formats,
1115
+ _host=_host,
1116
+ _request_auth=_request_auth
1117
+ )
1118
+
1119
+
1120
+
1121
+
1122
+ @validate_call
1123
+ def create_branch(
1124
+ self,
1125
+ request: Annotated[GitBranchRequest, Field(description="Create branch request")],
1126
+ _request_timeout: Union[
1127
+ None,
1128
+ Annotated[StrictFloat, Field(gt=0)],
1129
+ Tuple[
1130
+ Annotated[StrictFloat, Field(gt=0)],
1131
+ Annotated[StrictFloat, Field(gt=0)]
1132
+ ]
1133
+ ] = None,
1134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1135
+ _content_type: Optional[StrictStr] = None,
1136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1138
+ ) -> None:
1139
+ """Create a new branch
1140
+
1141
+ Create a new branch in the Git repository
1142
+
1143
+ :param request: Create branch request (required)
1144
+ :type request: GitBranchRequest
1145
+ :param _request_timeout: timeout setting for this request. If one
1146
+ number provided, it will be total request
1147
+ timeout. It can also be a pair (tuple) of
1148
+ (connection, read) timeouts.
1149
+ :type _request_timeout: int, tuple(int, int), optional
1150
+ :param _request_auth: set to override the auth_settings for an a single
1151
+ request; this effectively ignores the
1152
+ authentication in the spec for a single request.
1153
+ :type _request_auth: dict, optional
1154
+ :param _content_type: force content-type for the request.
1155
+ :type _content_type: str, Optional
1156
+ :param _headers: set to override the headers for a single
1157
+ request; this effectively ignores the headers
1158
+ in the spec for a single request.
1159
+ :type _headers: dict, optional
1160
+ :param _host_index: set to override the host_index for a single
1161
+ request; this effectively ignores the host_index
1162
+ in the spec for a single request.
1163
+ :type _host_index: int, optional
1164
+ :return: Returns the result object.
1165
+ """ # noqa: E501
1166
+
1167
+ _param = self._create_branch_serialize(
1168
+ request=request,
1169
+ _request_auth=_request_auth,
1170
+ _content_type=_content_type,
1171
+ _headers=_headers,
1172
+ _host_index=_host_index
1173
+ )
1174
+
1175
+ _response_types_map: Dict[str, Optional[str]] = {
1176
+ '201': None,
1177
+ }
1178
+ response_data = self.api_client.call_api(
1179
+ *_param,
1180
+ _request_timeout=_request_timeout
1181
+ )
1182
+ response_data.read()
1183
+ return self.api_client.response_deserialize(
1184
+ response_data=response_data,
1185
+ response_types_map=_response_types_map,
1186
+ ).data
1187
+
1188
+
1189
+ @validate_call
1190
+ def create_branch_with_http_info(
1191
+ self,
1192
+ request: Annotated[GitBranchRequest, Field(description="Create branch request")],
1193
+ _request_timeout: Union[
1194
+ None,
1195
+ Annotated[StrictFloat, Field(gt=0)],
1196
+ Tuple[
1197
+ Annotated[StrictFloat, Field(gt=0)],
1198
+ Annotated[StrictFloat, Field(gt=0)]
1199
+ ]
1200
+ ] = None,
1201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1202
+ _content_type: Optional[StrictStr] = None,
1203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1205
+ ) -> ApiResponse[None]:
1206
+ """Create a new branch
1207
+
1208
+ Create a new branch in the Git repository
1209
+
1210
+ :param request: Create branch request (required)
1211
+ :type request: GitBranchRequest
1212
+ :param _request_timeout: timeout setting for this request. If one
1213
+ number provided, it will be total request
1214
+ timeout. It can also be a pair (tuple) of
1215
+ (connection, read) timeouts.
1216
+ :type _request_timeout: int, tuple(int, int), optional
1217
+ :param _request_auth: set to override the auth_settings for an a single
1218
+ request; this effectively ignores the
1219
+ authentication in the spec for a single request.
1220
+ :type _request_auth: dict, optional
1221
+ :param _content_type: force content-type for the request.
1222
+ :type _content_type: str, Optional
1223
+ :param _headers: set to override the headers for a single
1224
+ request; this effectively ignores the headers
1225
+ in the spec for a single request.
1226
+ :type _headers: dict, optional
1227
+ :param _host_index: set to override the host_index for a single
1228
+ request; this effectively ignores the host_index
1229
+ in the spec for a single request.
1230
+ :type _host_index: int, optional
1231
+ :return: Returns the result object.
1232
+ """ # noqa: E501
1233
+
1234
+ _param = self._create_branch_serialize(
1235
+ request=request,
1236
+ _request_auth=_request_auth,
1237
+ _content_type=_content_type,
1238
+ _headers=_headers,
1239
+ _host_index=_host_index
1240
+ )
1241
+
1242
+ _response_types_map: Dict[str, Optional[str]] = {
1243
+ '201': None,
1244
+ }
1245
+ response_data = self.api_client.call_api(
1246
+ *_param,
1247
+ _request_timeout=_request_timeout
1248
+ )
1249
+ response_data.read()
1250
+ return self.api_client.response_deserialize(
1251
+ response_data=response_data,
1252
+ response_types_map=_response_types_map,
1253
+ )
1254
+
1255
+
1256
+ @validate_call
1257
+ def create_branch_without_preload_content(
1258
+ self,
1259
+ request: Annotated[GitBranchRequest, Field(description="Create branch request")],
1260
+ _request_timeout: Union[
1261
+ None,
1262
+ Annotated[StrictFloat, Field(gt=0)],
1263
+ Tuple[
1264
+ Annotated[StrictFloat, Field(gt=0)],
1265
+ Annotated[StrictFloat, Field(gt=0)]
1266
+ ]
1267
+ ] = None,
1268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1269
+ _content_type: Optional[StrictStr] = None,
1270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1272
+ ) -> RESTResponseType:
1273
+ """Create a new branch
1274
+
1275
+ Create a new branch in the Git repository
1276
+
1277
+ :param request: Create branch request (required)
1278
+ :type request: GitBranchRequest
1279
+ :param _request_timeout: timeout setting for this request. If one
1280
+ number provided, it will be total request
1281
+ timeout. It can also be a pair (tuple) of
1282
+ (connection, read) timeouts.
1283
+ :type _request_timeout: int, tuple(int, int), optional
1284
+ :param _request_auth: set to override the auth_settings for an a single
1285
+ request; this effectively ignores the
1286
+ authentication in the spec for a single request.
1287
+ :type _request_auth: dict, optional
1288
+ :param _content_type: force content-type for the request.
1289
+ :type _content_type: str, Optional
1290
+ :param _headers: set to override the headers for a single
1291
+ request; this effectively ignores the headers
1292
+ in the spec for a single request.
1293
+ :type _headers: dict, optional
1294
+ :param _host_index: set to override the host_index for a single
1295
+ request; this effectively ignores the host_index
1296
+ in the spec for a single request.
1297
+ :type _host_index: int, optional
1298
+ :return: Returns the result object.
1299
+ """ # noqa: E501
1300
+
1301
+ _param = self._create_branch_serialize(
1302
+ request=request,
1303
+ _request_auth=_request_auth,
1304
+ _content_type=_content_type,
1305
+ _headers=_headers,
1306
+ _host_index=_host_index
1307
+ )
1308
+
1309
+ _response_types_map: Dict[str, Optional[str]] = {
1310
+ '201': None,
1311
+ }
1312
+ response_data = self.api_client.call_api(
1313
+ *_param,
1314
+ _request_timeout=_request_timeout
1315
+ )
1316
+ return response_data.response
1317
+
1318
+
1319
+ def _create_branch_serialize(
1320
+ self,
1321
+ request,
1322
+ _request_auth,
1323
+ _content_type,
1324
+ _headers,
1325
+ _host_index,
1326
+ ) -> RequestSerialized:
1327
+
1328
+ _host = None
1329
+
1330
+ _collection_formats: Dict[str, str] = {
1331
+ }
1332
+
1333
+ _path_params: Dict[str, str] = {}
1334
+ _query_params: List[Tuple[str, str]] = []
1335
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1336
+ _form_params: List[Tuple[str, str]] = []
1337
+ _files: Dict[
1338
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1339
+ ] = {}
1340
+ _body_params: Optional[bytes] = None
1341
+
1342
+ # process the path parameters
1343
+ # process the query parameters
1344
+ # process the header parameters
1345
+ # process the form parameters
1346
+ # process the body parameter
1347
+ if request is not None:
1348
+ _body_params = request
1349
+
1350
+
1351
+
1352
+ # set the HTTP header `Content-Type`
1353
+ if _content_type:
1354
+ _header_params['Content-Type'] = _content_type
1355
+ else:
1356
+ _default_content_type = (
1357
+ self.api_client.select_header_content_type(
1358
+ [
1359
+ 'application/json'
1360
+ ]
1361
+ )
1362
+ )
1363
+ if _default_content_type is not None:
1364
+ _header_params['Content-Type'] = _default_content_type
1365
+
1366
+ # authentication setting
1367
+ _auth_settings: List[str] = [
1368
+ ]
1369
+
1370
+ return self.api_client.param_serialize(
1371
+ method='POST',
1372
+ resource_path='/git/branches',
1373
+ path_params=_path_params,
1374
+ query_params=_query_params,
1375
+ header_params=_header_params,
1376
+ body=_body_params,
1377
+ post_params=_form_params,
1378
+ files=_files,
1379
+ auth_settings=_auth_settings,
1380
+ collection_formats=_collection_formats,
1381
+ _host=_host,
1382
+ _request_auth=_request_auth
1383
+ )
1384
+
1385
+
1386
+
1387
+
1388
+ @validate_call
1389
+ def delete_branch(
1390
+ self,
1391
+ request: Annotated[GitDeleteBranchRequest, Field(description="Delete branch request")],
1392
+ _request_timeout: Union[
1393
+ None,
1394
+ Annotated[StrictFloat, Field(gt=0)],
1395
+ Tuple[
1396
+ Annotated[StrictFloat, Field(gt=0)],
1397
+ Annotated[StrictFloat, Field(gt=0)]
1398
+ ]
1399
+ ] = None,
1400
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1401
+ _content_type: Optional[StrictStr] = None,
1402
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1403
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1404
+ ) -> None:
1405
+ """Delete a branch
1406
+
1407
+ Delete a branch from the Git repository
1408
+
1409
+ :param request: Delete branch request (required)
1410
+ :type request: GitDeleteBranchRequest
1411
+ :param _request_timeout: timeout setting for this request. If one
1412
+ number provided, it will be total request
1413
+ timeout. It can also be a pair (tuple) of
1414
+ (connection, read) timeouts.
1415
+ :type _request_timeout: int, tuple(int, int), optional
1416
+ :param _request_auth: set to override the auth_settings for an a single
1417
+ request; this effectively ignores the
1418
+ authentication in the spec for a single request.
1419
+ :type _request_auth: dict, optional
1420
+ :param _content_type: force content-type for the request.
1421
+ :type _content_type: str, Optional
1422
+ :param _headers: set to override the headers for a single
1423
+ request; this effectively ignores the headers
1424
+ in the spec for a single request.
1425
+ :type _headers: dict, optional
1426
+ :param _host_index: set to override the host_index for a single
1427
+ request; this effectively ignores the host_index
1428
+ in the spec for a single request.
1429
+ :type _host_index: int, optional
1430
+ :return: Returns the result object.
1431
+ """ # noqa: E501
1432
+
1433
+ _param = self._delete_branch_serialize(
1434
+ request=request,
1435
+ _request_auth=_request_auth,
1436
+ _content_type=_content_type,
1437
+ _headers=_headers,
1438
+ _host_index=_host_index
1439
+ )
1440
+
1441
+ _response_types_map: Dict[str, Optional[str]] = {
1442
+ '204': None,
1443
+ }
1444
+ response_data = self.api_client.call_api(
1445
+ *_param,
1446
+ _request_timeout=_request_timeout
1447
+ )
1448
+ response_data.read()
1449
+ return self.api_client.response_deserialize(
1450
+ response_data=response_data,
1451
+ response_types_map=_response_types_map,
1452
+ ).data
1453
+
1454
+
1455
+ @validate_call
1456
+ def delete_branch_with_http_info(
1457
+ self,
1458
+ request: Annotated[GitDeleteBranchRequest, Field(description="Delete branch request")],
1459
+ _request_timeout: Union[
1460
+ None,
1461
+ Annotated[StrictFloat, Field(gt=0)],
1462
+ Tuple[
1463
+ Annotated[StrictFloat, Field(gt=0)],
1464
+ Annotated[StrictFloat, Field(gt=0)]
1465
+ ]
1466
+ ] = None,
1467
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1468
+ _content_type: Optional[StrictStr] = None,
1469
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1470
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1471
+ ) -> ApiResponse[None]:
1472
+ """Delete a branch
1473
+
1474
+ Delete a branch from the Git repository
1475
+
1476
+ :param request: Delete branch request (required)
1477
+ :type request: GitDeleteBranchRequest
1478
+ :param _request_timeout: timeout setting for this request. If one
1479
+ number provided, it will be total request
1480
+ timeout. It can also be a pair (tuple) of
1481
+ (connection, read) timeouts.
1482
+ :type _request_timeout: int, tuple(int, int), optional
1483
+ :param _request_auth: set to override the auth_settings for an a single
1484
+ request; this effectively ignores the
1485
+ authentication in the spec for a single request.
1486
+ :type _request_auth: dict, optional
1487
+ :param _content_type: force content-type for the request.
1488
+ :type _content_type: str, Optional
1489
+ :param _headers: set to override the headers for a single
1490
+ request; this effectively ignores the headers
1491
+ in the spec for a single request.
1492
+ :type _headers: dict, optional
1493
+ :param _host_index: set to override the host_index for a single
1494
+ request; this effectively ignores the host_index
1495
+ in the spec for a single request.
1496
+ :type _host_index: int, optional
1497
+ :return: Returns the result object.
1498
+ """ # noqa: E501
1499
+
1500
+ _param = self._delete_branch_serialize(
1501
+ request=request,
1502
+ _request_auth=_request_auth,
1503
+ _content_type=_content_type,
1504
+ _headers=_headers,
1505
+ _host_index=_host_index
1506
+ )
1507
+
1508
+ _response_types_map: Dict[str, Optional[str]] = {
1509
+ '204': None,
1510
+ }
1511
+ response_data = self.api_client.call_api(
1512
+ *_param,
1513
+ _request_timeout=_request_timeout
1514
+ )
1515
+ response_data.read()
1516
+ return self.api_client.response_deserialize(
1517
+ response_data=response_data,
1518
+ response_types_map=_response_types_map,
1519
+ )
1520
+
1521
+
1522
+ @validate_call
1523
+ def delete_branch_without_preload_content(
1524
+ self,
1525
+ request: Annotated[GitDeleteBranchRequest, Field(description="Delete branch request")],
1526
+ _request_timeout: Union[
1527
+ None,
1528
+ Annotated[StrictFloat, Field(gt=0)],
1529
+ Tuple[
1530
+ Annotated[StrictFloat, Field(gt=0)],
1531
+ Annotated[StrictFloat, Field(gt=0)]
1532
+ ]
1533
+ ] = None,
1534
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1535
+ _content_type: Optional[StrictStr] = None,
1536
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1537
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1538
+ ) -> RESTResponseType:
1539
+ """Delete a branch
1540
+
1541
+ Delete a branch from the Git repository
1542
+
1543
+ :param request: Delete branch request (required)
1544
+ :type request: GitDeleteBranchRequest
1545
+ :param _request_timeout: timeout setting for this request. If one
1546
+ number provided, it will be total request
1547
+ timeout. It can also be a pair (tuple) of
1548
+ (connection, read) timeouts.
1549
+ :type _request_timeout: int, tuple(int, int), optional
1550
+ :param _request_auth: set to override the auth_settings for an a single
1551
+ request; this effectively ignores the
1552
+ authentication in the spec for a single request.
1553
+ :type _request_auth: dict, optional
1554
+ :param _content_type: force content-type for the request.
1555
+ :type _content_type: str, Optional
1556
+ :param _headers: set to override the headers for a single
1557
+ request; this effectively ignores the headers
1558
+ in the spec for a single request.
1559
+ :type _headers: dict, optional
1560
+ :param _host_index: set to override the host_index for a single
1561
+ request; this effectively ignores the host_index
1562
+ in the spec for a single request.
1563
+ :type _host_index: int, optional
1564
+ :return: Returns the result object.
1565
+ """ # noqa: E501
1566
+
1567
+ _param = self._delete_branch_serialize(
1568
+ request=request,
1569
+ _request_auth=_request_auth,
1570
+ _content_type=_content_type,
1571
+ _headers=_headers,
1572
+ _host_index=_host_index
1573
+ )
1574
+
1575
+ _response_types_map: Dict[str, Optional[str]] = {
1576
+ '204': None,
1577
+ }
1578
+ response_data = self.api_client.call_api(
1579
+ *_param,
1580
+ _request_timeout=_request_timeout
1581
+ )
1582
+ return response_data.response
1583
+
1584
+
1585
+ def _delete_branch_serialize(
1586
+ self,
1587
+ request,
1588
+ _request_auth,
1589
+ _content_type,
1590
+ _headers,
1591
+ _host_index,
1592
+ ) -> RequestSerialized:
1593
+
1594
+ _host = None
1595
+
1596
+ _collection_formats: Dict[str, str] = {
1597
+ }
1598
+
1599
+ _path_params: Dict[str, str] = {}
1600
+ _query_params: List[Tuple[str, str]] = []
1601
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1602
+ _form_params: List[Tuple[str, str]] = []
1603
+ _files: Dict[
1604
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1605
+ ] = {}
1606
+ _body_params: Optional[bytes] = None
1607
+
1608
+ # process the path parameters
1609
+ # process the query parameters
1610
+ # process the header parameters
1611
+ # process the form parameters
1612
+ # process the body parameter
1613
+ if request is not None:
1614
+ _body_params = request
1615
+
1616
+
1617
+
1618
+ # set the HTTP header `Content-Type`
1619
+ if _content_type:
1620
+ _header_params['Content-Type'] = _content_type
1621
+ else:
1622
+ _default_content_type = (
1623
+ self.api_client.select_header_content_type(
1624
+ [
1625
+ 'application/json'
1626
+ ]
1627
+ )
1628
+ )
1629
+ if _default_content_type is not None:
1630
+ _header_params['Content-Type'] = _default_content_type
1631
+
1632
+ # authentication setting
1633
+ _auth_settings: List[str] = [
1634
+ ]
1635
+
1636
+ return self.api_client.param_serialize(
1637
+ method='DELETE',
1638
+ resource_path='/git/branches',
1639
+ path_params=_path_params,
1640
+ query_params=_query_params,
1641
+ header_params=_header_params,
1642
+ body=_body_params,
1643
+ post_params=_form_params,
1644
+ files=_files,
1645
+ auth_settings=_auth_settings,
1646
+ collection_formats=_collection_formats,
1647
+ _host=_host,
1648
+ _request_auth=_request_auth
1649
+ )
1650
+
1651
+
1652
+
1653
+
1654
+ @validate_call
1655
+ def get_commit_history(
1656
+ self,
1657
+ path: Annotated[StrictStr, Field(description="Repository path")],
1658
+ _request_timeout: Union[
1659
+ None,
1660
+ Annotated[StrictFloat, Field(gt=0)],
1661
+ Tuple[
1662
+ Annotated[StrictFloat, Field(gt=0)],
1663
+ Annotated[StrictFloat, Field(gt=0)]
1664
+ ]
1665
+ ] = None,
1666
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1667
+ _content_type: Optional[StrictStr] = None,
1668
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1669
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1670
+ ) -> List[GitCommitInfo]:
1671
+ """Get commit history
1672
+
1673
+ Get the commit history of the Git repository
1674
+
1675
+ :param path: Repository path (required)
1676
+ :type path: str
1677
+ :param _request_timeout: timeout setting for this request. If one
1678
+ number provided, it will be total request
1679
+ timeout. It can also be a pair (tuple) of
1680
+ (connection, read) timeouts.
1681
+ :type _request_timeout: int, tuple(int, int), optional
1682
+ :param _request_auth: set to override the auth_settings for an a single
1683
+ request; this effectively ignores the
1684
+ authentication in the spec for a single request.
1685
+ :type _request_auth: dict, optional
1686
+ :param _content_type: force content-type for the request.
1687
+ :type _content_type: str, Optional
1688
+ :param _headers: set to override the headers for a single
1689
+ request; this effectively ignores the headers
1690
+ in the spec for a single request.
1691
+ :type _headers: dict, optional
1692
+ :param _host_index: set to override the host_index for a single
1693
+ request; this effectively ignores the host_index
1694
+ in the spec for a single request.
1695
+ :type _host_index: int, optional
1696
+ :return: Returns the result object.
1697
+ """ # noqa: E501
1698
+
1699
+ _param = self._get_commit_history_serialize(
1700
+ path=path,
1701
+ _request_auth=_request_auth,
1702
+ _content_type=_content_type,
1703
+ _headers=_headers,
1704
+ _host_index=_host_index
1705
+ )
1706
+
1707
+ _response_types_map: Dict[str, Optional[str]] = {
1708
+ '200': "List[GitCommitInfo]",
1709
+ }
1710
+ response_data = self.api_client.call_api(
1711
+ *_param,
1712
+ _request_timeout=_request_timeout
1713
+ )
1714
+ response_data.read()
1715
+ return self.api_client.response_deserialize(
1716
+ response_data=response_data,
1717
+ response_types_map=_response_types_map,
1718
+ ).data
1719
+
1720
+
1721
+ @validate_call
1722
+ def get_commit_history_with_http_info(
1723
+ self,
1724
+ path: Annotated[StrictStr, Field(description="Repository path")],
1725
+ _request_timeout: Union[
1726
+ None,
1727
+ Annotated[StrictFloat, Field(gt=0)],
1728
+ Tuple[
1729
+ Annotated[StrictFloat, Field(gt=0)],
1730
+ Annotated[StrictFloat, Field(gt=0)]
1731
+ ]
1732
+ ] = None,
1733
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1734
+ _content_type: Optional[StrictStr] = None,
1735
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1736
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1737
+ ) -> ApiResponse[List[GitCommitInfo]]:
1738
+ """Get commit history
1739
+
1740
+ Get the commit history of the Git repository
1741
+
1742
+ :param path: Repository path (required)
1743
+ :type path: str
1744
+ :param _request_timeout: timeout setting for this request. If one
1745
+ number provided, it will be total request
1746
+ timeout. It can also be a pair (tuple) of
1747
+ (connection, read) timeouts.
1748
+ :type _request_timeout: int, tuple(int, int), optional
1749
+ :param _request_auth: set to override the auth_settings for an a single
1750
+ request; this effectively ignores the
1751
+ authentication in the spec for a single request.
1752
+ :type _request_auth: dict, optional
1753
+ :param _content_type: force content-type for the request.
1754
+ :type _content_type: str, Optional
1755
+ :param _headers: set to override the headers for a single
1756
+ request; this effectively ignores the headers
1757
+ in the spec for a single request.
1758
+ :type _headers: dict, optional
1759
+ :param _host_index: set to override the host_index for a single
1760
+ request; this effectively ignores the host_index
1761
+ in the spec for a single request.
1762
+ :type _host_index: int, optional
1763
+ :return: Returns the result object.
1764
+ """ # noqa: E501
1765
+
1766
+ _param = self._get_commit_history_serialize(
1767
+ path=path,
1768
+ _request_auth=_request_auth,
1769
+ _content_type=_content_type,
1770
+ _headers=_headers,
1771
+ _host_index=_host_index
1772
+ )
1773
+
1774
+ _response_types_map: Dict[str, Optional[str]] = {
1775
+ '200': "List[GitCommitInfo]",
1776
+ }
1777
+ response_data = self.api_client.call_api(
1778
+ *_param,
1779
+ _request_timeout=_request_timeout
1780
+ )
1781
+ response_data.read()
1782
+ return self.api_client.response_deserialize(
1783
+ response_data=response_data,
1784
+ response_types_map=_response_types_map,
1785
+ )
1786
+
1787
+
1788
+ @validate_call
1789
+ def get_commit_history_without_preload_content(
1790
+ self,
1791
+ path: Annotated[StrictStr, Field(description="Repository path")],
1792
+ _request_timeout: Union[
1793
+ None,
1794
+ Annotated[StrictFloat, Field(gt=0)],
1795
+ Tuple[
1796
+ Annotated[StrictFloat, Field(gt=0)],
1797
+ Annotated[StrictFloat, Field(gt=0)]
1798
+ ]
1799
+ ] = None,
1800
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1801
+ _content_type: Optional[StrictStr] = None,
1802
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1803
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1804
+ ) -> RESTResponseType:
1805
+ """Get commit history
1806
+
1807
+ Get the commit history of the Git repository
1808
+
1809
+ :param path: Repository path (required)
1810
+ :type path: str
1811
+ :param _request_timeout: timeout setting for this request. If one
1812
+ number provided, it will be total request
1813
+ timeout. It can also be a pair (tuple) of
1814
+ (connection, read) timeouts.
1815
+ :type _request_timeout: int, tuple(int, int), optional
1816
+ :param _request_auth: set to override the auth_settings for an a single
1817
+ request; this effectively ignores the
1818
+ authentication in the spec for a single request.
1819
+ :type _request_auth: dict, optional
1820
+ :param _content_type: force content-type for the request.
1821
+ :type _content_type: str, Optional
1822
+ :param _headers: set to override the headers for a single
1823
+ request; this effectively ignores the headers
1824
+ in the spec for a single request.
1825
+ :type _headers: dict, optional
1826
+ :param _host_index: set to override the host_index for a single
1827
+ request; this effectively ignores the host_index
1828
+ in the spec for a single request.
1829
+ :type _host_index: int, optional
1830
+ :return: Returns the result object.
1831
+ """ # noqa: E501
1832
+
1833
+ _param = self._get_commit_history_serialize(
1834
+ path=path,
1835
+ _request_auth=_request_auth,
1836
+ _content_type=_content_type,
1837
+ _headers=_headers,
1838
+ _host_index=_host_index
1839
+ )
1840
+
1841
+ _response_types_map: Dict[str, Optional[str]] = {
1842
+ '200': "List[GitCommitInfo]",
1843
+ }
1844
+ response_data = self.api_client.call_api(
1845
+ *_param,
1846
+ _request_timeout=_request_timeout
1847
+ )
1848
+ return response_data.response
1849
+
1850
+
1851
+ def _get_commit_history_serialize(
1852
+ self,
1853
+ path,
1854
+ _request_auth,
1855
+ _content_type,
1856
+ _headers,
1857
+ _host_index,
1858
+ ) -> RequestSerialized:
1859
+
1860
+ _host = None
1861
+
1862
+ _collection_formats: Dict[str, str] = {
1863
+ }
1864
+
1865
+ _path_params: Dict[str, str] = {}
1866
+ _query_params: List[Tuple[str, str]] = []
1867
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1868
+ _form_params: List[Tuple[str, str]] = []
1869
+ _files: Dict[
1870
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1871
+ ] = {}
1872
+ _body_params: Optional[bytes] = None
1873
+
1874
+ # process the path parameters
1875
+ # process the query parameters
1876
+ if path is not None:
1877
+
1878
+ _query_params.append(('path', path))
1879
+
1880
+ # process the header parameters
1881
+ # process the form parameters
1882
+ # process the body parameter
1883
+
1884
+
1885
+ # set the HTTP header `Accept`
1886
+ if 'Accept' not in _header_params:
1887
+ _header_params['Accept'] = self.api_client.select_header_accept(
1888
+ [
1889
+ 'application/json'
1890
+ ]
1891
+ )
1892
+
1893
+
1894
+ # authentication setting
1895
+ _auth_settings: List[str] = [
1896
+ ]
1897
+
1898
+ return self.api_client.param_serialize(
1899
+ method='GET',
1900
+ resource_path='/git/history',
1901
+ path_params=_path_params,
1902
+ query_params=_query_params,
1903
+ header_params=_header_params,
1904
+ body=_body_params,
1905
+ post_params=_form_params,
1906
+ files=_files,
1907
+ auth_settings=_auth_settings,
1908
+ collection_formats=_collection_formats,
1909
+ _host=_host,
1910
+ _request_auth=_request_auth
1911
+ )
1912
+
1913
+
1914
+
1915
+
1916
+ @validate_call
1917
+ def get_status(
1918
+ self,
1919
+ path: Annotated[StrictStr, Field(description="Repository path")],
1920
+ _request_timeout: Union[
1921
+ None,
1922
+ Annotated[StrictFloat, Field(gt=0)],
1923
+ Tuple[
1924
+ Annotated[StrictFloat, Field(gt=0)],
1925
+ Annotated[StrictFloat, Field(gt=0)]
1926
+ ]
1927
+ ] = None,
1928
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1929
+ _content_type: Optional[StrictStr] = None,
1930
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1931
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1932
+ ) -> GitStatus:
1933
+ """Get Git status
1934
+
1935
+ Get the Git status of the repository at the specified path
1936
+
1937
+ :param path: Repository path (required)
1938
+ :type path: str
1939
+ :param _request_timeout: timeout setting for this request. If one
1940
+ number provided, it will be total request
1941
+ timeout. It can also be a pair (tuple) of
1942
+ (connection, read) timeouts.
1943
+ :type _request_timeout: int, tuple(int, int), optional
1944
+ :param _request_auth: set to override the auth_settings for an a single
1945
+ request; this effectively ignores the
1946
+ authentication in the spec for a single request.
1947
+ :type _request_auth: dict, optional
1948
+ :param _content_type: force content-type for the request.
1949
+ :type _content_type: str, Optional
1950
+ :param _headers: set to override the headers for a single
1951
+ request; this effectively ignores the headers
1952
+ in the spec for a single request.
1953
+ :type _headers: dict, optional
1954
+ :param _host_index: set to override the host_index for a single
1955
+ request; this effectively ignores the host_index
1956
+ in the spec for a single request.
1957
+ :type _host_index: int, optional
1958
+ :return: Returns the result object.
1959
+ """ # noqa: E501
1960
+
1961
+ _param = self._get_status_serialize(
1962
+ path=path,
1963
+ _request_auth=_request_auth,
1964
+ _content_type=_content_type,
1965
+ _headers=_headers,
1966
+ _host_index=_host_index
1967
+ )
1968
+
1969
+ _response_types_map: Dict[str, Optional[str]] = {
1970
+ '200': "GitStatus",
1971
+ }
1972
+ response_data = self.api_client.call_api(
1973
+ *_param,
1974
+ _request_timeout=_request_timeout
1975
+ )
1976
+ response_data.read()
1977
+ return self.api_client.response_deserialize(
1978
+ response_data=response_data,
1979
+ response_types_map=_response_types_map,
1980
+ ).data
1981
+
1982
+
1983
+ @validate_call
1984
+ def get_status_with_http_info(
1985
+ self,
1986
+ path: Annotated[StrictStr, Field(description="Repository path")],
1987
+ _request_timeout: Union[
1988
+ None,
1989
+ Annotated[StrictFloat, Field(gt=0)],
1990
+ Tuple[
1991
+ Annotated[StrictFloat, Field(gt=0)],
1992
+ Annotated[StrictFloat, Field(gt=0)]
1993
+ ]
1994
+ ] = None,
1995
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1996
+ _content_type: Optional[StrictStr] = None,
1997
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1998
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1999
+ ) -> ApiResponse[GitStatus]:
2000
+ """Get Git status
2001
+
2002
+ Get the Git status of the repository at the specified path
2003
+
2004
+ :param path: Repository path (required)
2005
+ :type path: str
2006
+ :param _request_timeout: timeout setting for this request. If one
2007
+ number provided, it will be total request
2008
+ timeout. It can also be a pair (tuple) of
2009
+ (connection, read) timeouts.
2010
+ :type _request_timeout: int, tuple(int, int), optional
2011
+ :param _request_auth: set to override the auth_settings for an a single
2012
+ request; this effectively ignores the
2013
+ authentication in the spec for a single request.
2014
+ :type _request_auth: dict, optional
2015
+ :param _content_type: force content-type for the request.
2016
+ :type _content_type: str, Optional
2017
+ :param _headers: set to override the headers for a single
2018
+ request; this effectively ignores the headers
2019
+ in the spec for a single request.
2020
+ :type _headers: dict, optional
2021
+ :param _host_index: set to override the host_index for a single
2022
+ request; this effectively ignores the host_index
2023
+ in the spec for a single request.
2024
+ :type _host_index: int, optional
2025
+ :return: Returns the result object.
2026
+ """ # noqa: E501
2027
+
2028
+ _param = self._get_status_serialize(
2029
+ path=path,
2030
+ _request_auth=_request_auth,
2031
+ _content_type=_content_type,
2032
+ _headers=_headers,
2033
+ _host_index=_host_index
2034
+ )
2035
+
2036
+ _response_types_map: Dict[str, Optional[str]] = {
2037
+ '200': "GitStatus",
2038
+ }
2039
+ response_data = self.api_client.call_api(
2040
+ *_param,
2041
+ _request_timeout=_request_timeout
2042
+ )
2043
+ response_data.read()
2044
+ return self.api_client.response_deserialize(
2045
+ response_data=response_data,
2046
+ response_types_map=_response_types_map,
2047
+ )
2048
+
2049
+
2050
+ @validate_call
2051
+ def get_status_without_preload_content(
2052
+ self,
2053
+ path: Annotated[StrictStr, Field(description="Repository path")],
2054
+ _request_timeout: Union[
2055
+ None,
2056
+ Annotated[StrictFloat, Field(gt=0)],
2057
+ Tuple[
2058
+ Annotated[StrictFloat, Field(gt=0)],
2059
+ Annotated[StrictFloat, Field(gt=0)]
2060
+ ]
2061
+ ] = None,
2062
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2063
+ _content_type: Optional[StrictStr] = None,
2064
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2065
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2066
+ ) -> RESTResponseType:
2067
+ """Get Git status
2068
+
2069
+ Get the Git status of the repository at the specified path
2070
+
2071
+ :param path: Repository path (required)
2072
+ :type path: str
2073
+ :param _request_timeout: timeout setting for this request. If one
2074
+ number provided, it will be total request
2075
+ timeout. It can also be a pair (tuple) of
2076
+ (connection, read) timeouts.
2077
+ :type _request_timeout: int, tuple(int, int), optional
2078
+ :param _request_auth: set to override the auth_settings for an a single
2079
+ request; this effectively ignores the
2080
+ authentication in the spec for a single request.
2081
+ :type _request_auth: dict, optional
2082
+ :param _content_type: force content-type for the request.
2083
+ :type _content_type: str, Optional
2084
+ :param _headers: set to override the headers for a single
2085
+ request; this effectively ignores the headers
2086
+ in the spec for a single request.
2087
+ :type _headers: dict, optional
2088
+ :param _host_index: set to override the host_index for a single
2089
+ request; this effectively ignores the host_index
2090
+ in the spec for a single request.
2091
+ :type _host_index: int, optional
2092
+ :return: Returns the result object.
2093
+ """ # noqa: E501
2094
+
2095
+ _param = self._get_status_serialize(
2096
+ path=path,
2097
+ _request_auth=_request_auth,
2098
+ _content_type=_content_type,
2099
+ _headers=_headers,
2100
+ _host_index=_host_index
2101
+ )
2102
+
2103
+ _response_types_map: Dict[str, Optional[str]] = {
2104
+ '200': "GitStatus",
2105
+ }
2106
+ response_data = self.api_client.call_api(
2107
+ *_param,
2108
+ _request_timeout=_request_timeout
2109
+ )
2110
+ return response_data.response
2111
+
2112
+
2113
+ def _get_status_serialize(
2114
+ self,
2115
+ path,
2116
+ _request_auth,
2117
+ _content_type,
2118
+ _headers,
2119
+ _host_index,
2120
+ ) -> RequestSerialized:
2121
+
2122
+ _host = None
2123
+
2124
+ _collection_formats: Dict[str, str] = {
2125
+ }
2126
+
2127
+ _path_params: Dict[str, str] = {}
2128
+ _query_params: List[Tuple[str, str]] = []
2129
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2130
+ _form_params: List[Tuple[str, str]] = []
2131
+ _files: Dict[
2132
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2133
+ ] = {}
2134
+ _body_params: Optional[bytes] = None
2135
+
2136
+ # process the path parameters
2137
+ # process the query parameters
2138
+ if path is not None:
2139
+
2140
+ _query_params.append(('path', path))
2141
+
2142
+ # process the header parameters
2143
+ # process the form parameters
2144
+ # process the body parameter
2145
+
2146
+
2147
+ # set the HTTP header `Accept`
2148
+ if 'Accept' not in _header_params:
2149
+ _header_params['Accept'] = self.api_client.select_header_accept(
2150
+ [
2151
+ 'application/json'
2152
+ ]
2153
+ )
2154
+
2155
+
2156
+ # authentication setting
2157
+ _auth_settings: List[str] = [
2158
+ ]
2159
+
2160
+ return self.api_client.param_serialize(
2161
+ method='GET',
2162
+ resource_path='/git/status',
2163
+ path_params=_path_params,
2164
+ query_params=_query_params,
2165
+ header_params=_header_params,
2166
+ body=_body_params,
2167
+ post_params=_form_params,
2168
+ files=_files,
2169
+ auth_settings=_auth_settings,
2170
+ collection_formats=_collection_formats,
2171
+ _host=_host,
2172
+ _request_auth=_request_auth
2173
+ )
2174
+
2175
+
2176
+
2177
+
2178
+ @validate_call
2179
+ def list_branches(
2180
+ self,
2181
+ path: Annotated[StrictStr, Field(description="Repository path")],
2182
+ _request_timeout: Union[
2183
+ None,
2184
+ Annotated[StrictFloat, Field(gt=0)],
2185
+ Tuple[
2186
+ Annotated[StrictFloat, Field(gt=0)],
2187
+ Annotated[StrictFloat, Field(gt=0)]
2188
+ ]
2189
+ ] = None,
2190
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2191
+ _content_type: Optional[StrictStr] = None,
2192
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2193
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2194
+ ) -> ListBranchResponse:
2195
+ """List branches
2196
+
2197
+ Get a list of all branches in the Git repository
2198
+
2199
+ :param path: Repository path (required)
2200
+ :type path: str
2201
+ :param _request_timeout: timeout setting for this request. If one
2202
+ number provided, it will be total request
2203
+ timeout. It can also be a pair (tuple) of
2204
+ (connection, read) timeouts.
2205
+ :type _request_timeout: int, tuple(int, int), optional
2206
+ :param _request_auth: set to override the auth_settings for an a single
2207
+ request; this effectively ignores the
2208
+ authentication in the spec for a single request.
2209
+ :type _request_auth: dict, optional
2210
+ :param _content_type: force content-type for the request.
2211
+ :type _content_type: str, Optional
2212
+ :param _headers: set to override the headers for a single
2213
+ request; this effectively ignores the headers
2214
+ in the spec for a single request.
2215
+ :type _headers: dict, optional
2216
+ :param _host_index: set to override the host_index for a single
2217
+ request; this effectively ignores the host_index
2218
+ in the spec for a single request.
2219
+ :type _host_index: int, optional
2220
+ :return: Returns the result object.
2221
+ """ # noqa: E501
2222
+
2223
+ _param = self._list_branches_serialize(
2224
+ path=path,
2225
+ _request_auth=_request_auth,
2226
+ _content_type=_content_type,
2227
+ _headers=_headers,
2228
+ _host_index=_host_index
2229
+ )
2230
+
2231
+ _response_types_map: Dict[str, Optional[str]] = {
2232
+ '200': "ListBranchResponse",
2233
+ }
2234
+ response_data = self.api_client.call_api(
2235
+ *_param,
2236
+ _request_timeout=_request_timeout
2237
+ )
2238
+ response_data.read()
2239
+ return self.api_client.response_deserialize(
2240
+ response_data=response_data,
2241
+ response_types_map=_response_types_map,
2242
+ ).data
2243
+
2244
+
2245
+ @validate_call
2246
+ def list_branches_with_http_info(
2247
+ self,
2248
+ path: Annotated[StrictStr, Field(description="Repository path")],
2249
+ _request_timeout: Union[
2250
+ None,
2251
+ Annotated[StrictFloat, Field(gt=0)],
2252
+ Tuple[
2253
+ Annotated[StrictFloat, Field(gt=0)],
2254
+ Annotated[StrictFloat, Field(gt=0)]
2255
+ ]
2256
+ ] = None,
2257
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2258
+ _content_type: Optional[StrictStr] = None,
2259
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2260
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2261
+ ) -> ApiResponse[ListBranchResponse]:
2262
+ """List branches
2263
+
2264
+ Get a list of all branches in the Git repository
2265
+
2266
+ :param path: Repository path (required)
2267
+ :type path: str
2268
+ :param _request_timeout: timeout setting for this request. If one
2269
+ number provided, it will be total request
2270
+ timeout. It can also be a pair (tuple) of
2271
+ (connection, read) timeouts.
2272
+ :type _request_timeout: int, tuple(int, int), optional
2273
+ :param _request_auth: set to override the auth_settings for an a single
2274
+ request; this effectively ignores the
2275
+ authentication in the spec for a single request.
2276
+ :type _request_auth: dict, optional
2277
+ :param _content_type: force content-type for the request.
2278
+ :type _content_type: str, Optional
2279
+ :param _headers: set to override the headers for a single
2280
+ request; this effectively ignores the headers
2281
+ in the spec for a single request.
2282
+ :type _headers: dict, optional
2283
+ :param _host_index: set to override the host_index for a single
2284
+ request; this effectively ignores the host_index
2285
+ in the spec for a single request.
2286
+ :type _host_index: int, optional
2287
+ :return: Returns the result object.
2288
+ """ # noqa: E501
2289
+
2290
+ _param = self._list_branches_serialize(
2291
+ path=path,
2292
+ _request_auth=_request_auth,
2293
+ _content_type=_content_type,
2294
+ _headers=_headers,
2295
+ _host_index=_host_index
2296
+ )
2297
+
2298
+ _response_types_map: Dict[str, Optional[str]] = {
2299
+ '200': "ListBranchResponse",
2300
+ }
2301
+ response_data = self.api_client.call_api(
2302
+ *_param,
2303
+ _request_timeout=_request_timeout
2304
+ )
2305
+ response_data.read()
2306
+ return self.api_client.response_deserialize(
2307
+ response_data=response_data,
2308
+ response_types_map=_response_types_map,
2309
+ )
2310
+
2311
+
2312
+ @validate_call
2313
+ def list_branches_without_preload_content(
2314
+ self,
2315
+ path: Annotated[StrictStr, Field(description="Repository path")],
2316
+ _request_timeout: Union[
2317
+ None,
2318
+ Annotated[StrictFloat, Field(gt=0)],
2319
+ Tuple[
2320
+ Annotated[StrictFloat, Field(gt=0)],
2321
+ Annotated[StrictFloat, Field(gt=0)]
2322
+ ]
2323
+ ] = None,
2324
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2325
+ _content_type: Optional[StrictStr] = None,
2326
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2327
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2328
+ ) -> RESTResponseType:
2329
+ """List branches
2330
+
2331
+ Get a list of all branches in the Git repository
2332
+
2333
+ :param path: Repository path (required)
2334
+ :type path: str
2335
+ :param _request_timeout: timeout setting for this request. If one
2336
+ number provided, it will be total request
2337
+ timeout. It can also be a pair (tuple) of
2338
+ (connection, read) timeouts.
2339
+ :type _request_timeout: int, tuple(int, int), optional
2340
+ :param _request_auth: set to override the auth_settings for an a single
2341
+ request; this effectively ignores the
2342
+ authentication in the spec for a single request.
2343
+ :type _request_auth: dict, optional
2344
+ :param _content_type: force content-type for the request.
2345
+ :type _content_type: str, Optional
2346
+ :param _headers: set to override the headers for a single
2347
+ request; this effectively ignores the headers
2348
+ in the spec for a single request.
2349
+ :type _headers: dict, optional
2350
+ :param _host_index: set to override the host_index for a single
2351
+ request; this effectively ignores the host_index
2352
+ in the spec for a single request.
2353
+ :type _host_index: int, optional
2354
+ :return: Returns the result object.
2355
+ """ # noqa: E501
2356
+
2357
+ _param = self._list_branches_serialize(
2358
+ path=path,
2359
+ _request_auth=_request_auth,
2360
+ _content_type=_content_type,
2361
+ _headers=_headers,
2362
+ _host_index=_host_index
2363
+ )
2364
+
2365
+ _response_types_map: Dict[str, Optional[str]] = {
2366
+ '200': "ListBranchResponse",
2367
+ }
2368
+ response_data = self.api_client.call_api(
2369
+ *_param,
2370
+ _request_timeout=_request_timeout
2371
+ )
2372
+ return response_data.response
2373
+
2374
+
2375
+ def _list_branches_serialize(
2376
+ self,
2377
+ path,
2378
+ _request_auth,
2379
+ _content_type,
2380
+ _headers,
2381
+ _host_index,
2382
+ ) -> RequestSerialized:
2383
+
2384
+ _host = None
2385
+
2386
+ _collection_formats: Dict[str, str] = {
2387
+ }
2388
+
2389
+ _path_params: Dict[str, str] = {}
2390
+ _query_params: List[Tuple[str, str]] = []
2391
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2392
+ _form_params: List[Tuple[str, str]] = []
2393
+ _files: Dict[
2394
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2395
+ ] = {}
2396
+ _body_params: Optional[bytes] = None
2397
+
2398
+ # process the path parameters
2399
+ # process the query parameters
2400
+ if path is not None:
2401
+
2402
+ _query_params.append(('path', path))
2403
+
2404
+ # process the header parameters
2405
+ # process the form parameters
2406
+ # process the body parameter
2407
+
2408
+
2409
+ # set the HTTP header `Accept`
2410
+ if 'Accept' not in _header_params:
2411
+ _header_params['Accept'] = self.api_client.select_header_accept(
2412
+ [
2413
+ 'application/json'
2414
+ ]
2415
+ )
2416
+
2417
+
2418
+ # authentication setting
2419
+ _auth_settings: List[str] = [
2420
+ ]
2421
+
2422
+ return self.api_client.param_serialize(
2423
+ method='GET',
2424
+ resource_path='/git/branches',
2425
+ path_params=_path_params,
2426
+ query_params=_query_params,
2427
+ header_params=_header_params,
2428
+ body=_body_params,
2429
+ post_params=_form_params,
2430
+ files=_files,
2431
+ auth_settings=_auth_settings,
2432
+ collection_formats=_collection_formats,
2433
+ _host=_host,
2434
+ _request_auth=_request_auth
2435
+ )
2436
+
2437
+
2438
+
2439
+
2440
+ @validate_call
2441
+ def pull_changes(
2442
+ self,
2443
+ request: Annotated[GitRepoRequest, Field(description="Pull request")],
2444
+ _request_timeout: Union[
2445
+ None,
2446
+ Annotated[StrictFloat, Field(gt=0)],
2447
+ Tuple[
2448
+ Annotated[StrictFloat, Field(gt=0)],
2449
+ Annotated[StrictFloat, Field(gt=0)]
2450
+ ]
2451
+ ] = None,
2452
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2453
+ _content_type: Optional[StrictStr] = None,
2454
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2455
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2456
+ ) -> None:
2457
+ """Pull changes from remote
2458
+
2459
+ Pull changes from the remote Git repository
2460
+
2461
+ :param request: Pull request (required)
2462
+ :type request: GitRepoRequest
2463
+ :param _request_timeout: timeout setting for this request. If one
2464
+ number provided, it will be total request
2465
+ timeout. It can also be a pair (tuple) of
2466
+ (connection, read) timeouts.
2467
+ :type _request_timeout: int, tuple(int, int), optional
2468
+ :param _request_auth: set to override the auth_settings for an a single
2469
+ request; this effectively ignores the
2470
+ authentication in the spec for a single request.
2471
+ :type _request_auth: dict, optional
2472
+ :param _content_type: force content-type for the request.
2473
+ :type _content_type: str, Optional
2474
+ :param _headers: set to override the headers for a single
2475
+ request; this effectively ignores the headers
2476
+ in the spec for a single request.
2477
+ :type _headers: dict, optional
2478
+ :param _host_index: set to override the host_index for a single
2479
+ request; this effectively ignores the host_index
2480
+ in the spec for a single request.
2481
+ :type _host_index: int, optional
2482
+ :return: Returns the result object.
2483
+ """ # noqa: E501
2484
+
2485
+ _param = self._pull_changes_serialize(
2486
+ request=request,
2487
+ _request_auth=_request_auth,
2488
+ _content_type=_content_type,
2489
+ _headers=_headers,
2490
+ _host_index=_host_index
2491
+ )
2492
+
2493
+ _response_types_map: Dict[str, Optional[str]] = {
2494
+ '200': None,
2495
+ }
2496
+ response_data = self.api_client.call_api(
2497
+ *_param,
2498
+ _request_timeout=_request_timeout
2499
+ )
2500
+ response_data.read()
2501
+ return self.api_client.response_deserialize(
2502
+ response_data=response_data,
2503
+ response_types_map=_response_types_map,
2504
+ ).data
2505
+
2506
+
2507
+ @validate_call
2508
+ def pull_changes_with_http_info(
2509
+ self,
2510
+ request: Annotated[GitRepoRequest, Field(description="Pull request")],
2511
+ _request_timeout: Union[
2512
+ None,
2513
+ Annotated[StrictFloat, Field(gt=0)],
2514
+ Tuple[
2515
+ Annotated[StrictFloat, Field(gt=0)],
2516
+ Annotated[StrictFloat, Field(gt=0)]
2517
+ ]
2518
+ ] = None,
2519
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2520
+ _content_type: Optional[StrictStr] = None,
2521
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2522
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2523
+ ) -> ApiResponse[None]:
2524
+ """Pull changes from remote
2525
+
2526
+ Pull changes from the remote Git repository
2527
+
2528
+ :param request: Pull request (required)
2529
+ :type request: GitRepoRequest
2530
+ :param _request_timeout: timeout setting for this request. If one
2531
+ number provided, it will be total request
2532
+ timeout. It can also be a pair (tuple) of
2533
+ (connection, read) timeouts.
2534
+ :type _request_timeout: int, tuple(int, int), optional
2535
+ :param _request_auth: set to override the auth_settings for an a single
2536
+ request; this effectively ignores the
2537
+ authentication in the spec for a single request.
2538
+ :type _request_auth: dict, optional
2539
+ :param _content_type: force content-type for the request.
2540
+ :type _content_type: str, Optional
2541
+ :param _headers: set to override the headers for a single
2542
+ request; this effectively ignores the headers
2543
+ in the spec for a single request.
2544
+ :type _headers: dict, optional
2545
+ :param _host_index: set to override the host_index for a single
2546
+ request; this effectively ignores the host_index
2547
+ in the spec for a single request.
2548
+ :type _host_index: int, optional
2549
+ :return: Returns the result object.
2550
+ """ # noqa: E501
2551
+
2552
+ _param = self._pull_changes_serialize(
2553
+ request=request,
2554
+ _request_auth=_request_auth,
2555
+ _content_type=_content_type,
2556
+ _headers=_headers,
2557
+ _host_index=_host_index
2558
+ )
2559
+
2560
+ _response_types_map: Dict[str, Optional[str]] = {
2561
+ '200': None,
2562
+ }
2563
+ response_data = self.api_client.call_api(
2564
+ *_param,
2565
+ _request_timeout=_request_timeout
2566
+ )
2567
+ response_data.read()
2568
+ return self.api_client.response_deserialize(
2569
+ response_data=response_data,
2570
+ response_types_map=_response_types_map,
2571
+ )
2572
+
2573
+
2574
+ @validate_call
2575
+ def pull_changes_without_preload_content(
2576
+ self,
2577
+ request: Annotated[GitRepoRequest, Field(description="Pull request")],
2578
+ _request_timeout: Union[
2579
+ None,
2580
+ Annotated[StrictFloat, Field(gt=0)],
2581
+ Tuple[
2582
+ Annotated[StrictFloat, Field(gt=0)],
2583
+ Annotated[StrictFloat, Field(gt=0)]
2584
+ ]
2585
+ ] = None,
2586
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2587
+ _content_type: Optional[StrictStr] = None,
2588
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2589
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2590
+ ) -> RESTResponseType:
2591
+ """Pull changes from remote
2592
+
2593
+ Pull changes from the remote Git repository
2594
+
2595
+ :param request: Pull request (required)
2596
+ :type request: GitRepoRequest
2597
+ :param _request_timeout: timeout setting for this request. If one
2598
+ number provided, it will be total request
2599
+ timeout. It can also be a pair (tuple) of
2600
+ (connection, read) timeouts.
2601
+ :type _request_timeout: int, tuple(int, int), optional
2602
+ :param _request_auth: set to override the auth_settings for an a single
2603
+ request; this effectively ignores the
2604
+ authentication in the spec for a single request.
2605
+ :type _request_auth: dict, optional
2606
+ :param _content_type: force content-type for the request.
2607
+ :type _content_type: str, Optional
2608
+ :param _headers: set to override the headers for a single
2609
+ request; this effectively ignores the headers
2610
+ in the spec for a single request.
2611
+ :type _headers: dict, optional
2612
+ :param _host_index: set to override the host_index for a single
2613
+ request; this effectively ignores the host_index
2614
+ in the spec for a single request.
2615
+ :type _host_index: int, optional
2616
+ :return: Returns the result object.
2617
+ """ # noqa: E501
2618
+
2619
+ _param = self._pull_changes_serialize(
2620
+ request=request,
2621
+ _request_auth=_request_auth,
2622
+ _content_type=_content_type,
2623
+ _headers=_headers,
2624
+ _host_index=_host_index
2625
+ )
2626
+
2627
+ _response_types_map: Dict[str, Optional[str]] = {
2628
+ '200': None,
2629
+ }
2630
+ response_data = self.api_client.call_api(
2631
+ *_param,
2632
+ _request_timeout=_request_timeout
2633
+ )
2634
+ return response_data.response
2635
+
2636
+
2637
+ def _pull_changes_serialize(
2638
+ self,
2639
+ request,
2640
+ _request_auth,
2641
+ _content_type,
2642
+ _headers,
2643
+ _host_index,
2644
+ ) -> RequestSerialized:
2645
+
2646
+ _host = None
2647
+
2648
+ _collection_formats: Dict[str, str] = {
2649
+ }
2650
+
2651
+ _path_params: Dict[str, str] = {}
2652
+ _query_params: List[Tuple[str, str]] = []
2653
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2654
+ _form_params: List[Tuple[str, str]] = []
2655
+ _files: Dict[
2656
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2657
+ ] = {}
2658
+ _body_params: Optional[bytes] = None
2659
+
2660
+ # process the path parameters
2661
+ # process the query parameters
2662
+ # process the header parameters
2663
+ # process the form parameters
2664
+ # process the body parameter
2665
+ if request is not None:
2666
+ _body_params = request
2667
+
2668
+
2669
+
2670
+ # set the HTTP header `Content-Type`
2671
+ if _content_type:
2672
+ _header_params['Content-Type'] = _content_type
2673
+ else:
2674
+ _default_content_type = (
2675
+ self.api_client.select_header_content_type(
2676
+ [
2677
+ 'application/json'
2678
+ ]
2679
+ )
2680
+ )
2681
+ if _default_content_type is not None:
2682
+ _header_params['Content-Type'] = _default_content_type
2683
+
2684
+ # authentication setting
2685
+ _auth_settings: List[str] = [
2686
+ ]
2687
+
2688
+ return self.api_client.param_serialize(
2689
+ method='POST',
2690
+ resource_path='/git/pull',
2691
+ path_params=_path_params,
2692
+ query_params=_query_params,
2693
+ header_params=_header_params,
2694
+ body=_body_params,
2695
+ post_params=_form_params,
2696
+ files=_files,
2697
+ auth_settings=_auth_settings,
2698
+ collection_formats=_collection_formats,
2699
+ _host=_host,
2700
+ _request_auth=_request_auth
2701
+ )
2702
+
2703
+
2704
+
2705
+
2706
+ @validate_call
2707
+ def push_changes(
2708
+ self,
2709
+ request: Annotated[GitRepoRequest, Field(description="Push request")],
2710
+ _request_timeout: Union[
2711
+ None,
2712
+ Annotated[StrictFloat, Field(gt=0)],
2713
+ Tuple[
2714
+ Annotated[StrictFloat, Field(gt=0)],
2715
+ Annotated[StrictFloat, Field(gt=0)]
2716
+ ]
2717
+ ] = None,
2718
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2719
+ _content_type: Optional[StrictStr] = None,
2720
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2721
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2722
+ ) -> None:
2723
+ """Push changes to remote
2724
+
2725
+ Push local changes to the remote Git repository
2726
+
2727
+ :param request: Push request (required)
2728
+ :type request: GitRepoRequest
2729
+ :param _request_timeout: timeout setting for this request. If one
2730
+ number provided, it will be total request
2731
+ timeout. It can also be a pair (tuple) of
2732
+ (connection, read) timeouts.
2733
+ :type _request_timeout: int, tuple(int, int), optional
2734
+ :param _request_auth: set to override the auth_settings for an a single
2735
+ request; this effectively ignores the
2736
+ authentication in the spec for a single request.
2737
+ :type _request_auth: dict, optional
2738
+ :param _content_type: force content-type for the request.
2739
+ :type _content_type: str, Optional
2740
+ :param _headers: set to override the headers for a single
2741
+ request; this effectively ignores the headers
2742
+ in the spec for a single request.
2743
+ :type _headers: dict, optional
2744
+ :param _host_index: set to override the host_index for a single
2745
+ request; this effectively ignores the host_index
2746
+ in the spec for a single request.
2747
+ :type _host_index: int, optional
2748
+ :return: Returns the result object.
2749
+ """ # noqa: E501
2750
+
2751
+ _param = self._push_changes_serialize(
2752
+ request=request,
2753
+ _request_auth=_request_auth,
2754
+ _content_type=_content_type,
2755
+ _headers=_headers,
2756
+ _host_index=_host_index
2757
+ )
2758
+
2759
+ _response_types_map: Dict[str, Optional[str]] = {
2760
+ '200': None,
2761
+ }
2762
+ response_data = self.api_client.call_api(
2763
+ *_param,
2764
+ _request_timeout=_request_timeout
2765
+ )
2766
+ response_data.read()
2767
+ return self.api_client.response_deserialize(
2768
+ response_data=response_data,
2769
+ response_types_map=_response_types_map,
2770
+ ).data
2771
+
2772
+
2773
+ @validate_call
2774
+ def push_changes_with_http_info(
2775
+ self,
2776
+ request: Annotated[GitRepoRequest, Field(description="Push request")],
2777
+ _request_timeout: Union[
2778
+ None,
2779
+ Annotated[StrictFloat, Field(gt=0)],
2780
+ Tuple[
2781
+ Annotated[StrictFloat, Field(gt=0)],
2782
+ Annotated[StrictFloat, Field(gt=0)]
2783
+ ]
2784
+ ] = None,
2785
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2786
+ _content_type: Optional[StrictStr] = None,
2787
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2788
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2789
+ ) -> ApiResponse[None]:
2790
+ """Push changes to remote
2791
+
2792
+ Push local changes to the remote Git repository
2793
+
2794
+ :param request: Push request (required)
2795
+ :type request: GitRepoRequest
2796
+ :param _request_timeout: timeout setting for this request. If one
2797
+ number provided, it will be total request
2798
+ timeout. It can also be a pair (tuple) of
2799
+ (connection, read) timeouts.
2800
+ :type _request_timeout: int, tuple(int, int), optional
2801
+ :param _request_auth: set to override the auth_settings for an a single
2802
+ request; this effectively ignores the
2803
+ authentication in the spec for a single request.
2804
+ :type _request_auth: dict, optional
2805
+ :param _content_type: force content-type for the request.
2806
+ :type _content_type: str, Optional
2807
+ :param _headers: set to override the headers for a single
2808
+ request; this effectively ignores the headers
2809
+ in the spec for a single request.
2810
+ :type _headers: dict, optional
2811
+ :param _host_index: set to override the host_index for a single
2812
+ request; this effectively ignores the host_index
2813
+ in the spec for a single request.
2814
+ :type _host_index: int, optional
2815
+ :return: Returns the result object.
2816
+ """ # noqa: E501
2817
+
2818
+ _param = self._push_changes_serialize(
2819
+ request=request,
2820
+ _request_auth=_request_auth,
2821
+ _content_type=_content_type,
2822
+ _headers=_headers,
2823
+ _host_index=_host_index
2824
+ )
2825
+
2826
+ _response_types_map: Dict[str, Optional[str]] = {
2827
+ '200': None,
2828
+ }
2829
+ response_data = self.api_client.call_api(
2830
+ *_param,
2831
+ _request_timeout=_request_timeout
2832
+ )
2833
+ response_data.read()
2834
+ return self.api_client.response_deserialize(
2835
+ response_data=response_data,
2836
+ response_types_map=_response_types_map,
2837
+ )
2838
+
2839
+
2840
+ @validate_call
2841
+ def push_changes_without_preload_content(
2842
+ self,
2843
+ request: Annotated[GitRepoRequest, Field(description="Push request")],
2844
+ _request_timeout: Union[
2845
+ None,
2846
+ Annotated[StrictFloat, Field(gt=0)],
2847
+ Tuple[
2848
+ Annotated[StrictFloat, Field(gt=0)],
2849
+ Annotated[StrictFloat, Field(gt=0)]
2850
+ ]
2851
+ ] = None,
2852
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2853
+ _content_type: Optional[StrictStr] = None,
2854
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2855
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2856
+ ) -> RESTResponseType:
2857
+ """Push changes to remote
2858
+
2859
+ Push local changes to the remote Git repository
2860
+
2861
+ :param request: Push request (required)
2862
+ :type request: GitRepoRequest
2863
+ :param _request_timeout: timeout setting for this request. If one
2864
+ number provided, it will be total request
2865
+ timeout. It can also be a pair (tuple) of
2866
+ (connection, read) timeouts.
2867
+ :type _request_timeout: int, tuple(int, int), optional
2868
+ :param _request_auth: set to override the auth_settings for an a single
2869
+ request; this effectively ignores the
2870
+ authentication in the spec for a single request.
2871
+ :type _request_auth: dict, optional
2872
+ :param _content_type: force content-type for the request.
2873
+ :type _content_type: str, Optional
2874
+ :param _headers: set to override the headers for a single
2875
+ request; this effectively ignores the headers
2876
+ in the spec for a single request.
2877
+ :type _headers: dict, optional
2878
+ :param _host_index: set to override the host_index for a single
2879
+ request; this effectively ignores the host_index
2880
+ in the spec for a single request.
2881
+ :type _host_index: int, optional
2882
+ :return: Returns the result object.
2883
+ """ # noqa: E501
2884
+
2885
+ _param = self._push_changes_serialize(
2886
+ request=request,
2887
+ _request_auth=_request_auth,
2888
+ _content_type=_content_type,
2889
+ _headers=_headers,
2890
+ _host_index=_host_index
2891
+ )
2892
+
2893
+ _response_types_map: Dict[str, Optional[str]] = {
2894
+ '200': None,
2895
+ }
2896
+ response_data = self.api_client.call_api(
2897
+ *_param,
2898
+ _request_timeout=_request_timeout
2899
+ )
2900
+ return response_data.response
2901
+
2902
+
2903
+ def _push_changes_serialize(
2904
+ self,
2905
+ request,
2906
+ _request_auth,
2907
+ _content_type,
2908
+ _headers,
2909
+ _host_index,
2910
+ ) -> RequestSerialized:
2911
+
2912
+ _host = None
2913
+
2914
+ _collection_formats: Dict[str, str] = {
2915
+ }
2916
+
2917
+ _path_params: Dict[str, str] = {}
2918
+ _query_params: List[Tuple[str, str]] = []
2919
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2920
+ _form_params: List[Tuple[str, str]] = []
2921
+ _files: Dict[
2922
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2923
+ ] = {}
2924
+ _body_params: Optional[bytes] = None
2925
+
2926
+ # process the path parameters
2927
+ # process the query parameters
2928
+ # process the header parameters
2929
+ # process the form parameters
2930
+ # process the body parameter
2931
+ if request is not None:
2932
+ _body_params = request
2933
+
2934
+
2935
+
2936
+ # set the HTTP header `Content-Type`
2937
+ if _content_type:
2938
+ _header_params['Content-Type'] = _content_type
2939
+ else:
2940
+ _default_content_type = (
2941
+ self.api_client.select_header_content_type(
2942
+ [
2943
+ 'application/json'
2944
+ ]
2945
+ )
2946
+ )
2947
+ if _default_content_type is not None:
2948
+ _header_params['Content-Type'] = _default_content_type
2949
+
2950
+ # authentication setting
2951
+ _auth_settings: List[str] = [
2952
+ ]
2953
+
2954
+ return self.api_client.param_serialize(
2955
+ method='POST',
2956
+ resource_path='/git/push',
2957
+ path_params=_path_params,
2958
+ query_params=_query_params,
2959
+ header_params=_header_params,
2960
+ body=_body_params,
2961
+ post_params=_form_params,
2962
+ files=_files,
2963
+ auth_settings=_auth_settings,
2964
+ collection_formats=_collection_formats,
2965
+ _host=_host,
2966
+ _request_auth=_request_auth
2967
+ )
2968
+
2969
+