Skip to content

Commit

Permalink
[AutoPR] managedservices/resource-manager (#5751)
Browse files Browse the repository at this point in the history
* [AutoPR managedservices/resource-manager] [Hub Generated] Review request for Microsoft.ManagedServices to add version preview/2019-04-01-preview (#5609)

* Generated from 2aa8d70a5f867f439b78630358b37612482b3ace

Resolved review comments by Sanjai

1. Updated version
2. Removed Operationstatus

* Generated from 88d2323d3bfdeb3ed538c0c6effaca39a7daaaae

Changed Modelasstring to true as per the suggestion

* Generated from 3b9325ed981570e2bf21101c7fde24b04e923cea (#6013)

Updates API version in new specs and examples

* Generated from 8c4c188a1c86c8a466f7b37afce0f87d069b2926 (#6209)

API version is a client constant

* Packaging update of azure-mgmt-managedservices

* Updated ManagedServices tests for 2019-06-01 (#6235)

* Update ManagedServices tests for 2019-06-01

* Update HISTORY.rst

* Make test anonymous
  • Loading branch information
AutorestCI authored and lmazuel committed Jul 5, 2019
1 parent 9b40ff7 commit db59efd
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 210 deletions.
6 changes: 6 additions & 0 deletions sdk/managedservices/azure-mgmt-managedservices/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
Release History
===============

1.0.0 (2019-07-05)
++++++++++++++++++

* GA Release

0.1.0 (2019-05-14)
++++++++++++++++++

* Initial Release

2 changes: 1 addition & 1 deletion sdk/managedservices/azure-mgmt-managedservices/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Managed Services Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
super(ManagedServicesClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-06-01-preview'
self.api_version = '2019-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RegistrationAssignmentProperties(Model):

_attribute_map = {
'registration_definition_id': {'key': 'registrationDefinitionId', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'registration_definition': {'key': 'registrationDefinition', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinition'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RegistrationAssignmentProperties(Model):

_attribute_map = {
'registration_definition_id': {'key': 'registrationDefinitionId', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'registration_definition': {'key': 'registrationDefinition', 'type': 'RegistrationAssignmentPropertiesRegistrationDefinition'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RegistrationAssignmentPropertiesRegistrationDefinitionProperties(Model):
'description': {'key': 'description', 'type': 'str'},
'authorizations': {'key': 'authorizations', 'type': '[Authorization]'},
'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'managee_tenant_id': {'key': 'manageeTenantId', 'type': 'str'},
'managee_tenant_name': {'key': 'manageeTenantName', 'type': 'str'},
'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RegistrationAssignmentPropertiesRegistrationDefinitionProperties(Model):
'description': {'key': 'description', 'type': 'str'},
'authorizations': {'key': 'authorizations', 'type': '[Authorization]'},
'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'managee_tenant_id': {'key': 'manageeTenantId', 'type': 'str'},
'managee_tenant_name': {'key': 'manageeTenantName', 'type': 'str'},
'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RegistrationDefinitionProperties(Model):
'authorizations': {'key': 'authorizations', 'type': '[Authorization]'},
'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'},
'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RegistrationDefinitionProperties(Model):
'authorizations': {'key': 'authorizations', 'type': '[Authorization]'},
'registration_definition_name': {'key': 'registrationDefinitionName', 'type': 'str'},
'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'ProvisioningState'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'managed_by_tenant_name': {'key': 'managedByTenantName', 'type': 'str'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Operations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to use for this operation. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -31,15 +32,14 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-06-01"

self.config = config

def list(
self, api_version, custom_headers=None, raw=False, **operation_config):
self, custom_headers=None, raw=False, **operation_config):
"""Gets a list of the operations.
:param api_version: The API version to use for this operation.
:type api_version: str
: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 @@ -56,7 +56,7 @@ def list(

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling

from .. import models

Expand All @@ -22,6 +24,7 @@ class RegistrationAssignmentsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to use for this operation. Constant value: "2019-06-01".
"""

models = models
Expand All @@ -31,20 +34,19 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-06-01"

self.config = config

def get(
self, scope, registration_assignment_id, api_version, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config):
self, scope, registration_assignment_id, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config):
"""Gets the details of specified registration assignment.
:param scope: Scope of the resource.
:type scope: str
:param registration_assignment_id: Guid of the registration
assignment.
:type registration_assignment_id: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param expand_registration_definition: Tells whether to return
registration definition details also along with registration
assignment details.
Expand Down Expand Up @@ -72,7 +74,7 @@ def get(
query_parameters = {}
if expand_registration_definition is not None:
query_parameters['$expandRegistrationDefinition'] = self._serialize.query("expand_registration_definition", expand_registration_definition, 'bool')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -103,28 +105,9 @@ def get(
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'}

def delete(
self, scope, registration_assignment_id, api_version, custom_headers=None, raw=False, **operation_config):
"""Deletes the specified registration assignment.

:param scope: Scope of the resource.
:type scope: str
:param registration_assignment_id: Guid of the registration
assignment.
:type registration_assignment_id: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: RegistrationAssignment or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.managedservices.models.RegistrationAssignment or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.managedservices.models.ErrorResponseException>`
"""
def _delete_initial(
self, scope, registration_assignment_id, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
Expand All @@ -135,11 +118,10 @@ def delete(

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
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 @@ -151,46 +133,59 @@ def delete(
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 204]:
if response.status_code not in [200, 202, 204]:
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('RegistrationAssignment', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

return deserialized
delete.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'}

def create_or_update(
self, scope, registration_assignment_id, api_version, properties=None, custom_headers=None, raw=False, **operation_config):
"""Creates or updates a registration assignment.
def delete(
self, scope, registration_assignment_id, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes the specified registration assignment.
:param scope: Scope of the resource.
:type scope: str
:param registration_assignment_id: Guid of the registration
assignment.
:type registration_assignment_id: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param properties: Properties of a registration assignment.
:type properties:
~azure.mgmt.managedservices.models.RegistrationAssignmentProperties
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: RegistrationAssignment or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.managedservices.models.RegistrationAssignment or
~msrest.pipeline.ClientRawResponse
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<azure.mgmt.managedservices.models.ErrorResponseException>`
"""
raw_result = self._delete_initial(
scope=scope,
registration_assignment_id=registration_assignment_id,
custom_headers=custom_headers,
raw=True,
**operation_config
)

def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'}


def _create_or_update_initial(
self, scope, registration_assignment_id, properties=None, custom_headers=None, raw=False, **operation_config):
request_body = models.RegistrationAssignment(properties=properties)

# Construct URL
Expand All @@ -203,7 +198,7 @@ def create_or_update(

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -238,16 +233,66 @@ def create_or_update(
return client_raw_response

return deserialized

def create_or_update(
self, scope, registration_assignment_id, properties=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates or updates a registration assignment.
:param scope: Scope of the resource.
:type scope: str
:param registration_assignment_id: Guid of the registration
assignment.
:type registration_assignment_id: str
:param properties: Properties of a registration assignment.
:type properties:
~azure.mgmt.managedservices.models.RegistrationAssignmentProperties
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns RegistrationAssignment
or ClientRawResponse<RegistrationAssignment> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.managedservices.models.RegistrationAssignment]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.managedservices.models.RegistrationAssignment]]
:raises:
:class:`ErrorResponseException<azure.mgmt.managedservices.models.ErrorResponseException>`
"""
raw_result = self._create_or_update_initial(
scope=scope,
registration_assignment_id=registration_assignment_id,
properties=properties,
custom_headers=custom_headers,
raw=True,
**operation_config
)

def get_long_running_output(response):
deserialized = self._deserialize('RegistrationAssignment', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}'}

def list(
self, scope, api_version, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config):
self, scope, expand_registration_definition=None, custom_headers=None, raw=False, **operation_config):
"""Gets a list of the registration assignments.
:param scope: Scope of the resource.
:type scope: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param expand_registration_definition: Tells whether to return
registration definition details also along with registration
assignment details.
Expand Down Expand Up @@ -277,7 +322,7 @@ def internal_paging(next_link=None, raw=False):
query_parameters = {}
if expand_registration_definition is not None:
query_parameters['$expandRegistrationDefinition'] = self._serialize.query("expand_registration_definition", expand_registration_definition, 'bool')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
Expand Down
Loading

0 comments on commit db59efd

Please sign in to comment.