Package dev.cerbos.sdk
Class AddOrUpdatePolicyRequestBuilder
- java.lang.Object
-
- dev.cerbos.sdk.AddOrUpdatePolicyRequestBuilder
-
public class AddOrUpdatePolicyRequestBuilder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOrUpdate()Execute the addOrUpdate call.AddOrUpdatePolicyRequestBuilderwith(java.io.Reader policyJson)Read a JSON encoded policy from the given reader and add to the batch.AddOrUpdatePolicyRequestBuilderwith(java.lang.Iterable<PolicyOuterClass.Policy> policyList)Add a list of policies to the batch.AddOrUpdatePolicyRequestBuilderwith(java.lang.String policyJson)Read a JSON encoded policy from the given string and add to the batch.
-
-
-
Method Detail
-
with
public AddOrUpdatePolicyRequestBuilder with(java.io.Reader policyJson) throws java.io.IOException, io.envoyproxy.pgv.ValidationException
Read a JSON encoded policy from the given reader and add to the batch.- Parameters:
policyJson- Reader for a JSON object- Returns:
- this
- Throws:
java.io.IOException- if the policy cannot be read from the readerio.envoyproxy.pgv.ValidationException- if the policy is invalid
-
with
public AddOrUpdatePolicyRequestBuilder with(java.lang.String policyJson) throws java.io.IOException, io.envoyproxy.pgv.ValidationException
Read a JSON encoded policy from the given string and add to the batch.- Parameters:
policyJson- String containing a JSON policy- Returns:
- this
- Throws:
java.io.IOException- if the policy cannot be readio.envoyproxy.pgv.ValidationException- if the policy is invalid
-
with
public AddOrUpdatePolicyRequestBuilder with(java.lang.Iterable<PolicyOuterClass.Policy> policyList) throws io.envoyproxy.pgv.ValidationException
Add a list of policies to the batch.- Parameters:
policyList- list ofPolicyOuterClass.Policy- Returns:
- this
- Throws:
io.envoyproxy.pgv.ValidationException- if any of the policies is invalid
-
addOrUpdate
public void addOrUpdate()
Execute the addOrUpdate call.- Throws:
CerbosException- if the call fails
-
-