Mixed-in Instance Methods

 Change the name of this item
 Remember to #update to push changes to the server.

 @param newname[String] the new name

 @return [void]
429128
def name=(newname)
      return nil if @name == newname
      raise JSS::UnsupportedError, "Editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless updatable?
      raise JSS::InvalidDataError, "Names can't be empty!" if newname.to_s.empty?
      raise JSS::AlreadyExistsError, "A #{self.class::RSRC_OBJECT_KEY} named '#{newname}' already exsists in the JSS" \
        if self.class.all_names(:refresh, api: @api).include? newname
      @name = newname
      @rest_rsrc = "#{self.class::RSRC_BASE}/name/#{CGI.escape @name}" if @rest_rsrc.include? '/name/'
      @need_to_update = true
    end
878575
def assign_from_old(params, new_params)
      queued_deletes = []

      params.attributes.each_pair do |name, old_val|
        # If there is a new value, see if it has [name]
        new_val = new_params ? new_params[name] : nil

        if !new_val
          # Queues the delete until after we finish the each_pair loop
          queued_deletes << name
        elsif new_val.is_a?(Hash)
          assign_from_old(old_val, new_val)
        else
          # assign value
          params.set(name, new_val) if old_val != new_val
          new_params.delete(name)
        end
      end

      queued_deletes.each { |name| params.delete(name) }
    end
121057
function(newName) {
        if (newName != this.name) {
            this.name = newName;
            if (this.map != null) {
                this.map.events.triggerEvent("changelayer", {
                    layer: this,
                    property: "name"
                });
            }
        }
    }
182642
def set_domain!(new_domain)
      raise ArgumentError, "The new hostname cannot be nil" unless new_domain
      raise ArgumentError, "The new hostname cannot be empty" if new_domain.empty?

      edit_template = {
        "domain" => new_domain
      }

      self.service.editObject(edit_template)
      self.refresh_details()
    end
292087
def update_name(service_id, snapshot_id, name)
      return unless service_id && snapshot_id && name
      verify_input_name(name)

      key = self.class.redis_key(service_id)
      # NOTE: idealy should watch on combination of (service_id, snapshot_id)
      # but current design doesn't support such fine-grained watching.
      client.watch(key)

      snapshot = client.hget(redis_key(service_id), snapshot_id)
      return nil unless snapshot
      snapshot = Yajl::Parser.parse(snapshot)
      snapshot["name"] = name

      res = client.multi do
        save_snapshot(service_id, snapshot)
      end

      unless res
        raise ServiceError.new(ServiceError::REDIS_CONCURRENT_UPDATE)
      end
      true
    end
288920
def change_name(self, username):
        
        self.release_name()

        try:
            self.server.register_name(username)
        except UsernameInUseException:
            logging.log(', '.join(self.server.registered_names))
            self.server.register_name(self.name)
            raise
            
        self.name = username
139474
def rename(name, new_name):
    '''
    
    '''
    current_info = info(name)
    if not current_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    new_info = info(new_name)
    if new_info:
        raise CommandExecutionError(
            'User \'{0}\' already exists'.format(new_name)
        )
    cmd = ['pw', 'usermod', '-l', new_name, '-n', name]
    __salt__['cmd.run'](cmd)
    post_info = info(new_name)
    if post_info['name'] != current_info['name']:
        return post_info['name'] == new_name
    return False
959895
public void rename(String newName) {
        URL url = FILE_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");

        JsonObject updateInfo = new JsonObject();
        updateInfo.add("name", newName);

        request.setBody(updateInfo.toString());
        BoxAPIResponse response = request.send();
        response.disconnect();
    }
953672
def check_for_changes(name=nil)
      changed = []
      if name == nil
        self.cache_hash.keys.dup.each do |name|
          if reload_on_change(name)
            changed << name
          end
        end
      else
        name = name.to_s
        if reload_on_change(name)
          changed << name
        end
      end
      logger.debug "check_for_changes(#{name.inspect}) => #{changed.inspect}"
      changed
    end
707589
def rename(id, name)
      wf_proxy_id?(id)
      wf_string?(name)
      update(id, name: name)
    end
1098456
def rename(self, new_name):
        

        if _lxc.Container.rename(self, new_name):
            return Container(new_name)

        return False
598747
private void setName(String newName)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setName", newName);

        this._name = newName;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setName");
    }
217175
def changed(self, name):
        
        if self.first:
            return self.first.changed(name)
        else:
            return False
1225773
def last_name=(last_name)
      name = Name.new('First', last_name)
      raise "invalid last name" unless name.last.length > 0 && name.first.length > 0
      @last_name = name.last
    end
1222394
def _set_name(self, name, inplace=False):
        
        inplace = validate_bool_kwarg(inplace, 'inplace')
        ser = self if inplace else self.copy()
        ser.name = name
        return ser
396708
def rename(old, new)
      parameters = Specification.new(
        old: Types::Tags,
        new: Types::Tags
      ).parameters(old: old, new: new)
      @client.action('/tags/rename', parameters)
      self
    end
252626
def update_urlname!
      new_urlname = nested_url_name(slug)
      if urlname != new_urlname
        legacy_urls.create(urlname: urlname)
        update_column(:urlname, new_urlname)
      end
    end