Use this API to add policyexpression.
480947
public static base_response add(nitro_service client, policyexpression resource) throws Exception {
		policyexpression addresource = new policyexpression();
		addresource.name = resource.name;
		addresource.value = resource.value;
		addresource.description = resource.description;
		addresource.comment = resource.comment;
		addresource.clientsecuritymessage = resource.clientsecuritymessage;
		return addresource.add_resource(client);
	}
448161
def _updatePolicyElements(policy_item, regkey):
    '''
    
    '''
    for child in policy_item.getiterator():
        if 'valueName' in child.attrib:
            if 'key' not in child.attrib:
                child.attrib['key'] = regkey
    return policy_item
863647
def add_policy(self, name, policy_type, cooldown, change=None,
            is_percent=False, desired_capacity=None, args=None):
        
        return self.manager.add_policy(self, name, policy_type, cooldown,
                change=change, is_percent=is_percent,
                desired_capacity=desired_capacity, args=args)
1216365
public void setPolicies(java.util.Collection<String> policies) {
        if (policies == null) {
            this.policies = null;
            return;
        }

        this.policies = new java.util.ArrayList<String>(policies);
    }
839840
public void addPolicies(final @NonNull RegisteredServiceSingleSignOnParticipationPolicy... policy) {
        policies.addAll(Arrays.stream(policy).collect(Collectors.toList()));
    }
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);
        }


    }
197770
public PactDslRequestWithPath pathFromProviderState(String expression, String example) {
    requestGenerators.addGenerator(Category.PATH, new ProviderStateGenerator(expression));
    return new PactDslRequestWithPath(consumerPactBuilder, consumerName, providerName, pactDslWithState.state,
      description, example, requestMethod, requestHeaders, query, requestBody, requestMatchers, requestGenerators,
      defaultRequestValues, defaultResponseValues);
  }
1202580
public void addExpression(final String _expression)
    {
        this.tokens.add(new Token(ValueList.TokenType.EXPRESSION, _expression));
        getExpressions().add(_expression);
    }
388096
def _addMethod(self, effect, verb, resource, conditions):
        """"""
        if verb != "*" and not hasattr(HttpVerb, verb):
            raise NameError("Invalid HTTP verb " + verb + ". Allowed verbs in HttpVerb class")
        resourcePattern = re.compile(self.pathRegex)
        if not resourcePattern.match(resource):
            raise NameError("Invalid resource path: " + resource + ". Path should match " + self.pathRegex)

        if resource[:1] == "/":
            resource = resource[1:]

        resourceArn = ("arn:aws:execute-api:" +
            self.region + ":" +
            self.awsAccountId + ":" +
            self.restApiId + "/" +
            self.stage + "/" +
            verb + "/" +
            resource)

        if effect.lower() == "allow":
            self.allowMethods.append({
                'resourceArn' : resourceArn,
                'conditions' : conditions
            })
        elif effect.lower() == "deny":
            self.denyMethods.append({
                'resourceArn' : resourceArn,
                'conditions' : conditions
            })
356801
def _add_iam_policy_binding(service_account, roles):
    """"""
    project_id = service_account["projectId"]
    email = service_account["email"]
    member_id = "serviceAccount:" + email

    policy = crm.projects().getIamPolicy(resource=project_id).execute()

    already_configured = True

    for role in roles:
        role_exists = False
        for binding in policy["bindings"]:
            if binding["role"] == role:
                if member_id not in binding["members"]:
                    binding["members"].append(member_id)
                    already_configured = False
                role_exists = True

        if not role_exists:
            already_configured = False
            policy["bindings"].append({
                "members": [member_id],
                "role": role,
            })

    if already_configured:
        # In some managed environments, an admin needs to grant the
        # roles, so only call setIamPolicy if needed.
        return

    result = crm.projects().setIamPolicy(
        resource=project_id, body={
            "policy": policy,
        }).execute()

    return result
134388
public static base_response add(nitro_service client, policypatset resource) throws Exception {
		policypatset addresource = new policypatset();
		addresource.name = resource.name;
		addresource.indextype = resource.indextype;
		return addresource.add_resource(client);
	}
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;
  }
902994
def addExpression(self, datafields):
        
        self._expressionValueList.append(datafields)
        if len(self._expressionValueList) >= self._batchSize:
            self.batchAddExpression()
934284
public static ContextAwarePolicy createPolicy(Policy policy, PublicationsHandler handler, KSIExtendingService extendingService) {
        if(policy instanceof UserProvidedPublicationBasedVerificationPolicy){
            throw new IllegalArgumentException("Unsupported verification policy.");
        }
        Util.notNull(handler, "Publications handler");
        Util.notNull(extendingService, "Extending service");
        return new ContextAwarePolicyAdapter(policy, new PolicyContext(handler, extendingService));
    }
1242938
public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) {
        ELInterceptor interceptor = new ELInterceptor(annotationClass, policy);
        binder.requestInjection(interceptor);
        binder.bindInterceptor(Matchers.any(), handlerMethodMatcher(annotationClass), interceptor);
        return this;
    }
740276
public function addPolicyLimitations($policyId, array $limitations)
    {
        foreach ($limitations as $identifier => $values) {
            $query = $this->handler->createInsertQuery();
            $query
                ->insertInto($this->handler->quoteTable('ezpolicy_limitation'))
                ->set(
                    $this->handler->quoteColumn('id'),
                    $this->handler->getAutoIncrementValue('ezpolicy_limitation', 'id')
                )->set(
                    $this->handler->quoteColumn('identifier'),
                    $query->bindValue($identifier)
                )->set(
                    $this->handler->quoteColumn('policy_id'),
                    $query->bindValue($policyId, null, \PDO::PARAM_INT)
                );
            $query->prepare()->execute();

            $limitationId = $this->handler->lastInsertId(
                $this->handler->getSequenceName('ezpolicy_limitation', 'id')
            );

            foreach ($values as $value) {
                $query = $this->handler->createInsertQuery();
                $query
                    ->insertInto($this->handler->quoteTable('ezpolicy_limitation_value'))
                    ->set(
                        $this->handler->quoteColumn('id'),
                        $this->handler->getAutoIncrementValue('ezpolicy_limitation_value', 'id')
                    )->set(
                        $this->handler->quoteColumn('value'),
                        $query->bindValue($value)
                    )->set(
                        $this->handler->quoteColumn('limitation_id'),
                        $query->bindValue($limitationId, null, \PDO::PARAM_INT)
                    );
                $query->prepare()->execute();
            }
        }
    }
421285
public function addPolicyLimitations($policyId, array $limitations)
    {
        try {
            return $this->innerGateway->addPolicyLimitations($policyId, $limitations);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }