Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ public final ListConstraintsPagedResponse listConstraints(ListConstraintsRequest
*
* <pre>{@code
* try (OrgPolicyClient orgPolicyClient = OrgPolicyClient.create()) {
* ListConstraintsRequest request =
* ListConstraintsRequest.newBuilder()
* .setParent(
* ConstraintName.ofProjectConstraintName("[PROJECT]", "[CONSTRAINT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListConstraintsResponse response = orgPolicyClient.listConstraintsCallable().call(request);
* for (Constraint element : response.getResponsesList()) {
Expand Down Expand Up @@ -576,6 +583,12 @@ public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest request)
*
* <pre>{@code
* try (OrgPolicyClient orgPolicyClient = OrgPolicyClient.create()) {
* ListPoliciesRequest request =
* ListPoliciesRequest.newBuilder()
* .setParent(PolicyName.ofProjectPolicyName("[PROJECT]", "[POLICY]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListPoliciesResponse response = orgPolicyClient.listPoliciesCallable().call(request);
* for (Policy element : response.getResponsesList()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void reset() {
@Override
public void listConstraints(
ListConstraintsRequest request, StreamObserver<ListConstraintsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListConstraintsResponse) {
requests.add(request);
responseObserver.onNext(((ListConstraintsResponse) response));
Expand All @@ -74,7 +74,7 @@ public void listConstraints(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListConstraints, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListConstraintsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -83,7 +83,7 @@ public void listConstraints(
@Override
public void listPolicies(
ListPoliciesRequest request, StreamObserver<ListPoliciesResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListPoliciesResponse) {
requests.add(request);
responseObserver.onNext(((ListPoliciesResponse) response));
Expand All @@ -95,15 +95,15 @@ public void listPolicies(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListPolicies, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListPoliciesResponse.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getPolicy(GetPolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -115,7 +115,7 @@ public void getPolicy(GetPolicyRequest request, StreamObserver<Policy> responseO
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetPolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
Expand All @@ -124,7 +124,7 @@ public void getPolicy(GetPolicyRequest request, StreamObserver<Policy> responseO
@Override
public void getEffectivePolicy(
GetEffectivePolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -136,15 +136,15 @@ public void getEffectivePolicy(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetEffectivePolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
}

@Override
public void createPolicy(CreatePolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -156,15 +156,15 @@ public void createPolicy(CreatePolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreatePolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
}

@Override
public void updatePolicy(UpdatePolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -176,15 +176,15 @@ public void updatePolicy(UpdatePolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdatePolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
}

@Override
public void deletePolicy(DeletePolicyRequest request, StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -196,7 +196,7 @@ public void deletePolicy(DeletePolicyRequest request, StreamObserver<Empty> resp
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeletePolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-orgpolicy.git",
"sha": "a9ec3fb98cb589f5f39d1aea225b95d0aa205c5e"
"sha": "bcfa0ba269f72395949c46588d43b20e2d7ad643"
}
},
{
Expand All @@ -19,8 +19,8 @@
"git": {
"name": "googleapis-gen",
"remote": "https://github.com/googleapis/googleapis-gen.git",
"sha": "ba5ec70708cd72caa1692a95ce57891e3ade61dd",
"internalRef": "361377784"
"sha": "ebd77e76effb65c4fba8c64f31c15062c250a4c2",
"internalRef": "362856902"
}
},
{
Expand Down