daytona_toolbox_api_client 0.102.0rc2__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.

Potentially problematic release.


This version of daytona_toolbox_api_client might be problematic. Click here for more details.

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