async def begin_create_or_update(self, resource_group_name: str, gallery_name: str, gallery_image_name: str, gallery_image: '_models.GalleryImage', **kwargs) -> AsyncLROPoller['_models.GalleryImage']:
    "Create or update a gallery Image Definition.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to\n         be created.\n        :type gallery_name: str\n        :param gallery_image_name: The name of the gallery Image Definition to be created or updated.\n         The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the\n         middle. The maximum length is 80 characters.\n        :type gallery_image_name: str\n        :param gallery_image: Parameters supplied to the create or update gallery image operation.\n        :type gallery_image: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n        :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,\n         False for no polling, or your own initialized polling object for a personal polling strategy.\n        :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n        :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response)\n        :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryImage]\n        :raises ~azure.core.exceptions.HttpResponseError:\n        "
    polling = kwargs.pop('polling', True)
    cls = kwargs.pop('cls', None)
    lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
    cont_token = kwargs.pop('continuation_token', None)
    if (cont_token is None):
        raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, gallery_name=gallery_name, gallery_image_name=gallery_image_name, gallery_image=gallery_image, cls=(lambda x, y, z: x), **kwargs))
    kwargs.pop('error_map', None)
    kwargs.pop('content_type', None)

    def get_long_running_output(pipeline_response):
        deserialized = self._deserialize('GalleryImage', pipeline_response)
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized
    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'), 'galleryName': self._serialize.url('gallery_name', gallery_name, 'str'), 'galleryImageName': self._serialize.url('gallery_image_name', gallery_image_name, 'str')}
    if (polling is True):
        polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
    elif (polling is False):
        polling_method = AsyncNoPolling()
    else:
        polling_method = polling
    if cont_token:
        return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
    else:
        return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
Create or update a gallery Image Definition.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to
 be created.
:type gallery_name: str
:param gallery_image_name: The name of the gallery Image Definition to be created or updated.
 The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the
 middle. The maximum length is 80 characters.
:type gallery_image_name: str
:param gallery_image: Parameters supplied to the create or update gallery image operation.
:type gallery_image: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
 False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryImage]
:raises ~azure.core.exceptions.HttpResponseError:
async def begin_create_or_update(self, resource_group_name: str, gallery_name: str, gallery_image_name: str, gallery_image: '_models.GalleryImage', **kwargs) -> AsyncLROPoller['_models.GalleryImage']:
    "Create or update a gallery Image Definition.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to\n         be created.\n        :type gallery_name: str\n        :param gallery_image_name: The name of the gallery Image Definition to be created or updated.\n         The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the\n         middle. The maximum length is 80 characters.\n        :type gallery_image_name: str\n        :param gallery_image: Parameters supplied to the create or update gallery image operation.\n        :type gallery_image: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n        :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,\n         False for no polling, or your own initialized polling object for a personal polling strategy.\n        :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n        :return: An instance of AsyncLROPoller that returns either GalleryImage or the result of cls(response)\n        :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryImage]\n        :raises ~azure.core.exceptions.HttpResponseError:\n        "
    polling = kwargs.pop('polling', True)
    cls = kwargs.pop('cls', None)
    lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
    cont_token = kwargs.pop('continuation_token', None)
    if (cont_token is None):
        raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, gallery_name=gallery_name, gallery_image_name=gallery_image_name, gallery_image=gallery_image, cls=(lambda x, y, z: x), **kwargs))
    kwargs.pop('error_map', None)
    kwargs.pop('content_type', None)

    def get_long_running_output(pipeline_response):
        deserialized = self._deserialize('GalleryImage', pipeline_response)
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized
    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'), 'galleryName': self._serialize.url('gallery_name', gallery_name, 'str'), 'galleryImageName': self._serialize.url('gallery_image_name', gallery_image_name, 'str')}
    if (polling is True):
        polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
    elif (polling is False):
        polling_method = AsyncNoPolling()
    else:
        polling_method = polling
    if cont_token:
        return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
    else:
        return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)