Add a PolicyDefinition to the profile.
431076
public function addPolicyDefinition(PolicyDefinition $definition)
  {
    // Do not include excluded dependencies
    if (!in_array($definition->getName(), $this->excludedPolicies)) {
      $this->policies[$definition->getName()] = $definition;
    }
    return $this;
  }
794350
public void add(Collection<AlertPolicy> policies)
    {
        for(AlertPolicy policy : policies)
            this.policies.put(policy.getId(), policy);
    }
1308442
public function addProfile($profileName, $profileDef)
    {
        $this->profiles[$profileName] = $profileDef instanceof \DataFilter\Profile
            ? $profileDef
            : new \DataFilter\Profile($profileDef);
    }
992372
public void addProfile(@NonNull IProfile profile, int position) {
        if (mAccountHeaderBuilder.mProfiles == null) {
            mAccountHeaderBuilder.mProfiles = new ArrayList<>();
        }
        mAccountHeaderBuilder.mProfiles.add(position, profile);

        mAccountHeaderBuilder.updateHeaderAndList();
    }
442643
@Override
    public void addRuleInstances(Digester digester) {
        digester.addObjectCreate("profiles", Profiles.class);
        digester.addObjectCreate(PROFILES_PROFILE, Profile.class);
        digester.addObjectCreate(PROFILES_PROFILE_SETTING, Setting.class);

        digester.addSetNext(PROFILES_PROFILE, "addProfile");
        digester.addSetNext(PROFILES_PROFILE_SETTING, "addSetting");

        digester.addSetProperties(PROFILES_PROFILE, "kind", "kind");
        digester.addSetProperties(PROFILES_PROFILE_SETTING, "id", "id");
        digester.addSetProperties(PROFILES_PROFILE_SETTING, "value", "value");
    }
527218
def _link_policy(self, role):
        
        policy_arn = self.get_policy_arn()
        if role is not None and policy_arn not in role.ManagedPolicyArns:
            role.ManagedPolicyArns.append(policy_arn)
880234
def setProfile(self, profile):
        
        self._profile = profile
        
        # update the interface
        self.setIcon(profile.icon())
        self.setText(profile.name())
        self.setToolTip(profile.description())
519337
public void addPolicy(final String name, final ExpirationPolicy policy) {
        LOGGER.trace("Adding expiration policy [{}] with name [{}]", policy, name);
        this.policies.put(name, policy);
    }
733487
def add(self, source_id, profile_data, training_metadata=[], profile_reference=None, timestamp_reception=None):
        """"""
        data = {
            "source_id": _validate_source_id(source_id),
            "profile_json": _validate_dict(profile_data, "profile_data"),
            "training_metadata": _validate_training_metadata(training_metadata),
            "profile_reference": profile_reference
        }

        # some enrichement for profile_json
        if timestamp_reception is not None:
            data['timestamp_reception'] = _validate_timestamp(timestamp_reception, 'timestamp_reception')

        response = self.client.post("profile/json", data=data)
        return response.json()
946746
def add_backend_policy(self, json_data):
        
        env = boto3.session.Session(profile_name=self.env, region_name=self.region)
        elbclient = env.client('elb')

        # Attach backend server policies to created ELB
        for job in json.loads(json_data)['job']:
            for listener in job['listeners']:
                instance_port = listener['internalPort']
                backend_policy_list = listener['backendPolicies']
                if backend_policy_list:
                    LOG.info('Adding backend server policies: %s', backend_policy_list)
                    elbclient.set_load_balancer_policies_for_backend_server(
                        LoadBalancerName=self.app, InstancePort=instance_port, PolicyNames=backend_policy_list)
144436
def add_listener_policy(self, json_data):
        
        env = boto3.session.Session(profile_name=self.env, region_name=self.region)
        elbclient = env.client('elb')

        # create stickiness policy if set in configs
        stickiness = {}
        elb_settings = self.properties['elb']
        if elb_settings.get('ports'):
            ports = elb_settings['ports']
            for listener in ports:
                if listener.get("stickiness"):
                    stickiness = self.add_stickiness()
                    LOG.info('Stickiness Found: %s', stickiness)
                    break

        # Attach policies to created ELB
        for job in json.loads(json_data)['job']:
            for listener in job['listeners']:
                policies = []
                ext_port = listener['externalPort']
                if listener['listenerPolicies']:
                    policies.extend(listener['listenerPolicies'])
                if stickiness.get(ext_port):
                    policies.append(stickiness.get(ext_port))
                if policies:
                    LOG.info('Adding listener policies: %s', policies)
                    elbclient.set_load_balancer_policies_of_listener(
                        LoadBalancerName=self.app, LoadBalancerPort=ext_port, PolicyNames=policies)
637826
public void updateProfile(ProfileUpdate profile) {
		getResourceFactory().getApiResource("/user/profile/")
				.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
	}
1273431
def fw_policy_create(self, data, fw_name=None, cache=False):
        
        LOG.debug("FW Policy Debug")
        self._fw_policy_create(fw_name, data, cache)
1180357
public CMARole addPolicy(CMAPolicy policy) {
    if (policies == null) {
      policies = new ArrayList<CMAPolicy>();
    }

    policies.add(policy);
    return this;
  }
330763
protected void addProfileRolesFromAttributes(final CommonProfile profile,
                                                 final LdapAttribute ldapAttribute,
                                                 final String prefix) {
        ldapAttribute.getStringValues().forEach(value -> profile.addRole(prefix.concat(value.toUpperCase())));
    }
34457
@RequestMapping(value = "/api/profile", method = RequestMethod.POST)
    public
    @ResponseBody
    HashMap<String, Object> addProfile(Model model, String name) throws Exception {
        logger.info("Should be adding the profile name when I hit the enter button={}", name);
        return Utils.getJQGridJSON(profileService.add(name), "profile");
    }
238675
def apply_policy(self, sp_entity_id, policy, metadata=None):
        

        policy.acs = self.acs
        ava = policy.restrict(self, sp_entity_id, metadata)

        for key, val in list(self.items()):
            if key in ava:
                self[key] = ava[key]
            else:
                del self[key]

        return ava