@distributed_trace_async
async def create_or_update(self, resource_group_name: str, parameters: '_models.ResourceGroup', **kwargs: Any) -> '_models.ResourceGroup':
    'Creates or updates a resource group.\n\n        :param resource_group_name: The name of the resource group to create or update. Can include\n         alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters\n         that match the allowed characters.\n        :type resource_group_name: str\n        :param parameters: Parameters supplied to the create or update a resource group.\n        :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: ResourceGroup, or the result of cls(response)\n        :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = kwargs.pop('api_version', '2019-08-01')
    content_type = kwargs.pop('content_type', 'application/json')
    _json = self._serialize.body(parameters, 'ResourceGroup')
    request = build_resource_groups_create_or_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'])
    request = _convert_request(request)
    request.url = self._client.format_url(request.url)
    pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
    response = pipeline_response.http_response
    if (response.status_code not in [200, 201]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        raise HttpResponseError(response=response, error_format=ARMErrorFormat)
    if (response.status_code == 200):
        deserialized = self._deserialize('ResourceGroup', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('ResourceGroup', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized
Creates or updates a resource group.

:param resource_group_name: The name of the resource group to create or update. Can include
 alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
 that match the allowed characters.
:type resource_group_name: str
:param parameters: Parameters supplied to the create or update a resource group.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceGroup, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises: ~azure.core.exceptions.HttpResponseError
@distributed_trace_async
async def create_or_update(self, resource_group_name: str, parameters: '_models.ResourceGroup', **kwargs: Any) -> '_models.ResourceGroup':
    'Creates or updates a resource group.\n\n        :param resource_group_name: The name of the resource group to create or update. Can include\n         alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters\n         that match the allowed characters.\n        :type resource_group_name: str\n        :param parameters: Parameters supplied to the create or update a resource group.\n        :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: ResourceGroup, or the result of cls(response)\n        :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = kwargs.pop('api_version', '2019-08-01')
    content_type = kwargs.pop('content_type', 'application/json')
    _json = self._serialize.body(parameters, 'ResourceGroup')
    request = build_resource_groups_create_or_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'])
    request = _convert_request(request)
    request.url = self._client.format_url(request.url)
    pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
    response = pipeline_response.http_response
    if (response.status_code not in [200, 201]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        raise HttpResponseError(response=response, error_format=ARMErrorFormat)
    if (response.status_code == 200):
        deserialized = self._deserialize('ResourceGroup', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('ResourceGroup', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized