Skip to content

Commit

Permalink
Generated from a177c3ca7cca105c403c676741433ce8ac1b3b92
Browse files Browse the repository at this point in the history
minor changes in descriptions
  • Loading branch information
SDK Automation committed Jul 15, 2020
1 parent bdfb3a2 commit 365ce82
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 16 deletions.
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 @@ -210,6 +210,7 @@ class KeyType(str, Enum):

class AppType(str, Enum):

portal = "portal" #: User create request was sent by legacy developer portal.
developer_portal = "developerPortal" #: User create request was sent by new developer portal.


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 Expand Up @@ -6976,7 +6996,7 @@ class SubscriptionContract(Resource):
value.
:type secondary_key: str
:param state_comment: Optional subscription comment added by an
administrator.
administrator when the state is changed to the 'rejected'.
:type state_comment: str
:param allow_tracing: Determines whether tracing is enabled
:type allow_tracing: bool
Expand Down Expand Up @@ -7183,7 +7203,7 @@ class SubscriptionUpdateParameters(Model):
'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled'
:type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState
:param state_comment: Comments describing subscription state change by the
administrator.
administrator when the state is changed to the 'rejected'.
:type state_comment: str
:param allow_tracing: Determines whether tracing can be enabled
:type allow_tracing: bool
Expand Down Expand Up @@ -7620,7 +7640,7 @@ class UserCreateParameters(Model):
password is generated.
:type password: str
:param app_type: Determines the type of application which send the create
user request. Default is old publisher portal. Possible values include:
user request. Default is legacy portal. Possible values include: 'portal',
'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param confirmation: Determines the type of confirmation e-mail that will
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 Expand Up @@ -6976,7 +6996,7 @@ class SubscriptionContract(Resource):
value.
:type secondary_key: str
:param state_comment: Optional subscription comment added by an
administrator.
administrator when the state is changed to the 'rejected'.
:type state_comment: str
:param allow_tracing: Determines whether tracing is enabled
:type allow_tracing: bool
Expand Down Expand Up @@ -7183,7 +7203,7 @@ class SubscriptionUpdateParameters(Model):
'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled'
:type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState
:param state_comment: Comments describing subscription state change by the
administrator.
administrator when the state is changed to the 'rejected'.
:type state_comment: str
:param allow_tracing: Determines whether tracing can be enabled
:type allow_tracing: bool
Expand Down Expand Up @@ -7620,7 +7640,7 @@ class UserCreateParameters(Model):
password is generated.
:type password: str
:param app_type: Determines the type of application which send the create
user request. Default is old publisher portal. Possible values include:
user request. Default is legacy portal. Possible values include: 'portal',
'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param confirmation: Determines the type of confirmation e-mail that will
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
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'}

def create_or_update(
self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, app_type="portal", custom_headers=None, raw=False, **operation_config):
"""Creates or updates the subscription of specified user to the specified
product.
Expand All @@ -287,6 +287,10 @@ def create_or_update(
:param if_match: ETag of the Entity. Not required when creating an
entity, but required when updating an entity.
:type if_match: str
:param app_type: Determines the type of application which send the
create user request. Default is legacy publisher portal. Possible
values include: 'portal', 'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -313,6 +317,8 @@ def create_or_update(
if notify is not None:
query_parameters['notify'] = self._serialize.query("notify", notify, 'bool')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if app_type is not None:
query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -359,7 +365,7 @@ def create_or_update(
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'}

def update(
self, resource_group_name, service_name, sid, parameters, if_match, notify=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, sid, parameters, if_match, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config):
"""Updates the details of a subscription specified by its identifier.
:param resource_group_name: The name of the resource group.
Expand All @@ -381,6 +387,10 @@ def update(
subscription
- If true, send email notification of change of state of subscription
:type notify: bool
:param app_type: Determines the type of application which send the
create user request. Default is legacy publisher portal. Possible
values include: 'portal', 'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -406,6 +416,8 @@ def update(
if notify is not None:
query_parameters['notify'] = self._serialize.query("notify", notify, 'bool')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if app_type is not None:
query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str')

# Construct headers
header_parameters = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def send(
self, resource_group_name, service_name, user_id, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, user_id, app_type="portal", custom_headers=None, raw=False, **operation_config):
"""Sends confirmation.
:param resource_group_name: The name of the resource group.
Expand All @@ -49,6 +49,10 @@ def send(
:param user_id: User identifier. Must be unique in the current API
Management service instance.
:type user_id: str
:param app_type: Determines the type of application which send the
create user request. Default is legacy publisher portal. Possible
values include: 'portal', 'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -72,6 +76,8 @@ def send(
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if app_type is not None:
query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str')

# Construct headers
header_parameters = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'}

def create_or_update(
self, resource_group_name, service_name, user_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, user_id, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config):
"""Creates or Updates a user.
:param resource_group_name: The name of the resource group.
Expand All @@ -281,6 +281,8 @@ def create_or_update(
:param parameters: Create or update parameters.
:type parameters:
~azure.mgmt.apimanagement.models.UserCreateParameters
:param notify: Send an Email notification to the User.
:type notify: bool
:param if_match: ETag of the Entity. Not required when creating an
entity, but required when updating an entity.
:type if_match: str
Expand All @@ -307,6 +309,8 @@ def create_or_update(

# Construct parameters
query_parameters = {}
if notify is not None:
query_parameters['notify'] = self._serialize.query("notify", notify, 'bool')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
Expand Down Expand Up @@ -422,7 +426,7 @@ def update(
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'}

def delete(
self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config):
"""Deletes specific user.
:param resource_group_name: The name of the resource group.
Expand All @@ -441,6 +445,10 @@ def delete(
:type delete_subscriptions: bool
:param notify: Send an Account Closed Email notification to the User.
:type notify: bool
:param app_type: Determines the type of application which send the
create user request. Default is legacy publisher portal. Possible
values include: 'portal', 'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand Down Expand Up @@ -468,6 +476,8 @@ def delete(
if notify is not None:
query_parameters['notify'] = self._serialize.query("notify", notify, 'bool')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if app_type is not None:
query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str')

# Construct headers
header_parameters = {}
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

0 comments on commit 365ce82

Please sign in to comment.