def update(attributes)
      attributes.each do |key, value|
        self[key] = value
      end

      begin
        resource_gateway.update(id, attributes)
      rescue RestClient::Exception => e
        raise_failed_request_error(e)
      end

      self
    end
def update(attributes)
      attributes.each do |key, value|
        self[key] = value
      end

      begin
        resource_gateway.update(id, attributes)
      rescue RestClient::Exception => e
        raise_failed_request_error(e)
      end

      self
    end
Update the attributes of this model. Assign the attributes
 according to the hash, then persist those changes on the server.

 @param [Hash] attributes the attributes to be updated on the model.

 @example
   my_profile.update(
     middle_name: "Ludwig"
   )

 @raise [FailedRequestError] if the request failed for any reason.

 @return [Model] the updated model.