Skip to content

Commit

Permalink
Update from master
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed May 2, 2020
1 parent 76a0d91 commit 6eaadee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 be used with the HTTP request. Constant value: "2019-11-01-preview".
"""

models = models
Expand All @@ -34,16 +35,15 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-11-01-preview"

self.config = config

def list(
self, api_version, custom_headers=None, raw=False, **operation_config):
self, custom_headers=None, raw=False, **operation_config):
"""List all the available operations the KubernetesConfiguration resource
provider supports.
:param api_version: The API version to be used with the HTTP request.
: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 @@ -61,7 +61,7 @@ def prepare_request(next_link=None):

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SourceControlConfigurationsOperations(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 be used with the HTTP request. Constant value: "2019-11-01-preview".
"""

models = models
Expand All @@ -35,11 +36,12 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-11-01-preview"

self.config = config

def get(
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config):
"""Gets details of the Source Control Configuration.
:param resource_group_name: The name of the resource group.
Expand All @@ -59,8 +61,6 @@ def get(
:param source_control_configuration_name: Name of the Source Control
Configuration.
:type source_control_configuration_name: str
:param api_version: The API version to be used with the HTTP request.
: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 @@ -87,7 +87,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 @@ -118,7 +118,7 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'}

def create_or_update(
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, source_control_configuration, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers=None, raw=False, **operation_config):
"""Create a new Kubernetes Source Control Configuration.
:param resource_group_name: The name of the resource group.
Expand All @@ -138,8 +138,6 @@ def create_or_update(
:param source_control_configuration_name: Name of the Source Control
Configuration.
:type source_control_configuration_name: str
:param api_version: The API version to be used with the HTTP request.
:type api_version: str
:param source_control_configuration: Properties necessary to Create
KubernetesConfiguration.
:type source_control_configuration:
Expand Down Expand Up @@ -170,7 +168,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 @@ -208,7 +206,7 @@ def create_or_update(


def _delete_initial(
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
Expand All @@ -223,7 +221,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 @@ -246,7 +244,7 @@ def _delete_initial(
return client_raw_response

def delete(
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""This will delete the YAML file used to set up the Source control
configuration, thus stopping future sync from the source repo.
Expand All @@ -267,8 +265,6 @@ def delete(
:param source_control_configuration_name: Name of the Source Control
Configuration.
:type source_control_configuration_name: str
:param api_version: The API version to be used with the HTTP request.
: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 @@ -287,7 +283,6 @@ def delete(
cluster_resource_name=cluster_resource_name,
cluster_name=cluster_name,
source_control_configuration_name=source_control_configuration_name,
api_version=api_version,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand All @@ -308,7 +303,7 @@ def get_long_running_output(response):
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'}

def list(
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, api_version, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers=None, raw=False, **operation_config):
"""List all Source Control Configurations.
:param resource_group_name: The name of the resource group.
Expand All @@ -325,8 +320,6 @@ def list(
:type cluster_resource_name: str
:param cluster_name: The name of the kubernetes cluster.
:type cluster_name: str
:param api_version: The API version to be used with the HTTP request.
: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 @@ -353,7 +346,7 @@ def prepare_request(next_link=None):

# 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
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 6eaadee

Please sign in to comment.