code: def update(self, resource_name, resource, url_prefix, auth, session, send_opts):
          
  
          # Create a copy of the resource and change its name to resource_name
          # in case the update includes changing the name of a resource.
          old_resource = copy.deepcopy(resource)
          old_resource.name = resource_name
  
          json = self._get_resource_params(resource, for_update=True)
  
          req = self.get_request(old_resource, 'PUT', 'application/json', url_prefix, auth, json=json)
  
          prep = session.prepare_request(req)
          resp = session.send(prep, **send_opts)
  
          if resp.status_code == 200:
              return self._create_resource_from_dict(resource, resp.json())
  
          err = ('Update failed on {}, got HTTP response: ({}) - {}'.format(
              old_resource.name, resp.status_code, resp.text))
          raise HTTPError(err, request = req, response = resp)
docs: Updates an entity in the data model using the given resource.
  
          Args:
              resource_name (string): Current name of the resource (in case the resource is getting its name changed).
              resource (intern.resource.boss.BossResource): New attributes for the resource.
              url_prefix (string): Protocol + host such as https://api.theboss.io
              auth (string): Token to send in the request header.
              session (requests.Session): HTTP session to use for request.
              send_opts (dictionary): Additional arguments to pass to session.send().
  
          Returns:
              (intern.resource.boss.BossResource): Returns updated resource of given type on success.
  
          Raises:
              requests.HTTPError on failure.