async def _update_initial(self, resource_group_name: str, registry_name: str, agent_pool_name: str, update_parameters: '_models.AgentPoolUpdateParameters', **kwargs: Any) -> '_models.AgentPool':
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2019-06-01-preview'
    content_type = kwargs.pop('content_type', 'application/json')
    accept = 'application/json'
    url = self._update_initial.metadata['url']
    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', min_length=1), 'registryName': self._serialize.url('registry_name', registry_name, 'str', max_length=50, min_length=5, pattern='^[a-zA-Z0-9]*$'), 'agentPoolName': self._serialize.url('agent_pool_name', agent_pool_name, 'str', max_length=20, min_length=3, pattern='^[a-zA-Z0-9-]*$')}
    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(update_parameters, 'AgentPoolUpdateParameters')
    body_content_kwargs['content'] = body_content
    request = self._client.patch(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)
        error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
        raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
    if (response.status_code == 200):
        deserialized = self._deserialize('AgentPool', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('AgentPool', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized
async def _update_initial(self, resource_group_name: str, registry_name: str, agent_pool_name: str, update_parameters: '_models.AgentPoolUpdateParameters', **kwargs: Any) -> '_models.AgentPool':
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2019-06-01-preview'
    content_type = kwargs.pop('content_type', 'application/json')
    accept = 'application/json'
    url = self._update_initial.metadata['url']
    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', min_length=1), 'registryName': self._serialize.url('registry_name', registry_name, 'str', max_length=50, min_length=5, pattern='^[a-zA-Z0-9]*$'), 'agentPoolName': self._serialize.url('agent_pool_name', agent_pool_name, 'str', max_length=20, min_length=3, pattern='^[a-zA-Z0-9-]*$')}
    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(update_parameters, 'AgentPoolUpdateParameters')
    body_content_kwargs['content'] = body_content
    request = self._client.patch(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)
        error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
        raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
    if (response.status_code == 200):
        deserialized = self._deserialize('AgentPool', pipeline_response)
    if (response.status_code == 201):
        deserialized = self._deserialize('AgentPool', pipeline_response)
    if cls:
        return cls(pipeline_response, deserialized, {})
    return deserialized