Use this API to add scpolicy.
161182
public static base_response add(nitro_service client, scpolicy resource) throws Exception {
		scpolicy addresource = new scpolicy();
		addresource.name = resource.name;
		addresource.url = resource.url;
		addresource.rule = resource.rule;
		addresource.delay = resource.delay;
		addresource.maxconn = resource.maxconn;
		addresource.action = resource.action;
		addresource.altcontentsvcname = resource.altcontentsvcname;
		addresource.altcontentpath = resource.altcontentpath;
		return addresource.add_resource(client);
	}
292779
public void addPolicies(final RegisteredServiceAttributeReleasePolicy... policies) {
        this.policies.addAll(Arrays.stream(policies).collect(Collectors.toList()));
    }
609953
public function makePolicy()
    {
        $this->options['name'] = $this->ask('Policy Name (Example: MyPolicy)');

        if ($this->confirm('Will this policy apply to a model')) {
            $this->options['--model'] = $this->ask('Model class name');
        }
    }
1264240
def add(self, effect=None, act=None, obj=None,
            policy=None, policies=None):
        
        if policies is not None:
            for p in policies:
                self.add(policy=p)
        elif policy is not None:
            for e, a, o in policy:
                self.add(e, a, o)
        else:
            objc = obj.components if obj is not None else []
            self.tree[act.components + objc] = effect
1274449
void addEntry(SelChImpl sc) {
        putDescriptor(totalChannels, IOUtil.fdVal(sc.getFD()));
        putEventOps(totalChannels, 0);
        putReventOps(totalChannels, 0);
        totalChannels++;
    }
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);
        }


    }
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
694687
public void addPolicy(final ExpirationPolicy policy) {
        LOGGER.trace("Adding expiration policy [{}] with name [{}]", policy, policy.getName());
        this.policies.put(policy.getName(), policy);
    }
458749
public static base_response add(nitro_service client, transformpolicy resource) throws Exception {
		transformpolicy addresource = new transformpolicy();
		addresource.name = resource.name;
		addresource.rule = resource.rule;
		addresource.profilename = resource.profilename;
		addresource.comment = resource.comment;
		addresource.logaction = resource.logaction;
		return addresource.add_resource(client);
	}
240019
public static base_response update(nitro_service client, scpolicy resource) throws Exception {
		scpolicy updateresource = new scpolicy();
		updateresource.name = resource.name;
		updateresource.url = resource.url;
		updateresource.rule = resource.rule;
		updateresource.delay = resource.delay;
		updateresource.maxconn = resource.maxconn;
		updateresource.action = resource.action;
		updateresource.altcontentsvcname = resource.altcontentsvcname;
		updateresource.altcontentpath = resource.altcontentpath;
		return updateresource.update_resource(client);
	}
839840
public void addPolicies(final @NonNull RegisteredServiceSingleSignOnParticipationPolicy... policy) {
        policies.addAll(Arrays.stream(policy).collect(Collectors.toList()));
    }
1342725
private function addApiConfig() {
        $this->getDi()->setShared(ApiConfig::DI_NAME, new ApiConfig());

        $di = $this->getDi();
        $di->set(
            'dispatcher',
            function() use ($di) {

                $evManager = $di->getShared('eventsManager');

                $evManager->attach(
                    "dispatch:beforeException",
                    function($event, $dependencyInjectorspatcher, $exception)
                    {
                        switch ($exception->getCode()) {
                            case PhDispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                            case PhDispatcher::EXCEPTION_ACTION_NOT_FOUND:
                                return false;
                        }
                    }
                );
                $dependencyInjectorsPatcher = new PhDispatcher();
                $dependencyInjectorsPatcher->setEventsManager($evManager);
                return $dependencyInjectorsPatcher;
            },
            true
        );

    }
539605
CorsPolicy build() {
        return new CorsPolicy(origins, pathMappings, credentialsAllowed, maxAge, nullOriginAllowed,
                              exposedHeaders, allowedRequestHeaders, allowedRequestMethods,
                              preflightResponseHeadersDisabled, preflightResponseHeaders);
    }
573727
public static scpolicy[] get_filtered(nitro_service service, String filter) throws Exception{
		scpolicy obj = new scpolicy();
		options option = new options();
		option.set_filter(filter);
		scpolicy[] response = (scpolicy[]) obj.getfiltered(service, option);
		return response;
	}
971926
def add(self, name, *args):
        """"""
        self._add(False, self.authority, name, *args)
77077
def add(self):
        """"""

        yield self.client.create(self.path)
        yield self.client.create(self.path + "/type", self.name)
        yield self.client.create(self.path + "/state")
        yield self.client.create(self.path + "/machines", "[]")

        log.debug("registered service '%s' at %s." % (self.name, self.path))
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);
	}