Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
from ._models_py3 import QuotaCounterContract
from ._models_py3 import QuotaCounterValueContract
from ._models_py3 import QuotaCounterValueContractProperties
from ._models_py3 import QuotaCounterValueUpdateContract
from ._models_py3 import RecipientEmailCollection
from ._models_py3 import RecipientEmailContract
from ._models_py3 import RecipientsContractProperties
Expand Down Expand Up @@ -306,6 +307,7 @@
from ._models import QuotaCounterContract
from ._models import QuotaCounterValueContract
from ._models import QuotaCounterValueContractProperties
from ._models import QuotaCounterValueUpdateContract
from ._models import RecipientEmailCollection
from ._models import RecipientEmailContract
from ._models import RecipientsContractProperties
Expand Down Expand Up @@ -557,6 +559,7 @@
'QuotaCounterContract',
'QuotaCounterValueContract',
'QuotaCounterValueContractProperties',
'QuotaCounterValueUpdateContract',
'RecipientEmailCollection',
'RecipientEmailContract',
'RecipientsContractProperties',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6142,6 +6142,26 @@ def __init__(self, **kwargs):
self.kb_transferred = kwargs.get('kb_transferred', None)


class QuotaCounterValueUpdateContract(Model):
"""Quota counter value details.

:param calls_count: Number of times Counter was called.
:type calls_count: int
:param kb_transferred: Data Transferred in KiloBytes.
:type kb_transferred: float
"""

_attribute_map = {
'calls_count': {'key': 'properties.callsCount', 'type': 'int'},
'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'},
}

def __init__(self, **kwargs):
super(QuotaCounterValueUpdateContract, self).__init__(**kwargs)
self.calls_count = kwargs.get('calls_count', None)
self.kb_transferred = kwargs.get('kb_transferred', None)


class RecipientEmailCollection(Model):
"""Paged Recipient User list representation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6142,6 +6142,26 @@ def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwarg
self.kb_transferred = kb_transferred


class QuotaCounterValueUpdateContract(Model):
"""Quota counter value details.

:param calls_count: Number of times Counter was called.
:type calls_count: int
:param kb_transferred: Data Transferred in KiloBytes.
:type kb_transferred: float
"""

_attribute_map = {
'calls_count': {'key': 'properties.callsCount', 'type': 'int'},
'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'},
}

def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None:
super(QuotaCounterValueUpdateContract, self).__init__(**kwargs)
self.calls_count = calls_count
self.kb_transferred = kb_transferred


class RecipientEmailCollection(Model):
"""Paged Recipient User list representation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def update(
:raises:
:class:`ErrorResponseException<azure.mgmt.apimanagement.models.ErrorResponseException>`
"""
parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred)
parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred)

# Construct URL
url = self.update.metadata['url']
Expand All @@ -166,7 +166,7 @@ def update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties')
body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract')

# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def update(
:raises:
:class:`ErrorResponseException<azure.mgmt.apimanagement.models.ErrorResponseException>`
"""
parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred)
parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred)

# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -170,7 +170,7 @@ def update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties')
body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract')

# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
Expand Down
4 changes: 3 additions & 1 deletion sdk/apimanagement/azure-mgmt-apimanagement/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
pass

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd:
with open(os.path.join(package_folder_path, 'version.py')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

Expand Down