Updates the specified policy. One or more of the parameters may be
        specified.
160960
def update_policy(self, scaling_group, policy, name=None, policy_type=None,
            cooldown=None, change=None, is_percent=False,
            desired_capacity=None, args=None):
        
        return self._manager.update_policy(scaling_group, policy, name=name,
                policy_type=policy_type, cooldown=cooldown, change=change,
                is_percent=is_percent, desired_capacity=desired_capacity,
                args=args)
248212
public void setPolicies(java.util.Collection<Policy> policies) {
        if (policies == null) {
            this.policies = null;
            return;
        }

        this.policies = new java.util.ArrayList<Policy>(policies);
    }
535126
public OperationFuture<List<FirewallPolicy>> update(
            List<FirewallPolicy> firewallPolicyList,
            FirewallPolicyConfig config
    ) {
        firewallPolicyList.forEach(firewallPolicy -> update(firewallPolicy, config));

        return new OperationFuture<>(
            firewallPolicyList,
            new NoWaitingJobFuture()
        );
    }
924116
public function setPolicy(int $policy)
    {
        if (!($policy === Rule::ALLOW || $policy === Rule::DENY || $policy === Rule::INHERIT || $policy === Rule::NOINHERIT))
            throw new Exception("Policy must be either Rule::ALLOW, Rule::DENY, Rule::INHERIT or Rule::NOINHERIT");

        if ($policy === Rule::NOINHERIT && !empty($this->action))
            throw new Exception("Rule::NOINHERIT can not be used in combination with an action");

        if ($policy === Rule::NOINHERIT && !empty($this->role_id))
            throw new Exception("Rule::NOINHERIT can not be used in combination with a role");

        if ($policy !== $this->policy)
        {
            $this->policy = $policy;
            $this->changed = true;
        }
    }
405403
public static ns_conf_download_policy update(nitro_service client, ns_conf_download_policy resource) throws Exception
	{
		resource.validate("modify");
		return ((ns_conf_download_policy[]) resource.update_resource(client))[0];
	}
1331536
def update_ikepolicy(self, ikepolicy, body=None):
        """"""
        return self.put(self.ikepolicy_path % (ikepolicy), body=body)
730341
def update(access_key, resource_policy, is_admin, is_active,  rate_limit):
    '''
    
    '''
    with Session() as session:
        try:
            data = session.KeyPair.update(
                access_key,
                is_active=is_active,
                is_admin=is_admin,
                resource_policy=resource_policy,
                rate_limit=rate_limit)
        except Exception as e:
            print_error(e)
            sys.exit(1)
        if not data['ok']:
            print_fail('KeyPair creation has failed: {0}'.format(data['msg']))
            sys.exit(1)
        print('Key pair is updated: ' + access_key + '.')
1347907
public static base_response update(nitro_service client, policyhttpcallout resource) throws Exception {
		policyhttpcallout updateresource = new policyhttpcallout();
		updateresource.name = resource.name;
		updateresource.ipaddress = resource.ipaddress;
		updateresource.port = resource.port;
		updateresource.vserver = resource.vserver;
		updateresource.returntype = resource.returntype;
		updateresource.httpmethod = resource.httpmethod;
		updateresource.hostexpr = resource.hostexpr;
		updateresource.urlstemexpr = resource.urlstemexpr;
		updateresource.headers = resource.headers;
		updateresource.parameters = resource.parameters;
		updateresource.bodyexpr = resource.bodyexpr;
		updateresource.fullreqexpr = resource.fullreqexpr;
		updateresource.scheme = resource.scheme;
		updateresource.resultexpr = resource.resultexpr;
		updateresource.cacheforsecs = resource.cacheforsecs;
		return updateresource.update_resource(client);
	}
369635
def update_qos_policy(self, qos_policy, body=None):
        """"""
        return self.put(self.qos_policy_path % qos_policy,
                        body=body)
631391
private void addPolicy(String pid, InputStream dsContent) throws GeneralException {
        LOG.info("Adding policy " + pid);

        String policy;

        try {
            policy = IOUtils.toString(dsContent);
            dsContent.close();
            m_policyIndex.addPolicy(pid, policy);
        } catch (IOException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        } catch (PolicyIndexException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        }


    }
874821
public final void setUsagePolicy(Callback<Integer, Usage> policy) {
        Objects.requireNonNull(policy);
        this.usagePolicy.set(policy);
    }
760071
public final void setUndoManagerPolicy(UndoManagerPolicy policy) throws NullPointerException {
		if (policy == null) {
			throw new NullPointerException("The policy must not be null.");
		}
		
		if (this.policy == policy) {
			return;
		}

		final UndoManagerPolicy oldPolicy = this.policy;
		this.policy = policy;
		
		if (oldPolicy == UndoManagerPolicy.DEFAULT) {
			this.textComponent.removePropertyChangeListener("editable", this);
			this.textComponent.removePropertyChangeListener("enabled", this);
		}

		if (this.policy == UndoManagerPolicy.DEFAULT) {
			this.textComponent.addPropertyChangeListener("editable", this);
			this.textComponent.addPropertyChangeListener("enabled", this);
		}

		handleUndoManagerPolicy();
	}
907045
def update_lbaas_l7policy(self, l7policy, body=None):
        """"""
        return self.put(self.lbaas_l7policy_path % l7policy,
                        body=body)
513284
public void setPolicies(java.util.Collection<PolicyAttachment> policies) {
        if (policies == null) {
            this.policies = null;
            return;
        }

        this.policies = new java.util.ArrayList<PolicyAttachment>(policies);
    }
1180357
public CMARole addPolicy(CMAPolicy policy) {
    if (policies == null) {
      policies = new ArrayList<CMAPolicy>();
    }

    policies.add(policy);
    return this;
  }
162549
public void addPolicy(final Enum name, final ExpirationPolicy policy) {
        LOGGER.trace("Adding expiration policy [{}] with name [{}]", policy, name);
        addPolicy(name.name(), policy);
    }
546730
def update_policy(self, scaling_group, policy, name=None, policy_type=None,
            cooldown=None, change=None, is_percent=False,
            desired_capacity=None, args=None):
        
        uri = "/%s/%s/policies/%s" % (self.uri_base,
                utils.get_id(scaling_group), utils.get_id(policy))
        if not isinstance(policy, AutoScalePolicy):
            # Received an ID
            policy = self.get_policy(scaling_group, policy)
        body = {"name": name or policy.name,
                "type": policy_type or policy.type,
                "cooldown": cooldown or policy.cooldown,
                }
        if desired_capacity is not None:
            body["desiredCapacity"] = desired_capacity
        elif change is not None:
            if is_percent:
                body["changePercent"] = change
            else:
                body["change"] = change
        else:
            if getattr(policy, "changePercent", None) is not None:
                body["changePercent"] = policy.changePercent
            elif getattr(policy, "change", None) is not None:
                body["change"] = policy.change
            elif getattr(policy, "desiredCapacity", None) is not None:
                body["desiredCapacity"] = policy.desiredCapacity
        args = args or getattr(policy, "args", None)
        if args is not None:
            body["args"] = args
        resp, resp_body = self.api.method_put(uri, body=body)
        return None