async def begin_create_or_update(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, security_rule_parameters: 'models.SecurityRule', **kwargs) -> AsyncLROPoller['models.SecurityRule']:
    'Creates or updates a security rule in the specified network security group.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param network_security_group_name: The name of the network security group.\n        :type network_security_group_name: str\n        :param security_rule_name: The name of the security rule.\n        :type security_rule_name: str\n        :param security_rule_parameters: Parameters supplied to the create or update network security\n         rule operation.\n        :type security_rule_parameters: ~azure.mgmt.network.v2018_07_01.models.SecurityRule\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: True for ARMPolling, False for no polling, or a\n         polling object for 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 SecurityRule or the result of cls(response)\n        :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.SecurityRule]\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, network_security_group_name=network_security_group_name, security_rule_name=security_rule_name, security_rule_parameters=security_rule_parameters, 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('SecurityRule', pipeline_response)
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized
    if (polling is True):
        polling_method = AsyncARMPolling(lro_delay, **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)
Creates or updates a security rule in the specified network security group.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param network_security_group_name: The name of the network security group.
:type network_security_group_name: str
:param security_rule_name: The name of the security rule.
:type security_rule_name: str
:param security_rule_parameters: Parameters supplied to the create or update network security
 rule operation.
:type security_rule_parameters: ~azure.mgmt.network.v2018_07_01.models.SecurityRule
: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: True for ARMPolling, False for no polling, or a
 polling object for 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 SecurityRule or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.SecurityRule]
:raises ~azure.core.exceptions.HttpResponseError:
async def begin_create_or_update(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, security_rule_parameters: 'models.SecurityRule', **kwargs) -> AsyncLROPoller['models.SecurityRule']:
    'Creates or updates a security rule in the specified network security group.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param network_security_group_name: The name of the network security group.\n        :type network_security_group_name: str\n        :param security_rule_name: The name of the security rule.\n        :type security_rule_name: str\n        :param security_rule_parameters: Parameters supplied to the create or update network security\n         rule operation.\n        :type security_rule_parameters: ~azure.mgmt.network.v2018_07_01.models.SecurityRule\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: True for ARMPolling, False for no polling, or a\n         polling object for 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 SecurityRule or the result of cls(response)\n        :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.SecurityRule]\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, network_security_group_name=network_security_group_name, security_rule_name=security_rule_name, security_rule_parameters=security_rule_parameters, 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('SecurityRule', pipeline_response)
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized
    if (polling is True):
        polling_method = AsyncARMPolling(lro_delay, **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)