Skip to content

Commit

Permalink
Generated from 6a776881f4b88fce43ab2de7471e9b9659916ac9 (#6737)
Browse files Browse the repository at this point in the history
Add 404 for HEAD APIs.
  • Loading branch information
AutorestCI authored and Zim Kalinowski committed Sep 2, 2019
1 parent a8bfc08 commit e3fb8dc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def check_existence_at_scope(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -172,14 +172,16 @@ def check_existence_at_scope(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'}


Expand Down Expand Up @@ -719,8 +721,8 @@ def check_existence_at_tenant_scope(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -747,14 +749,16 @@ def check_existence_at_tenant_scope(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'}


Expand Down Expand Up @@ -1278,8 +1282,8 @@ def check_existence_at_management_group_scope(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -1307,14 +1311,16 @@ def check_existence_at_management_group_scope(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'}


Expand Down Expand Up @@ -1855,8 +1861,8 @@ def check_existence_at_subscription_scope(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -1884,14 +1890,16 @@ def check_existence_at_subscription_scope(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'}


Expand Down Expand Up @@ -2428,8 +2436,8 @@ def check_existence(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -2458,14 +2466,16 @@ def check_existence(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def check_existence(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -82,14 +82,16 @@ def check_existence(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'}

def create_or_update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ def check_existence(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -489,14 +489,16 @@ def check_existence(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'}


Expand Down Expand Up @@ -923,8 +925,8 @@ def check_existence_by_id(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: bool or ClientRawResponse if raw=true
:rtype: bool or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -951,14 +953,16 @@ def check_existence_by_id(
request = self._client.head(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
if response.status_code not in [204, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = (response.status_code == 204)
if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
check_existence_by_id.metadata = {'url': '/{resourceId}'}


Expand Down

0 comments on commit e3fb8dc

Please sign in to comment.