Skip to content

Commit

Permalink
CodeGen from PR 13494 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
datamigration readme t2 config (Azure#13494)

* datamigration readme t2 config

* datamigration readme change

* datamigration readme change V2

* dataMigration readme change
  • Loading branch information
SDKAuto committed Mar 30, 2021
1 parent a46589f commit 6493a6d
Show file tree
Hide file tree
Showing 21 changed files with 375 additions and 340 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"chosen_version": "2018-07-15-preview",
"total_api_version_list": ["2018-07-15-preview"],
"client": {
"name": "DataMigrationManagementClient",
"filename": "_data_migration_management_client",
"description": "Data Migration Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataMigrationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Identifier of the subscription.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Identifier of the subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"resource_skus": "ResourceSkusOperations",
"services": "ServicesOperations",
"tasks": "TasksOperations",
"service_tasks": "ServiceTasksOperations",
"projects": "ProjectsOperations",
"usages": "UsagesOperations",
"operations": "Operations",
"files": "FilesOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.0.0b1"

VERSION = "0.2.0"
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -182,7 +182,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ProjectFile', pipeline_response)
Expand All @@ -199,8 +199,7 @@ async def create_or_update(
service_name: str,
project_name: str,
file_name: str,
etag: Optional[str] = None,
properties: Optional["_models.ProjectFileProperties"] = None,
parameters: "_models.ProjectFile",
**kwargs
) -> "_models.ProjectFile":
"""Create a file resource.
Expand All @@ -215,10 +214,8 @@ async def create_or_update(
:type project_name: str
:param file_name: Name of the File.
:type file_name: str
:param etag: HTTP strong entity tag value. This is ignored if submitted.
:type etag: str
:param properties: Custom file properties.
:type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties
:param parameters: Information about the file.
:type parameters: ~azure.mgmt.datamigration.models.ProjectFile
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ProjectFile, or the result of cls(response)
:rtype: ~azure.mgmt.datamigration.models.ProjectFile
Expand All @@ -229,8 +226,6 @@ async def create_or_update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_parameters = _models.ProjectFile(etag=etag, properties=properties)
api_version = "2018-07-15-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
Expand All @@ -256,15 +251,15 @@ async def create_or_update(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(_parameters, 'ProjectFile')
body_content = self._serialize.body(parameters, 'ProjectFile')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -337,7 +332,7 @@ async def delete(

if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand All @@ -351,8 +346,7 @@ async def update(
service_name: str,
project_name: str,
file_name: str,
etag: Optional[str] = None,
properties: Optional["_models.ProjectFileProperties"] = None,
parameters: "_models.ProjectFile",
**kwargs
) -> "_models.ProjectFile":
"""Update a file.
Expand All @@ -367,10 +361,8 @@ async def update(
:type project_name: str
:param file_name: Name of the File.
:type file_name: str
:param etag: HTTP strong entity tag value. This is ignored if submitted.
:type etag: str
:param properties: Custom file properties.
:type properties: ~azure.mgmt.datamigration.models.ProjectFileProperties
:param parameters: Information about the file.
:type parameters: ~azure.mgmt.datamigration.models.ProjectFile
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ProjectFile, or the result of cls(response)
:rtype: ~azure.mgmt.datamigration.models.ProjectFile
Expand All @@ -381,8 +373,6 @@ async def update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_parameters = _models.ProjectFile(etag=etag, properties=properties)
api_version = "2018-07-15-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
Expand All @@ -408,15 +398,15 @@ async def update(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(_parameters, 'ProjectFile')
body_content = self._serialize.body(parameters, 'ProjectFile')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **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)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ProjectFile', pipeline_response)
Expand Down Expand Up @@ -486,7 +476,7 @@ async def read(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('FileStorageInfo', pipeline_response)
Expand Down Expand Up @@ -555,7 +545,7 @@ async def read_write(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('FileStorageInfo', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -182,7 +182,7 @@ async def create_or_update(

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -252,7 +252,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Project', pipeline_response)
Expand Down Expand Up @@ -323,7 +323,7 @@ async def delete(

if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -394,7 +394,7 @@ async def update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Project', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ApiError, response)
error = self._deserialize.failsafe_deserialize(_models.ApiError, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Loading

0 comments on commit 6493a6d

Please sign in to comment.