|
28 | 28 |
|
29 | 29 | from ... import models as _models |
30 | 30 | from ...operations._factories_operations import ( |
31 | | - build_configure_factory_repo_request, |
32 | 31 | build_create_or_update_request, |
33 | 32 | build_delete_request, |
34 | 33 | build_get_data_plane_access_request, |
35 | 34 | build_get_git_hub_access_token_request, |
36 | 35 | build_get_request, |
37 | 36 | build_list_by_resource_group_request, |
38 | | - build_list_request, |
39 | 37 | build_update_request, |
40 | 38 | ) |
41 | 39 |
|
@@ -66,189 +64,6 @@ def __init__(self, *args, **kwargs) -> None: |
66 | 64 | self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") |
67 | 65 | self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") |
68 | 66 |
|
69 | | - @distributed_trace |
70 | | - def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]: |
71 | | - """Lists factories under the specified subscription. |
72 | | -
|
73 | | - :return: An iterator like instance of either Factory or the result of cls(response) |
74 | | - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] |
75 | | - :raises ~azure.core.exceptions.HttpResponseError: |
76 | | - """ |
77 | | - _headers = kwargs.pop("headers", {}) or {} |
78 | | - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) |
79 | | - |
80 | | - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) |
81 | | - cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None) |
82 | | - |
83 | | - error_map: MutableMapping = { |
84 | | - 401: ClientAuthenticationError, |
85 | | - 404: ResourceNotFoundError, |
86 | | - 409: ResourceExistsError, |
87 | | - 304: ResourceNotModifiedError, |
88 | | - } |
89 | | - error_map.update(kwargs.pop("error_map", {}) or {}) |
90 | | - |
91 | | - def prepare_request(next_link=None): |
92 | | - if not next_link: |
93 | | - |
94 | | - _request = build_list_request( |
95 | | - subscription_id=self._config.subscription_id, |
96 | | - api_version=api_version, |
97 | | - headers=_headers, |
98 | | - params=_params, |
99 | | - ) |
100 | | - _request.url = self._client.format_url(_request.url) |
101 | | - |
102 | | - else: |
103 | | - # make call to next link with the client's api-version |
104 | | - _parsed_next_link = urllib.parse.urlparse(next_link) |
105 | | - _next_request_params = case_insensitive_dict( |
106 | | - { |
107 | | - key: [urllib.parse.quote(v) for v in value] |
108 | | - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() |
109 | | - } |
110 | | - ) |
111 | | - _next_request_params["api-version"] = self._config.api_version |
112 | | - _request = HttpRequest( |
113 | | - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params |
114 | | - ) |
115 | | - _request.url = self._client.format_url(_request.url) |
116 | | - _request.method = "GET" |
117 | | - return _request |
118 | | - |
119 | | - async def extract_data(pipeline_response): |
120 | | - deserialized = self._deserialize("FactoryListResponse", pipeline_response) |
121 | | - list_of_elem = deserialized.value |
122 | | - if cls: |
123 | | - list_of_elem = cls(list_of_elem) # type: ignore |
124 | | - return deserialized.next_link or None, AsyncList(list_of_elem) |
125 | | - |
126 | | - async def get_next(next_link=None): |
127 | | - _request = prepare_request(next_link) |
128 | | - |
129 | | - _stream = False |
130 | | - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
131 | | - _request, stream=_stream, **kwargs |
132 | | - ) |
133 | | - response = pipeline_response.http_response |
134 | | - |
135 | | - if response.status_code not in [200]: |
136 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) |
137 | | - raise HttpResponseError(response=response, error_format=ARMErrorFormat) |
138 | | - |
139 | | - return pipeline_response |
140 | | - |
141 | | - return AsyncItemPaged(get_next, extract_data) |
142 | | - |
143 | | - @overload |
144 | | - async def configure_factory_repo( |
145 | | - self, |
146 | | - location_id: str, |
147 | | - factory_repo_update: _models.FactoryRepoUpdate, |
148 | | - *, |
149 | | - content_type: str = "application/json", |
150 | | - **kwargs: Any |
151 | | - ) -> _models.Factory: |
152 | | - """Updates a factory's repo information. |
153 | | -
|
154 | | - :param location_id: The location identifier. Required. |
155 | | - :type location_id: str |
156 | | - :param factory_repo_update: Update factory repo request definition. Required. |
157 | | - :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate |
158 | | - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
159 | | - Default value is "application/json". |
160 | | - :paramtype content_type: str |
161 | | - :return: Factory or the result of cls(response) |
162 | | - :rtype: ~azure.mgmt.datafactory.models.Factory |
163 | | - :raises ~azure.core.exceptions.HttpResponseError: |
164 | | - """ |
165 | | - |
166 | | - @overload |
167 | | - async def configure_factory_repo( |
168 | | - self, location_id: str, factory_repo_update: IO[bytes], *, content_type: str = "application/json", **kwargs: Any |
169 | | - ) -> _models.Factory: |
170 | | - """Updates a factory's repo information. |
171 | | -
|
172 | | - :param location_id: The location identifier. Required. |
173 | | - :type location_id: str |
174 | | - :param factory_repo_update: Update factory repo request definition. Required. |
175 | | - :type factory_repo_update: IO[bytes] |
176 | | - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
177 | | - Default value is "application/json". |
178 | | - :paramtype content_type: str |
179 | | - :return: Factory or the result of cls(response) |
180 | | - :rtype: ~azure.mgmt.datafactory.models.Factory |
181 | | - :raises ~azure.core.exceptions.HttpResponseError: |
182 | | - """ |
183 | | - |
184 | | - @distributed_trace_async |
185 | | - async def configure_factory_repo( |
186 | | - self, location_id: str, factory_repo_update: Union[_models.FactoryRepoUpdate, IO[bytes]], **kwargs: Any |
187 | | - ) -> _models.Factory: |
188 | | - """Updates a factory's repo information. |
189 | | -
|
190 | | - :param location_id: The location identifier. Required. |
191 | | - :type location_id: str |
192 | | - :param factory_repo_update: Update factory repo request definition. Is either a |
193 | | - FactoryRepoUpdate type or a IO[bytes] type. Required. |
194 | | - :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate or IO[bytes] |
195 | | - :return: Factory or the result of cls(response) |
196 | | - :rtype: ~azure.mgmt.datafactory.models.Factory |
197 | | - :raises ~azure.core.exceptions.HttpResponseError: |
198 | | - """ |
199 | | - error_map: MutableMapping = { |
200 | | - 401: ClientAuthenticationError, |
201 | | - 404: ResourceNotFoundError, |
202 | | - 409: ResourceExistsError, |
203 | | - 304: ResourceNotModifiedError, |
204 | | - } |
205 | | - error_map.update(kwargs.pop("error_map", {}) or {}) |
206 | | - |
207 | | - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
208 | | - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) |
209 | | - |
210 | | - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) |
211 | | - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
212 | | - cls: ClsType[_models.Factory] = kwargs.pop("cls", None) |
213 | | - |
214 | | - content_type = content_type or "application/json" |
215 | | - _json = None |
216 | | - _content = None |
217 | | - if isinstance(factory_repo_update, (IOBase, bytes)): |
218 | | - _content = factory_repo_update |
219 | | - else: |
220 | | - _json = self._serialize.body(factory_repo_update, "FactoryRepoUpdate") |
221 | | - |
222 | | - _request = build_configure_factory_repo_request( |
223 | | - location_id=location_id, |
224 | | - subscription_id=self._config.subscription_id, |
225 | | - api_version=api_version, |
226 | | - content_type=content_type, |
227 | | - json=_json, |
228 | | - content=_content, |
229 | | - headers=_headers, |
230 | | - params=_params, |
231 | | - ) |
232 | | - _request.url = self._client.format_url(_request.url) |
233 | | - |
234 | | - _stream = False |
235 | | - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
236 | | - _request, stream=_stream, **kwargs |
237 | | - ) |
238 | | - |
239 | | - response = pipeline_response.http_response |
240 | | - |
241 | | - if response.status_code not in [200]: |
242 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) |
243 | | - raise HttpResponseError(response=response, error_format=ARMErrorFormat) |
244 | | - |
245 | | - deserialized = self._deserialize("Factory", pipeline_response.http_response) |
246 | | - |
247 | | - if cls: |
248 | | - return cls(pipeline_response, deserialized, {}) # type: ignore |
249 | | - |
250 | | - return deserialized # type: ignore |
251 | | - |
252 | 67 | @distributed_trace |
253 | 68 | def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Factory"]: |
254 | 69 | """Lists factories. |
|
0 commit comments