Skip to content

Commit

Permalink
CodeGen from PR 14365 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 0ceaffba972ebba0153a6c052f4336d9c918d0ba into 19e140f
  • Loading branch information
SDKAuto committed May 18, 2021
1 parent ef56f99 commit b5ea30b
Show file tree
Hide file tree
Showing 38 changed files with 1,436 additions and 437 deletions.
1 change: 1 addition & 0 deletions sdk/netapp/azure-mgmt-netapp/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/netapp/azure-mgmt-netapp/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.4.2",
"use": "@autorest/[email protected]",
"commit": "39e235e88ce40f63f77a6038dd2191cff8798e5d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/netapp/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.4.2",
"readme": "specification/netapp/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
70 changes: 56 additions & 14 deletions sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2020-12-01",
"total_api_version_list": ["2020-12-01"],
"chosen_version": "2021-04-01",
"total_api_version_list": ["2021-04-01"],
"client": {
"name": "NetAppManagementClient",
"filename": "_net_app_management_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": 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\": [\"NetAppManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"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\": [\"NetAppManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,28 +30,72 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"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, # type: str",
"signature": "subscription_id: str,",
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"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
"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": {
"operations": "Operations",
Expand All @@ -59,14 +105,10 @@
"volumes": "VolumesOperations",
"snapshots": "SnapshotsOperations",
"snapshot_policies": "SnapshotPoliciesOperations",
"volume_backup_status": "VolumeBackupStatusOperations",
"account_backups": "AccountBackupsOperations",
"backups": "BackupsOperations",
"volume_restore_status": "VolumeRestoreStatusOperations",
"account_backups": "AccountBackupsOperations",
"backup_policies": "BackupPoliciesOperations",
"vaults": "VaultsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import NetAppManagementClientConfiguration
from .operations import Operations
Expand All @@ -25,9 +26,9 @@
from .operations import VolumesOperations
from .operations import SnapshotsOperations
from .operations import SnapshotPoliciesOperations
from .operations import VolumeBackupStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupsOperations
from .operations import VolumeRestoreStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupPoliciesOperations
from .operations import VaultsOperations
from . import models
Expand All @@ -50,12 +51,12 @@ class NetAppManagementClient(object):
:vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations
:ivar snapshot_policies: SnapshotPoliciesOperations operations
:vartype snapshot_policies: azure.mgmt.netapp.operations.SnapshotPoliciesOperations
:ivar volume_backup_status: VolumeBackupStatusOperations operations
:vartype volume_backup_status: azure.mgmt.netapp.operations.VolumeBackupStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations
:ivar backups: BackupsOperations operations
:vartype backups: azure.mgmt.netapp.operations.BackupsOperations
:ivar volume_restore_status: VolumeRestoreStatusOperations operations
:vartype volume_restore_status: azure.mgmt.netapp.operations.VolumeRestoreStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations
:ivar backup_policies: BackupPoliciesOperations operations
:vartype backup_policies: azure.mgmt.netapp.operations.BackupPoliciesOperations
:ivar vaults: VaultsOperations operations
Expand Down Expand Up @@ -83,6 +84,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.operations = Operations(
Expand All @@ -99,17 +101,35 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.snapshot_policies = SnapshotPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.volume_backup_status = VolumeBackupStatusOperations(
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.account_backups = AccountBackupsOperations(
self.volume_restore_status = VolumeRestoreStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backups = BackupsOperations(
self.account_backups = AccountBackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backup_policies = BackupPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.vaults = VaultsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
2 changes: 1 addition & 1 deletion sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0"
VERSION = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -23,9 +24,9 @@
from .operations import VolumesOperations
from .operations import SnapshotsOperations
from .operations import SnapshotPoliciesOperations
from .operations import VolumeBackupStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupsOperations
from .operations import VolumeRestoreStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupPoliciesOperations
from .operations import VaultsOperations
from .. import models
Expand All @@ -48,12 +49,12 @@ class NetAppManagementClient(object):
:vartype snapshots: azure.mgmt.netapp.aio.operations.SnapshotsOperations
:ivar snapshot_policies: SnapshotPoliciesOperations operations
:vartype snapshot_policies: azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations
:ivar volume_backup_status: VolumeBackupStatusOperations operations
:vartype volume_backup_status: azure.mgmt.netapp.aio.operations.VolumeBackupStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations
:ivar backups: BackupsOperations operations
:vartype backups: azure.mgmt.netapp.aio.operations.BackupsOperations
:ivar volume_restore_status: VolumeRestoreStatusOperations operations
:vartype volume_restore_status: azure.mgmt.netapp.aio.operations.VolumeRestoreStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations
:ivar backup_policies: BackupPoliciesOperations operations
:vartype backup_policies: azure.mgmt.netapp.aio.operations.BackupPoliciesOperations
:ivar vaults: VaultsOperations operations
Expand All @@ -80,6 +81,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.operations = Operations(
Expand All @@ -96,17 +98,34 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.snapshot_policies = SnapshotPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.volume_backup_status = VolumeBackupStatusOperations(
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.account_backups = AccountBackupsOperations(
self.volume_restore_status = VolumeRestoreStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backups = BackupsOperations(
self.account_backups = AccountBackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backup_policies = BackupPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.vaults = VaultsOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from ._volumes_operations import VolumesOperations
from ._snapshots_operations import SnapshotsOperations
from ._snapshot_policies_operations import SnapshotPoliciesOperations
from ._volume_backup_status_operations import VolumeBackupStatusOperations
from ._account_backups_operations import AccountBackupsOperations
from ._backups_operations import BackupsOperations
from ._volume_restore_status_operations import VolumeRestoreStatusOperations
from ._account_backups_operations import AccountBackupsOperations
from ._backup_policies_operations import BackupPoliciesOperations
from ._vaults_operations import VaultsOperations

Expand All @@ -27,9 +27,9 @@
'VolumesOperations',
'SnapshotsOperations',
'SnapshotPoliciesOperations',
'VolumeBackupStatusOperations',
'AccountBackupsOperations',
'BackupsOperations',
'VolumeRestoreStatusOperations',
'AccountBackupsOperations',
'BackupPoliciesOperations',
'VaultsOperations',
]
Loading

0 comments on commit b5ea30b

Please sign in to comment.