async def _create_or_update_initial(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, security_rule_parameters: 'models.SecurityRule', **kwargs) -> 'models.SecurityRule':
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2018-07-01'
    content_type = kwargs.pop('content_type', 'application/json')
    accept = 'application/json'
    url = self._create_or_update_initial.metadata['url']
    path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url('network_security_group_name', network_security_group_name, 'str'), 'securityRuleName': self._serialize.url('security_rule_name', security_rule_name, 'str'), 'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str')}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    header_parameters = {}
    header_parameters['Content-Type'] = self._serialize.header('content_type', content_type, 'str')
    header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
    body_content_kwargs = {}
    body_content = self._serialize.body(security_rule_parameters, 'SecurityRule')
    body_content_kwargs['content'] = body_content
    request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
    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('SecurityRule', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('SecurityRule', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized
async def _create_or_update_initial(self, resource_group_name: str, network_security_group_name: str, security_rule_name: str, security_rule_parameters: 'models.SecurityRule', **kwargs) -> 'models.SecurityRule':
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2018-07-01'
    content_type = kwargs.pop('content_type', 'application/json')
    accept = 'application/json'
    url = self._create_or_update_initial.metadata['url']
    path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url('network_security_group_name', network_security_group_name, 'str'), 'securityRuleName': self._serialize.url('security_rule_name', security_rule_name, 'str'), 'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str')}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    header_parameters = {}
    header_parameters['Content-Type'] = self._serialize.header('content_type', content_type, 'str')
    header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
    body_content_kwargs = {}
    body_content = self._serialize.body(security_rule_parameters, 'SecurityRule')
    body_content_kwargs['content'] = body_content
    request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
    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('SecurityRule', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('SecurityRule', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized