You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: generator setting incorrect name/class for sample due to region tag (2nd attempt) (#3293)
Fixes#1272
Tested by following instructions
https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/DEVELOPMENT.md#running-the-plugin-under-googleapis-with-local-gapic-generator-java
Ran
```
bazelisk build //google/cloud/tpu/v2:google-cloud-tpu-v2-java
```
Generated samples, included new
google-cloud-tpu-v2-java/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateUseHttpJsonTransport.java
```
/*
* Copyright 2024 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.tpu.v2.samples;
// [START tpu_v2_generated_Tpu_Create_UseHttpJsonTransport_sync]
import com.google.cloud.tpu.v2.TpuClient;
import com.google.cloud.tpu.v2.TpuSettings;
public class SyncCreateUseHttpJsonTransport {
public static void main(String[] args) throws Exception {
syncCreateUseHttpJsonTransport();
}
public static void syncCreateUseHttpJsonTransport() throws Exception {
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TpuSettings tpuSettings = TpuSettings.newHttpJsonBuilder().build();
TpuClient tpuClient = TpuClient.create(tpuSettings);
}
}
// [END tpu_v2_generated_Tpu_Create_UseHttpJsonTransport_sync]
```
Copy file name to clipboardExpand all lines: gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposer.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -338,7 +338,7 @@ public static Sample composeTransportSample(
Copy file name to clipboardExpand all lines: test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateUseHttpJsonTransport.java
Copy file name to clipboardExpand all lines: test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateUseHttpJsonTransport.java
Copy file name to clipboardExpand all lines: test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentials/create/SyncCreateUseHttpJsonTransport.java
Copy file name to clipboardExpand all lines: test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateUseHttpJsonTransport.java
Copy file name to clipboardExpand all lines: test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredis/create/SyncCreateUseHttpJsonTransport.java
0 commit comments