diff --git a/sdk/datafactory/azure-mgmt-datafactory/_meta.json b/sdk/datafactory/azure-mgmt-datafactory/_meta.json index 3f4096569772d..a334cc223f444 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/_meta.json +++ b/sdk/datafactory/azure-mgmt-datafactory/_meta.json @@ -1,11 +1,11 @@ { - "commit": "9716e0c05a8c278ea44d8aa3f3b8ece46fb62ba2", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "commit": "1cd68b408db128963f7698834e4f2a054a214c42", + "repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs", "autorest": "3.9.7", "use": [ "@autorest/python@6.13.7", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/datafactory/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", "readme": "specification/datafactory/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py index 364f3c906cf92..c47f66669f1bf 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py +++ b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "1.0.0" diff --git a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_factories_operations.py b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_factories_operations.py index a5bb31530f815..7d335835dc40d 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_factories_operations.py +++ b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_factories_operations.py @@ -37,7 +37,6 @@ build_get_git_hub_access_token_request, build_get_request, build_list_by_resource_group_request, - build_list_request, build_update_request, ) @@ -64,82 +63,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]: - """Lists factories under the specified subscription. - - :return: An iterator like instance of either Factory or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FactoryListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @overload async def configure_factory_repo( self, diff --git a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_data_factory_management_client_enums.py b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_data_factory_management_client_enums.py index 2fe4bd990915b..df58de60e93e3 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_data_factory_management_client_enums.py +++ b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_data_factory_management_client_enums.py @@ -809,7 +809,7 @@ class ScriptActivityParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ScriptType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the query. Type: string.""" + """The type of the ScriptActivityScriptBlock.""" QUERY = "Query" NON_QUERY = "NonQuery" diff --git a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_models_py3.py b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_models_py3.py index 99497f15aa467..a2e77aff6c20c 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_models_py3.py +++ b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/_models_py3.py @@ -38765,6 +38765,8 @@ class ManagedIdentityCredential(Credential): :vartype description: str :ivar annotations: List of tags that can be used for describing the Credential. :vartype annotations: list[JSON] + :ivar resource_id: The resource id of user assigned managed identity. + :vartype resource_id: str """ _validation = { @@ -38776,6 +38778,7 @@ class ManagedIdentityCredential(Credential): "type": {"key": "type", "type": "str"}, "description": {"key": "description", "type": "str"}, "annotations": {"key": "annotations", "type": "[object]"}, + "resource_id": {"key": "typeProperties.resourceId", "type": "str"}, } def __init__( @@ -38784,6 +38787,7 @@ def __init__( additional_properties: Optional[Dict[str, JSON]] = None, description: Optional[str] = None, annotations: Optional[List[JSON]] = None, + resource_id: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -38794,11 +38798,14 @@ def __init__( :paramtype description: str :keyword annotations: List of tags that can be used for describing the Credential. :paramtype annotations: list[JSON] + :keyword resource_id: The resource id of user assigned managed identity. + :paramtype resource_id: str """ super().__init__( additional_properties=additional_properties, description=description, annotations=annotations, **kwargs ) self.type: str = "ManagedIdentity" + self.resource_id = resource_id class ManagedIdentityCredentialResource(CredentialResource): @@ -57548,9 +57555,9 @@ class ScriptActivityScriptBlock(_serialization.Model): :ivar text: The query text. Type: string (or Expression with resultType string). Required. :vartype text: JSON - :ivar type: The type of the query. Type: string. Required. Known values are: "Query" and - "NonQuery". - :vartype type: str or ~azure.mgmt.datafactory.models.ScriptType + :ivar type: The type of the query. Please refer to the ScriptType for valid options. Type: + string (or Expression with resultType string). Required. + :vartype type: JSON :ivar parameters: Array of script parameters. Type: array. :vartype parameters: list[~azure.mgmt.datafactory.models.ScriptActivityParameter] """ @@ -57562,7 +57569,7 @@ class ScriptActivityScriptBlock(_serialization.Model): _attribute_map = { "text": {"key": "text", "type": "object"}, - "type": {"key": "type", "type": "str"}, + "type": {"key": "type", "type": "object"}, "parameters": {"key": "parameters", "type": "[ScriptActivityParameter]"}, } @@ -57570,16 +57577,16 @@ def __init__( self, *, text: JSON, - type: Union[str, "_models.ScriptType"], + type: JSON, parameters: Optional[List["_models.ScriptActivityParameter"]] = None, **kwargs: Any ) -> None: """ :keyword text: The query text. Type: string (or Expression with resultType string). Required. :paramtype text: JSON - :keyword type: The type of the query. Type: string. Required. Known values are: "Query" and - "NonQuery". - :paramtype type: str or ~azure.mgmt.datafactory.models.ScriptType + :keyword type: The type of the query. Please refer to the ScriptType for valid options. Type: + string (or Expression with resultType string). Required. + :paramtype type: JSON :keyword parameters: Array of script parameters. Type: array. :paramtype parameters: list[~azure.mgmt.datafactory.models.ScriptActivityParameter] """ diff --git a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/_factories_operations.py b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/_factories_operations.py index b10df683bb5d1..d1e0ec4cb3eca 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/_factories_operations.py +++ b/sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/_factories_operations.py @@ -37,30 +37,6 @@ _SERIALIZER.client_side_validation = False -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_configure_factory_repo_request(location_id: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -402,82 +378,6 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Factory"]: - """Lists factories under the specified subscription. - - :return: An iterator like instance of either Factory or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.datafactory.models.Factory] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FactoryListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @overload def configure_factory_repo( self, diff --git a/sdk/datafactory/azure-mgmt-datafactory/generated_samples/factories_list.py b/sdk/datafactory/azure-mgmt-datafactory/generated_samples/factories_list.py deleted file mode 100644 index eea9551b7ce05..0000000000000 --- a/sdk/datafactory/azure-mgmt-datafactory/generated_samples/factories_list.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.datafactory import DataFactoryManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-datafactory -# USAGE - python factories_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataFactoryManagementClient( - credential=DefaultAzureCredential(), - subscription_id="12345678-1234-1234-1234-12345678abc", - ) - - response = client.factories.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/Factories_List.json -if __name__ == "__main__": - main()