Skip to content
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
6 changes: 3 additions & 3 deletions azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from .resource_py3 import Resource
from .kubernetes_connection_details_py3 import KubernetesConnectionDetails
from .error_details_py3 import ErrorDetails
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .dev_spaces_error_response_py3 import DevSpacesErrorResponse, DevSpacesErrorResponseException
except (SyntaxError, ImportError):
from .container_host_mapping import ContainerHostMapping
from .tracked_resource import TrackedResource
Expand All @@ -40,7 +40,7 @@
from .resource import Resource
from .kubernetes_connection_details import KubernetesConnectionDetails
from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .dev_spaces_error_response import DevSpacesErrorResponse, DevSpacesErrorResponseException
from .resource_provider_operation_definition_paged import ResourceProviderOperationDefinitionPaged
from .controller_paged import ControllerPaged
from .dev_spaces_management_client_enums import (
Expand All @@ -63,7 +63,7 @@
'Resource',
'KubernetesConnectionDetails',
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'DevSpacesErrorResponse', 'DevSpacesErrorResponseException',
'ResourceProviderOperationDefinitionPaged',
'ControllerPaged',
'ProvisioningState',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ class ControllerUpdateParameters(Model):

:param tags: Tags for the Azure Dev Spaces Controller.
:type tags: dict[str, str]
:param target_container_host_credentials_base64: Credentials of the target
container host (base64).
:type target_container_host_credentials_base64: str
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'target_container_host_credentials_base64': {'key': 'properties.targetContainerHostCredentialsBase64', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ControllerUpdateParameters, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
self.target_container_host_credentials_base64 = kwargs.get('target_container_host_credentials_base64', None)
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ class ControllerUpdateParameters(Model):

:param tags: Tags for the Azure Dev Spaces Controller.
:type tags: dict[str, str]
:param target_container_host_credentials_base64: Credentials of the target
container host (base64).
:type target_container_host_credentials_base64: str
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'target_container_host_credentials_base64': {'key': 'properties.targetContainerHostCredentialsBase64', 'type': 'str'},
}

def __init__(self, *, tags=None, **kwargs) -> None:
def __init__(self, *, tags=None, target_container_host_credentials_base64: str=None, **kwargs) -> None:
super(ControllerUpdateParameters, self).__init__(**kwargs)
self.tags = tags
self.target_container_host_credentials_base64 = target_container_host_credentials_base64
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
class DevSpacesErrorResponse(Model):
"""Error response indicates that the service is not able to process the
incoming request. The reason is provided in the error message.

Expand All @@ -26,17 +26,17 @@ class ErrorResponse(Model):
}

def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
super(DevSpacesErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
class DevSpacesErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'DevSpacesErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
super(DevSpacesErrorResponseException, self).__init__(deserialize, response, 'DevSpacesErrorResponse', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
class DevSpacesErrorResponse(Model):
"""Error response indicates that the service is not able to process the
incoming request. The reason is provided in the error message.

Expand All @@ -26,17 +26,17 @@ class ErrorResponse(Model):
}

def __init__(self, *, error=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
super(DevSpacesErrorResponse, self).__init__(**kwargs)
self.error = error


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
class DevSpacesErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'DevSpacesErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
super(DevSpacesErrorResponseException, self).__init__(deserialize, response, 'DevSpacesErrorResponse', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_container_host_mapping(
:rtype: ~azure.mgmt.devspaces.models.ContainerHostMapping or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
container_host_mapping = models.ContainerHostMapping(container_host_resource_id=container_host_resource_id)

Expand Down Expand Up @@ -94,7 +94,7 @@ def get_container_host_mapping(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def get(
:rtype: ~azure.mgmt.devspaces.models.Controller or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$')
'name': self._serialize.url("name", name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -88,7 +88,7 @@ def get(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand All @@ -110,7 +110,7 @@ def _create_initial(
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$')
'name': self._serialize.url("name", name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -137,7 +137,7 @@ def _create_initial(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand Down Expand Up @@ -178,7 +178,7 @@ def create(
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.devspaces.models.Controller]]
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
raw_result = self._create_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -215,7 +215,7 @@ def _delete_initial(
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$')
'name': self._serialize.url("name", name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -237,7 +237,7 @@ def _delete_initial(
response = self._client.send(request, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -264,7 +264,7 @@ def delete(
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
Expand All @@ -289,7 +289,7 @@ def get_long_running_output(response):
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'}

def update(
self, resource_group_name, name, tags=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, name, tags=None, target_container_host_credentials_base64=None, custom_headers=None, raw=False, **operation_config):
"""Updates an Azure Dev Spaces Controller.

Updates the properties of an existing Azure Dev Spaces Controller with
Expand All @@ -302,6 +302,9 @@ def update(
:type name: str
:param tags: Tags for the Azure Dev Spaces Controller.
:type tags: dict[str, str]
:param target_container_host_credentials_base64: Credentials of the
target container host (base64).
:type target_container_host_credentials_base64: 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 @@ -311,16 +314,16 @@ def update(
:rtype: ~azure.mgmt.devspaces.models.Controller or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
controller_update_parameters = models.ControllerUpdateParameters(tags=tags)
controller_update_parameters = models.ControllerUpdateParameters(tags=tags, target_container_host_credentials_base64=target_container_host_credentials_base64)

# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$')
'name': self._serialize.url("name", name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -346,13 +349,15 @@ def update(
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]:
raise models.ErrorResponseException(self._deserialize, response)
if response.status_code not in [200, 201]:
raise models.DevSpacesErrorResponseException(self._deserialize, response)

deserialized = None

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

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down Expand Up @@ -380,7 +385,7 @@ def list_by_resource_group(
:rtype:
~azure.mgmt.devspaces.models.ControllerPaged[~azure.mgmt.devspaces.models.Controller]
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):

Expand Down Expand Up @@ -416,7 +421,7 @@ def internal_paging(next_link=None, raw=False):
response = self._client.send(request, stream=False, **operation_config)

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

return response

Expand Down Expand Up @@ -447,7 +452,7 @@ def list(
:rtype:
~azure.mgmt.devspaces.models.ControllerPaged[~azure.mgmt.devspaces.models.Controller]
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):

Expand Down Expand Up @@ -482,7 +487,7 @@ def internal_paging(next_link=None, raw=False):
response = self._client.send(request, stream=False, **operation_config)

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

return response

Expand Down Expand Up @@ -522,7 +527,7 @@ def list_connection_details(
:rtype: ~azure.mgmt.devspaces.models.ControllerConnectionDetailsList
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.devspaces.models.ErrorResponseException>`
:class:`DevSpacesErrorResponseException<azure.mgmt.devspaces.models.DevSpacesErrorResponseException>`
"""
list_connection_details_parameters = models.ListConnectionDetailsParameters(target_container_host_resource_id=target_container_host_resource_id)

Expand All @@ -531,7 +536,7 @@ def list_connection_details(
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$')
'name': self._serialize.url("name", name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand All @@ -558,7 +563,7 @@ def list_connection_details(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand Down