Skip to content

Commit

Permalink
docs: [servicemanagement] update docs to existing services (#9583)
Browse files Browse the repository at this point in the history
* docs: update docs to existing services

PiperOrigin-RevId: 543515380

Source-Link: googleapis/googleapis@16df595

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d059689d626da251efa3d5e1e1c4d21c9299c02c
Copy-Tag: eyJwIjoiamF2YS1zZXJ2aWNlLW1hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6ImQwNTk2ODlkNjI2ZGEyNTFlZmEzZDVlMWUxYzRkMjFjOTI5OWMwMmMifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Add missing IAM dependencies

* chore: Ignore failing IAM tests for now

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lawrence Qiu <[email protected]>
  • Loading branch information
3 people authored Jul 20, 2023
1 parent 88ad198 commit 36f5b3c
Show file tree
Hide file tree
Showing 44 changed files with 2,368 additions and 427 deletions.
4 changes: 2 additions & 2 deletions java-service-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.16.0</version>
<version>26.19.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-service-management.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-service-management/3.17.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-service-management/3.19.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v1</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
Expand Down Expand Up @@ -97,5 +101,10 @@
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
import com.google.api.servicemanagement.v1.UndeleteServiceRequest;
import com.google.api.servicemanagement.v1.UndeleteServiceResponse;
import com.google.cloud.api.servicemanagement.v1.stub.ServiceManagerStubSettings;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
Expand Down Expand Up @@ -206,6 +211,22 @@ public UnaryCallSettings<CreateServiceRolloutRequest, Operation> createServiceRo
return ((ServiceManagerStubSettings) getStubSettings()).generateConfigReportSettings();
}

/** Returns the object with the settings used for calls to setIamPolicy. */
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return ((ServiceManagerStubSettings) getStubSettings()).setIamPolicySettings();
}

/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((ServiceManagerStubSettings) getStubSettings()).getIamPolicySettings();
}

/** Returns the object with the settings used for calls to testIamPermissions. */
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return ((ServiceManagerStubSettings) getStubSettings()).testIamPermissionsSettings();
}

public static final ServiceManagerSettings create(ServiceManagerStubSettings stub)
throws IOException {
return new ServiceManagerSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -431,6 +452,22 @@ public UnaryCallSettings.Builder<GetServiceConfigRequest, Service> getServiceCon
return getStubSettingsBuilder().generateConfigReportSettings();
}

/** Returns the builder for the settings used for calls to setIamPolicy. */
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return getStubSettingsBuilder().setIamPolicySettings();
}

/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
}

/** Returns the builder for the settings used for calls to testIamPermissions. */
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return getStubSettingsBuilder().testIamPermissionsSettings();
}

@Override
public ServiceManagerSettings build() throws IOException {
return new ServiceManagerSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"GenerateConfigReport": {
"methods": ["generateConfigReport", "generateConfigReport", "generateConfigReportCallable"]
},
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicyCallable"]
},
"GetService": {
"methods": ["getService", "getService", "getServiceCallable"]
},
Expand All @@ -43,9 +46,15 @@
"ListServices": {
"methods": ["listServices", "listServices", "listServicesPagedCallable", "listServicesCallable"]
},
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"SubmitConfigSource": {
"methods": ["submitConfigSourceAsync", "submitConfigSourceAsync", "submitConfigSourceOperationCallable", "submitConfigSourceCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
},
"UndeleteService": {
"methods": ["undeleteServiceAsync", "undeleteServiceAsync", "undeleteServiceOperationCallable", "undeleteServiceCallable"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
import com.google.api.servicemanagement.v1.SubmitConfigSourceResponse;
import com.google.api.servicemanagement.v1.UndeleteServiceRequest;
import com.google.api.servicemanagement.v1.UndeleteServiceResponse;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
Expand Down Expand Up @@ -206,6 +211,33 @@ public class GrpcServiceManagerStub extends ServiceManagerStub {
ProtoUtils.marshaller(GenerateConfigReportResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<SetIamPolicyRequest, Policy> setIamPolicyMethodDescriptor =
MethodDescriptor.<SetIamPolicyRequest, Policy>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetIamPolicyRequest, Policy> getIamPolicyMethodDescriptor =
MethodDescriptor.<GetIamPolicyRequest, Policy>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();

private static final MethodDescriptor<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsMethodDescriptor =
MethodDescriptor.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance()))
.build();

private final UnaryCallable<ListServicesRequest, ListServicesResponse> listServicesCallable;
private final UnaryCallable<ListServicesRequest, ListServicesPagedResponse>
listServicesPagedCallable;
Expand Down Expand Up @@ -240,6 +272,10 @@ public class GrpcServiceManagerStub extends ServiceManagerStub {
createServiceRolloutOperationCallable;
private final UnaryCallable<GenerateConfigReportRequest, GenerateConfigReportResponse>
generateConfigReportCallable;
private final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable;
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -402,6 +438,37 @@ protected GrpcServiceManagerStub(
GrpcCallSettings.<GenerateConfigReportRequest, GenerateConfigReportResponse>newBuilder()
.setMethodDescriptor(generateConfigReportMethodDescriptor)
.build();
GrpcCallSettings<SetIamPolicyRequest, Policy> setIamPolicyTransportSettings =
GrpcCallSettings.<SetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings<GetIamPolicyRequest, Policy> getIamPolicyTransportSettings =
GrpcCallSettings.<GetIamPolicyRequest, Policy>newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsTransportSettings =
GrpcCallSettings.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();

this.listServicesCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -499,6 +566,17 @@ protected GrpcServiceManagerStub(
generateConfigReportTransportSettings,
settings.generateConfigReportSettings(),
clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -623,6 +701,22 @@ public UnaryCallable<CreateServiceRolloutRequest, Operation> createServiceRollou
return generateConfigReportCallable;
}

@Override
public UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
return setIamPolicyCallable;
}

@Override
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
return getIamPolicyCallable;
}

@Override
public UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}

@Override
public final void close() {
try {
Expand Down
Loading

0 comments on commit 36f5b3c

Please sign in to comment.