Skip to content

Commit

Permalink
[AutoPR reservations/resource-manager] Add new reserved resource type…
Browse files Browse the repository at this point in the history
… CosmosDb (#3177)

* Generated from e35a2cd6d6d494556677a36fff18e4a3e6f4faaa

Add new reserved resource type CosmosDb

* Generated from 5401c4a8548e73bec9577c902035e056fbc8657d

Reservations RP 2018-06-01: Add name property in Patch parameter. Remove auto generate Java SDK

* Generated from e9bea317fb008ae36028d5900a56253fd6c8abb5

Reservation RP: Update python package version to 0.2.2
  • Loading branch information
AutorestCI authored Aug 22, 2018
1 parent c50bf85 commit c4069b0
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_catalog(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -136,8 +136,8 @@ def get_catalog(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -186,7 +186,7 @@ def get_applied_reservation_list(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -195,8 +195,8 @@ def get_applied_reservation_list(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class ReservedResourceType(str, Enum):
virtual_machines = "VirtualMachines"
sql_databases = "SqlDatabases"
suse_linux = "SuseLinux"
cosmos_db = "CosmosDb"


class InstanceFlexibility(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ class Patch(Model):
'NotSupported'
:type instance_flexibility: str or
~azure.mgmt.reservations.models.InstanceFlexibility
:param name: Name of the Reservation
:type name: str
"""

_attribute_map = {
'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'},
'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'},
'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'},
'name': {'key': 'properties.name', 'type': 'str'},
}

def __init__(self, **kwargs):
super(Patch, self).__init__(**kwargs)
self.applied_scope_type = kwargs.get('applied_scope_type', None)
self.applied_scopes = kwargs.get('applied_scopes', None)
self.instance_flexibility = kwargs.get('instance_flexibility', None)
self.name = kwargs.get('name', None)
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ class Patch(Model):
'NotSupported'
:type instance_flexibility: str or
~azure.mgmt.reservations.models.InstanceFlexibility
:param name: Name of the Reservation
:type name: str
"""

_attribute_map = {
'applied_scope_type': {'key': 'properties.appliedScopeType', 'type': 'str'},
'applied_scopes': {'key': 'properties.appliedScopes', 'type': '[str]'},
'instance_flexibility': {'key': 'properties.instanceFlexibility', 'type': 'str'},
'name': {'key': 'properties.name', 'type': 'str'},
}

def __init__(self, *, applied_scope_type=None, applied_scopes=None, instance_flexibility=None, **kwargs) -> None:
def __init__(self, *, applied_scope_type=None, applied_scopes=None, instance_flexibility=None, name: str=None, **kwargs) -> None:
super(Patch, self).__init__(**kwargs)
self.applied_scope_type = applied_scope_type
self.applied_scopes = applied_scopes
self.instance_flexibility = instance_flexibility
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ReservationProperties(Model):
sending a request.
:param reserved_resource_type: Possible values include: 'VirtualMachines',
'SqlDatabases', 'SuseLinux'
'SqlDatabases', 'SuseLinux', 'CosmosDb'
:type reserved_resource_type: str or
~azure.mgmt.reservations.models.ReservedResourceType
:param instance_flexibility: Possible values include: 'On', 'Off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ReservationProperties(Model):
sending a request.
:param reserved_resource_type: Possible values include: 'VirtualMachines',
'SqlDatabases', 'SuseLinux'
'SqlDatabases', 'SuseLinux', 'CosmosDb'
:type reserved_resource_type: str or
~azure.mgmt.reservations.models.ReservedResourceType
:param instance_flexibility: Possible values include: 'On', 'Off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -78,9 +78,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _split_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -68,9 +69,8 @@ def _split_initial(
body_content = self._serialize.body(body, 'SplitRequest')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -162,6 +162,7 @@ def _merge_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -174,9 +175,8 @@ def _merge_initial(
body_content = self._serialize.body(body, 'MergeRequest')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -283,7 +283,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -292,9 +292,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -347,7 +346,7 @@ def get(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -356,8 +355,8 @@ def get(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -391,6 +390,7 @@ def _update_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -403,9 +403,8 @@ def _update_initial(
body_content = self._serialize.body(parameters, 'Patch')

# Construct and send request
request = self._client.patch(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -517,7 +516,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -526,9 +525,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -79,9 +79,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down Expand Up @@ -131,7 +130,7 @@ def get(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -140,8 +139,8 @@ def get(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise models.ErrorException(self._deserialize, response)
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-reservations/azure/mgmt/reservations/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.2.1"
VERSION = "0.2.2"

0 comments on commit c4069b0

Please sign in to comment.