code: def update_agent_pool(self, pool, pool_id):
          
          route_values = {}
          if pool_id is not None:
              route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int')
          content = self._serialize.body(pool, 'TaskAgentPool')
          response = self._send(http_method='PATCH',
                                location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be',
                                version='5.1-preview.1',
                                route_values=route_values,
                                content=content)
          return self._deserialize('TaskAgentPool', response)
docs: UpdateAgentPool.
          [Preview API] Update properties on an agent pool
          :param :class:`<TaskAgentPool> <azure.devops.v5_1.task_agent.models.TaskAgentPool>` pool: Updated agent pool details
          :param int pool_id: The agent pool to update
          :rtype: :class:`<TaskAgentPool> <azure.devops.v5_1.task-agent.models.TaskAgentPool>`