Skip to content

Commit

Permalink
chore: Integrate new gapic-generator-java and rules_gapic (#743)
Browse files Browse the repository at this point in the history
* chore: Integrate new gapic-generator-java and rules_gapic

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9

chore: include generated samples dir

PiperOrigin-RevId: 450696442

Source-Link: googleapis/googleapis@da052c9

Source-Link: https://github.com/googleapis/googleapis-gen/commit/4800d1f2ea50e2cad9ce78b34185e9577029db5c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDgwMGQxZjJlYTUwZTJjYWQ5Y2U3OGIzNDE4NWU5NTc3MDI5ZGI1YyJ9

chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1

PiperOrigin-RevId: 450543911

Source-Link: googleapis/googleapis@5528344

Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f6775cab1958982b88967a43e5e806af0f135db
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jun 13, 2022
1 parent 31a92e7 commit 39ab148
Show file tree
Hide file tree
Showing 37 changed files with 1,586 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
Expand Down Expand Up @@ -156,7 +155,6 @@ public static final AccessApprovalAdminClient create(AccessApprovalAdminSettings
* Constructs an instance of AccessApprovalAdminClient, using the given stub for making calls.
* This is for advanced usage - prefer using create(AccessApprovalAdminSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final AccessApprovalAdminClient create(AccessApprovalStub stub) {
return new AccessApprovalAdminClient(stub);
}
Expand All @@ -171,7 +169,6 @@ protected AccessApprovalAdminClient(AccessApprovalAdminSettings settings) throws
this.stub = ((AccessApprovalStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected AccessApprovalAdminClient(AccessApprovalStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -181,7 +178,6 @@ public final AccessApprovalAdminSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AccessApprovalStub getStub() {
return stub;
}
Expand Down Expand Up @@ -394,7 +390,7 @@ public final ListApprovalRequestsPagedResponse listApprovalRequests(
* while (true) {
* ListApprovalRequestsResponse response =
* accessApprovalAdminClient.listApprovalRequestsCallable().call(request);
* for (ApprovalRequest element : response.getResponsesList()) {
* for (ApprovalRequest element : response.getApprovalRequestsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ public ApiFuture<ListApprovalRequestsPagedResponse> getFuturePagedResponse(
return getAccessApprovalServiceAccountSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AccessApprovalStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.ApprovalRequest;
import com.google.cloud.accessapproval.v1.ApprovalRequestName;
import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage;
import com.google.protobuf.Timestamp;

public class AsyncApproveApprovalRequest {

public static void main(String[] args) throws Exception {
asyncApproveApprovalRequest();
}

public static void asyncApproveApprovalRequest() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) {
ApproveApprovalRequestMessage request =
ApproveApprovalRequestMessage.newBuilder()
.setName(
ApprovalRequestName.ofProjectApprovalRequestName(
"[PROJECT]", "[APPROVAL_REQUEST]")
.toString())
.setExpireTime(Timestamp.newBuilder().build())
.build();
ApiFuture<ApprovalRequest> future =
accessApprovalAdminClient.approveApprovalRequestCallable().futureCall(request);
// Do something.
ApprovalRequest response = future.get();
}
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_sync]
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.ApprovalRequest;
import com.google.cloud.accessapproval.v1.ApprovalRequestName;
import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage;
import com.google.protobuf.Timestamp;

public class SyncApproveApprovalRequest {

public static void main(String[] args) throws Exception {
syncApproveApprovalRequest();
}

public static void syncApproveApprovalRequest() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) {
ApproveApprovalRequestMessage request =
ApproveApprovalRequestMessage.newBuilder()
.setName(
ApprovalRequestName.ofProjectApprovalRequestName(
"[PROJECT]", "[APPROVAL_REQUEST]")
.toString())
.setExpireTime(Timestamp.newBuilder().build())
.build();
ApprovalRequest response = accessApprovalAdminClient.approveApprovalRequest(request);
}
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_create_setcredentialsprovider_sync]
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.AccessApprovalAdminSettings;
import com.google.cloud.accessapproval.v1.myCredentials;

public class SyncCreateSetCredentialsProvider {

public static void main(String[] args) throws Exception {
syncCreateSetCredentialsProvider();
}

public static void syncCreateSetCredentialsProvider() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
AccessApprovalAdminSettings accessApprovalAdminSettings =
AccessApprovalAdminSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AccessApprovalAdminClient accessApprovalAdminClient =
AccessApprovalAdminClient.create(accessApprovalAdminSettings);
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_create_setcredentialsprovider_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_create_setendpoint_sync]
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.AccessApprovalAdminSettings;
import com.google.cloud.accessapproval.v1.myEndpoint;

public class SyncCreateSetEndpoint {

public static void main(String[] args) throws Exception {
syncCreateSetEndpoint();
}

public static void syncCreateSetEndpoint() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
AccessApprovalAdminSettings accessApprovalAdminSettings =
AccessApprovalAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
AccessApprovalAdminClient accessApprovalAdminClient =
AccessApprovalAdminClient.create(accessApprovalAdminSettings);
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_create_setendpoint_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName;
import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage;
import com.google.protobuf.Empty;

public class AsyncDeleteAccessApprovalSettings {

public static void main(String[] args) throws Exception {
asyncDeleteAccessApprovalSettings();
}

public static void asyncDeleteAccessApprovalSettings() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) {
DeleteAccessApprovalSettingsMessage request =
DeleteAccessApprovalSettingsMessage.newBuilder()
.setName(AccessApprovalSettingsName.ofProjectName("[PROJECT]").toString())
.build();
ApiFuture<Empty> future =
accessApprovalAdminClient.deleteAccessApprovalSettingsCallable().futureCall(request);
// Do something.
future.get();
}
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_sync]
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName;
import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage;

public class SyncDeleteAccessApprovalSettings {

public static void main(String[] args) throws Exception {
syncDeleteAccessApprovalSettings();
}

public static void syncDeleteAccessApprovalSettings() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) {
DeleteAccessApprovalSettingsMessage request =
DeleteAccessApprovalSettingsMessage.newBuilder()
.setName(AccessApprovalSettingsName.ofProjectName("[PROJECT]").toString())
.build();
accessApprovalAdminClient.deleteAccessApprovalSettings(request);
}
}
}
// [END accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.accessapproval.v1.samples;

// [START
// accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_accessapprovalsettingsname_sync]
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient;
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName;

public class SyncDeleteAccessApprovalSettingsAccessapprovalsettingsname {

public static void main(String[] args) throws Exception {
syncDeleteAccessApprovalSettingsAccessapprovalsettingsname();
}

public static void syncDeleteAccessApprovalSettingsAccessapprovalsettingsname() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) {
AccessApprovalSettingsName name = AccessApprovalSettingsName.ofProjectName("[PROJECT]");
accessApprovalAdminClient.deleteAccessApprovalSettings(name);
}
}
}
// [END
// accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_accessapprovalsettingsname_sync]
Loading

0 comments on commit 39ab148

Please sign in to comment.