Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR managedservices/resource-manager] API version is a client constant #6209

Merged
Merged
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 @@ -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 @@ -24,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 @@ -33,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 @@ -74,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 @@ -107,7 +107,7 @@ def get(


def _delete_initial(
self, scope, registration_assignment_id, api_version, custom_headers=None, raw=False, **operation_config):
self, scope, registration_assignment_id, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
Expand All @@ -118,7 +118,7 @@ def _delete_initial(

# 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 All @@ -141,16 +141,14 @@ def _delete_initial(
return client_raw_response

def delete(
self, scope, registration_assignment_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config):
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 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
Expand All @@ -166,7 +164,6 @@ def delete(
raw_result = self._delete_initial(
scope=scope,
registration_assignment_id=registration_assignment_id,
api_version=api_version,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand All @@ -188,7 +185,7 @@ def get_long_running_output(response):


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

# Construct URL
Expand All @@ -201,7 +198,7 @@ def _create_or_update_initial(

# 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 +235,14 @@ def _create_or_update_initial(
return deserialized

def create_or_update(
self, scope, registration_assignment_id, api_version, properties=None, custom_headers=None, raw=False, polling=True, **operation_config):
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 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
Expand All @@ -268,7 +263,6 @@ def create_or_update(
raw_result = self._create_or_update_initial(
scope=scope,
registration_assignment_id=registration_assignment_id,
api_version=api_version,
properties=properties,
custom_headers=custom_headers,
raw=True,
Expand All @@ -294,13 +288,11 @@ def get_long_running_output(response):
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 @@ -330,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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RegistrationDefinitionsOperations(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 @@ -33,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_definition_id, api_version, custom_headers=None, raw=False, **operation_config):
self, scope, registration_definition_id, custom_headers=None, raw=False, **operation_config):
"""Gets the registration definition details.

:param scope: Scope of the resource.
:type scope: str
:param registration_definition_id: Guid of the registration
definition.
:type registration_definition_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
Expand All @@ -68,7 +68,7 @@ def get(

# 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 @@ -100,14 +100,12 @@ def get(
get.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}'}

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

:param registration_definition_id: Guid of the registration
definition.
:type registration_definition_id: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param scope: Scope of the resource.
:type scope: str
:param dict custom_headers: headers that will be added to the request
Expand All @@ -130,7 +128,7 @@ 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 = {}
Expand All @@ -155,7 +153,7 @@ def delete(


def _create_or_update_initial(
self, registration_definition_id, api_version, scope, properties=None, plan=None, custom_headers=None, raw=False, **operation_config):
self, registration_definition_id, scope, properties=None, plan=None, custom_headers=None, raw=False, **operation_config):
request_body = models.RegistrationDefinition(properties=properties, plan=plan)

# Construct URL
Expand All @@ -168,7 +166,7 @@ def _create_or_update_initial(

# 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 @@ -205,14 +203,12 @@ def _create_or_update_initial(
return deserialized

def create_or_update(
self, registration_definition_id, api_version, scope, properties=None, plan=None, custom_headers=None, raw=False, polling=True, **operation_config):
self, registration_definition_id, scope, properties=None, plan=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates or updates a registration definition.

:param registration_definition_id: Guid of the registration
definition.
:type registration_definition_id: str
:param api_version: The API version to use for this operation.
:type api_version: str
:param scope: Scope of the resource.
:type scope: str
:param properties: Properties of a registration definition.
Expand All @@ -236,7 +232,6 @@ def create_or_update(
"""
raw_result = self._create_or_update_initial(
registration_definition_id=registration_definition_id,
api_version=api_version,
scope=scope,
properties=properties,
plan=plan,
Expand Down Expand Up @@ -264,13 +259,11 @@ def get_long_running_output(response):
create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}'}

def list(
self, scope, api_version, custom_headers=None, raw=False, **operation_config):
self, scope, custom_headers=None, raw=False, **operation_config):
"""Gets a list of the registration definitions.

: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 dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -294,7 +287,7 @@ def internal_paging(next_link=None, raw=False):

# 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')

else:
url = next_link
Expand Down