Specifies the {@link NetworkPolicy} to use for this request. You may specify additional policy
options using the varargs parameter.
9510
@NonNull
  public RequestCreator networkPolicy(@NonNull NetworkPolicy policy,
      @NonNull NetworkPolicy... additional) {
    data.networkPolicy(policy, additional);
    return this;
  }
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);
        }


    }
1196229
public static base_responses add(nitro_service client, dnspolicy resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnspolicy addresources[] = new dnspolicy[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new dnspolicy();
				addresources[i].name = resources[i].name;
				addresources[i].rule = resources[i].rule;
				addresources[i].viewname = resources[i].viewname;
				addresources[i].preferredlocation = resources[i].preferredlocation;
				addresources[i].preferredloclist = resources[i].preferredloclist;
				addresources[i].drop = resources[i].drop;
				addresources[i].cachebypass = resources[i].cachebypass;
				addresources[i].actionname = resources[i].actionname;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
292779
public void addPolicies(final RegisteredServiceAttributeReleasePolicy... policies) {
        this.policies.addAll(Arrays.stream(policies).collect(Collectors.toList()));
    }
458967
@Override
    public boolean updatePolicy(String name, String newDocument)
    throws PolicyStoreException {

        String pid = this.getPID(name);

        if (!contains(name)) {
            throw new PolicyStoreException("Update:  policy " + pid
                                                 + " not found");
        }

        if (datastreamControlGroup.equals("X")) {
            // inline, modify by value
            try {
                this.apiMService
                .modifyDatastreamByValue(getContext(),
                                         pid,
                                         FESL_POLICY_DATASTREAM,
                                         null,
                                         null,
                                         null,
                                         null,
                                         new ByteArrayInputStream(newDocument
                                                                  .getBytes("UTF-8")),
                                                                  "DISABLED",
                                                                  null,
                                                                  "Modifying policy " + pid,
                                                                  null);
            } catch (Exception e) {
                throw new PolicyStoreException("Update:  error modifying datastream by value for "
                                                     + pid
                                                     + " - "
                                                     + e.getMessage(),
                                                     e);
            }

        } else if (datastreamControlGroup.equals("M")) {
            // managed, generate temp location, modify by reference
            String dsLocation = null;
            try {
                ByteArrayInputStream is =
                    new ByteArrayInputStream(newDocument.getBytes("UTF-8"));
                dsLocation = apiMService.putTempStream(getContext(), is);
            } catch (Exception e) {
                throw new PolicyStoreException("Update: error generating temp datastream location - "
                                                     + e.getMessage(),
                                                     e);
            }
            try {
                apiMService.modifyDatastreamByReference(getContext(),
                                                        pid,
                                                        FESL_POLICY_DATASTREAM,
                                                        null,
                                                        null,
                                                        null,
                                                        null,
                                                        dsLocation,
                                                        "DISABLED",
                                                        null,
                                                        "Modifying policy "
                                                        + pid,
                                                        null);
            } catch (ServerException e) {
                throw new PolicyStoreException("Update:  error modifying datastream by reference for "
                                                     + pid
                                                     + " - "
                                                     + e.getMessage(),
                                                     e);
            }

        } else {
            throw new PolicyStoreException("Update:  Invalid datastream control group "
                                                 + datastreamControlGroup + " - use M or X");
        }

        return true;
    }
237962
public java.util.Map<String, String> getPolicies() {
        if (policies == null) {
            policies = new com.amazonaws.internal.SdkInternalMap<String, String>();
        }
        return policies;
    }
1345328
public GetIdentityPoliciesResult withPolicies(java.util.Map<String, String> policies) {
        setPolicies(policies);
        return this;
    }
446233
public function setPolicy(string $policy)
    {
        // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part)
        if (!in_array($policy, [self::POLICY_NONE, self::POLICY_ALLOW, self::POLICY_DENY])) {
            throw new Exception('Unsupported policy type: ' . $policy);
        }
        $this->policy = $policy;

        $this->init();   // init data after set policy (in extension)!
    }
777716
@NonNull
  public RequestCreator memoryPolicy(@NonNull MemoryPolicy policy,
      @NonNull MemoryPolicy... additional) {
    data.memoryPolicy(policy, additional);
    return this;
  }
121773
public MockResponse enqueue(SocketPolicy socketPolicy) {
    MockResponse mockResponse = new MockResponse().setSocketPolicy(socketPolicy);
    mockWebServer.enqueue(mockResponse);
    return mockResponse;
  }
991231
public void setPolicyGroups(java.util.Collection<PolicyGroup> policyGroups) {
        if (policyGroups == null) {
            this.policyGroups = null;
            return;
        }

        this.policyGroups = new com.amazonaws.internal.SdkInternalList<PolicyGroup>(policyGroups);
    }
1231979
public static base_response update(nitro_service client, dnspolicy resource) throws Exception {
		dnspolicy updateresource = new dnspolicy();
		updateresource.name = resource.name;
		updateresource.rule = resource.rule;
		updateresource.viewname = resource.viewname;
		updateresource.preferredlocation = resource.preferredlocation;
		updateresource.preferredloclist = resource.preferredloclist;
		updateresource.drop = resource.drop;
		updateresource.cachebypass = resource.cachebypass;
		updateresource.actionname = resource.actionname;
		return updateresource.update_resource(client);
	}
1260712
public static vpnsessionpolicy get(nitro_service service, String name) throws Exception{
		vpnsessionpolicy obj = new vpnsessionpolicy();
		obj.set_name(name);
		vpnsessionpolicy response = (vpnsessionpolicy) obj.get_resource(service);
		return response;
	}
1073778
static Policy getPolicy() {
        final SecurityManager sm = System.getSecurityManager();

        if (sm != null) {
            return AccessController.doPrivileged(new PrivilegedAction<Policy>() {
                public Policy run() {
                    return Policy.getPolicy();
                }
            });
        } else {
            return Policy.getPolicy();
        }
    }
1039001
public <R extends Request<T>> R setRetryPolicy(RetryPolicy retryPolicy) {
        checkIfActive();
        this.retryPolicy = retryPolicy;
        return (R) this;
    }
817572
public function setNetworkPolicy($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NetworkPolicy::class);
        $this->network_policy = $var;

        return $this;
    }
903470
public FirewallPolicyFilter where(Predicate<FirewallPolicyMetadata> predicate) {
        checkNotNull(predicate, "Predicate must be not a null");

        this.predicate = this.predicate.and(predicate);

        return this;
    }