Skip to content

Commit 16f26f6

Browse files
authored
feat: update autogenerated snippet disclaimer (#1029)
* feat: update autogenerated snippet disclaimer * update integration tests
1 parent 0a89829 commit 16f26f6

File tree

944 files changed

+9100
-3638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

944 files changed

+9100
-3638
lines changed

src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ public class CommentComposer {
6060
Arrays.asList(
6161
CommentStatement.withComment(
6262
LineComment.withComment(
63-
"This snippet has been automatically generated for illustrative purposes only.")),
63+
"This snippet has been automatically generated and should be regarded as a code template only.")),
64+
CommentStatement.withComment(
65+
LineComment.withComment("It will require modifications to work:")),
66+
CommentStatement.withComment(
67+
LineComment.withComment(
68+
"- It may require correct/in-range values for request initialization.")),
69+
CommentStatement.withComment(
70+
LineComment.withComment(
71+
"- It may require specifying regional endpoints when creating the service client as shown in")),
6472
CommentStatement.withComment(
6573
LineComment.withComment(
66-
"It may require modifications to work in your environment.")));
74+
"https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library")));
6775
}

src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/BookshopClient.golden

+35-14
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ import javax.annotation.Generated;
1616
* that map to API methods. Sample code to get started:
1717
*
1818
* <pre>{@code
19-
* // This snippet has been automatically generated for illustrative purposes only.
20-
* // It may require modifications to work in your environment.
19+
* // This snippet has been automatically generated and should be regarded as a code template only.
20+
* // It will require modifications to work:
21+
* // - It may require correct/in-range values for request initialization.
22+
* // - It may require specifying regional endpoints when creating the service client as shown in
23+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2124
* try (BookshopClient bookshopClient = BookshopClient.create()) {
2225
* int booksCount = 1618425911;
2326
* List<Book> books = new ArrayList<>();
@@ -54,8 +57,11 @@ import javax.annotation.Generated;
5457
* <p>To customize credentials:
5558
*
5659
* <pre>{@code
57-
* // This snippet has been automatically generated for illustrative purposes only.
58-
* // It may require modifications to work in your environment.
60+
* // This snippet has been automatically generated and should be regarded as a code template only.
61+
* // It will require modifications to work:
62+
* // - It may require correct/in-range values for request initialization.
63+
* // - It may require specifying regional endpoints when creating the service client as shown in
64+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5965
* BookshopSettings bookshopSettings =
6066
* BookshopSettings.newBuilder()
6167
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -66,8 +72,11 @@ import javax.annotation.Generated;
6672
* <p>To customize the endpoint:
6773
*
6874
* <pre>{@code
69-
* // This snippet has been automatically generated for illustrative purposes only.
70-
* // It may require modifications to work in your environment.
75+
* // This snippet has been automatically generated and should be regarded as a code template only.
76+
* // It will require modifications to work:
77+
* // - It may require correct/in-range values for request initialization.
78+
* // - It may require specifying regional endpoints when creating the service client as shown in
79+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
7180
* BookshopSettings bookshopSettings =
7281
* BookshopSettings.newBuilder().setEndpoint(myEndpoint).build();
7382
* BookshopClient bookshopClient = BookshopClient.create(bookshopSettings);
@@ -129,8 +138,11 @@ public class BookshopClient implements BackgroundResource {
129138
* Sample code:
130139
*
131140
* <pre>{@code
132-
* // This snippet has been automatically generated for illustrative purposes only.
133-
* // It may require modifications to work in your environment.
141+
* // This snippet has been automatically generated and should be regarded as a code template only.
142+
* // It will require modifications to work:
143+
* // - It may require correct/in-range values for request initialization.
144+
* // - It may require specifying regional endpoints when creating the service client as shown in
145+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
134146
* try (BookshopClient bookshopClient = BookshopClient.create()) {
135147
* int booksCount = 1618425911;
136148
* List<Book> books = new ArrayList<>();
@@ -153,8 +165,11 @@ public class BookshopClient implements BackgroundResource {
153165
* Sample code:
154166
*
155167
* <pre>{@code
156-
* // This snippet has been automatically generated for illustrative purposes only.
157-
* // It may require modifications to work in your environment.
168+
* // This snippet has been automatically generated and should be regarded as a code template only.
169+
* // It will require modifications to work:
170+
* // - It may require correct/in-range values for request initialization.
171+
* // - It may require specifying regional endpoints when creating the service client as shown in
172+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
158173
* try (BookshopClient bookshopClient = BookshopClient.create()) {
159174
* String booksList = "booksList2-1119589686";
160175
* List<Book> books = new ArrayList<>();
@@ -177,8 +192,11 @@ public class BookshopClient implements BackgroundResource {
177192
* Sample code:
178193
*
179194
* <pre>{@code
180-
* // This snippet has been automatically generated for illustrative purposes only.
181-
* // It may require modifications to work in your environment.
195+
* // This snippet has been automatically generated and should be regarded as a code template only.
196+
* // It will require modifications to work:
197+
* // - It may require correct/in-range values for request initialization.
198+
* // - It may require specifying regional endpoints when creating the service client as shown in
199+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
182200
* try (BookshopClient bookshopClient = BookshopClient.create()) {
183201
* GetBookRequest request =
184202
* GetBookRequest.newBuilder()
@@ -202,8 +220,11 @@ public class BookshopClient implements BackgroundResource {
202220
* Sample code:
203221
*
204222
* <pre>{@code
205-
* // This snippet has been automatically generated for illustrative purposes only.
206-
* // It may require modifications to work in your environment.
223+
* // This snippet has been automatically generated and should be regarded as a code template only.
224+
* // It will require modifications to work:
225+
* // - It may require correct/in-range values for request initialization.
226+
* // - It may require specifying regional endpoints when creating the service client as shown in
227+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
207228
* try (BookshopClient bookshopClient = BookshopClient.create()) {
208229
* GetBookRequest request =
209230
* GetBookRequest.newBuilder()

src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceClient.golden

+35-14
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ import javax.annotation.Generated;
1515
* that map to API methods. Sample code to get started:
1616
*
1717
* <pre>{@code
18-
* // This snippet has been automatically generated for illustrative purposes only.
19-
* // It may require modifications to work in your environment.
18+
* // This snippet has been automatically generated and should be regarded as a code template only.
19+
* // It will require modifications to work:
20+
* // - It may require correct/in-range values for request initialization.
21+
* // - It may require specifying regional endpoints when creating the service client as shown in
22+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2023
* try (DeprecatedServiceClient deprecatedServiceClient = DeprecatedServiceClient.create()) {
2124
* FibonacciRequest request = FibonacciRequest.newBuilder().setValue(111972721).build();
2225
* deprecatedServiceClient.fastFibonacci(request);
@@ -53,8 +56,11 @@ import javax.annotation.Generated;
5356
* <p>To customize credentials:
5457
*
5558
* <pre>{@code
56-
* // This snippet has been automatically generated for illustrative purposes only.
57-
* // It may require modifications to work in your environment.
59+
* // This snippet has been automatically generated and should be regarded as a code template only.
60+
* // It will require modifications to work:
61+
* // - It may require correct/in-range values for request initialization.
62+
* // - It may require specifying regional endpoints when creating the service client as shown in
63+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5864
* DeprecatedServiceSettings deprecatedServiceSettings =
5965
* DeprecatedServiceSettings.newBuilder()
6066
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -66,8 +72,11 @@ import javax.annotation.Generated;
6672
* <p>To customize the endpoint:
6773
*
6874
* <pre>{@code
69-
* // This snippet has been automatically generated for illustrative purposes only.
70-
* // It may require modifications to work in your environment.
75+
* // This snippet has been automatically generated and should be regarded as a code template only.
76+
* // It will require modifications to work:
77+
* // - It may require correct/in-range values for request initialization.
78+
* // - It may require specifying regional endpoints when creating the service client as shown in
79+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
7180
* DeprecatedServiceSettings deprecatedServiceSettings =
7281
* DeprecatedServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
7382
* DeprecatedServiceClient deprecatedServiceClient =
@@ -134,8 +143,11 @@ public class DeprecatedServiceClient implements BackgroundResource {
134143
* Sample code:
135144
*
136145
* <pre>{@code
137-
* // This snippet has been automatically generated for illustrative purposes only.
138-
* // It may require modifications to work in your environment.
146+
* // This snippet has been automatically generated and should be regarded as a code template only.
147+
* // It will require modifications to work:
148+
* // - It may require correct/in-range values for request initialization.
149+
* // - It may require specifying regional endpoints when creating the service client as shown in
150+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
139151
* try (DeprecatedServiceClient deprecatedServiceClient = DeprecatedServiceClient.create()) {
140152
* FibonacciRequest request = FibonacciRequest.newBuilder().setValue(111972721).build();
141153
* deprecatedServiceClient.fastFibonacci(request);
@@ -154,8 +166,11 @@ public class DeprecatedServiceClient implements BackgroundResource {
154166
* Sample code:
155167
*
156168
* <pre>{@code
157-
* // This snippet has been automatically generated for illustrative purposes only.
158-
* // It may require modifications to work in your environment.
169+
* // This snippet has been automatically generated and should be regarded as a code template only.
170+
* // It will require modifications to work:
171+
* // - It may require correct/in-range values for request initialization.
172+
* // - It may require specifying regional endpoints when creating the service client as shown in
173+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
159174
* try (DeprecatedServiceClient deprecatedServiceClient = DeprecatedServiceClient.create()) {
160175
* FibonacciRequest request = FibonacciRequest.newBuilder().setValue(111972721).build();
161176
* ApiFuture<Empty> future = deprecatedServiceClient.fastFibonacciCallable().futureCall(request);
@@ -173,8 +188,11 @@ public class DeprecatedServiceClient implements BackgroundResource {
173188
* Sample code:
174189
*
175190
* <pre>{@code
176-
* // This snippet has been automatically generated for illustrative purposes only.
177-
* // It may require modifications to work in your environment.
191+
* // This snippet has been automatically generated and should be regarded as a code template only.
192+
* // It will require modifications to work:
193+
* // - It may require correct/in-range values for request initialization.
194+
* // - It may require specifying regional endpoints when creating the service client as shown in
195+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
178196
* try (DeprecatedServiceClient deprecatedServiceClient = DeprecatedServiceClient.create()) {
179197
* FibonacciRequest request = FibonacciRequest.newBuilder().setValue(111972721).build();
180198
* deprecatedServiceClient.slowFibonacci(request);
@@ -195,8 +213,11 @@ public class DeprecatedServiceClient implements BackgroundResource {
195213
* Sample code:
196214
*
197215
* <pre>{@code
198-
* // This snippet has been automatically generated for illustrative purposes only.
199-
* // It may require modifications to work in your environment.
216+
* // This snippet has been automatically generated and should be regarded as a code template only.
217+
* // It will require modifications to work:
218+
* // - It may require correct/in-range values for request initialization.
219+
* // - It may require specifying regional endpoints when creating the service client as shown in
220+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
200221
* try (DeprecatedServiceClient deprecatedServiceClient = DeprecatedServiceClient.create()) {
201222
* FibonacciRequest request = FibonacciRequest.newBuilder().setValue(111972721).build();
202223
* ApiFuture<Empty> future = deprecatedServiceClient.slowFibonacciCallable().futureCall(request);

src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ import javax.annotation.Generated;
3535
* <p>For example, to set the total timeout of fastFibonacci to 30 seconds:
3636
*
3737
* <pre>{@code
38-
* // This snippet has been automatically generated for illustrative purposes only.
39-
* // It may require modifications to work in your environment.
38+
* // This snippet has been automatically generated and should be regarded as a code template only.
39+
* // It will require modifications to work:
40+
* // - It may require correct/in-range values for request initialization.
41+
* // - It may require specifying regional endpoints when creating the service client as shown in
42+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4043
* DeprecatedServiceSettings.Builder deprecatedServiceSettingsBuilder =
4144
* DeprecatedServiceSettings.newBuilder();
4245
* deprecatedServiceSettingsBuilder

src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceStubSettings.golden

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ import org.threeten.bp.Duration;
4444
* <p>For example, to set the total timeout of fastFibonacci to 30 seconds:
4545
*
4646
* <pre>{@code
47-
* // This snippet has been automatically generated for illustrative purposes only.
48-
* // It may require modifications to work in your environment.
47+
* // This snippet has been automatically generated and should be regarded as a code template only.
48+
* // It will require modifications to work:
49+
* // - It may require correct/in-range values for request initialization.
50+
* // - It may require specifying regional endpoints when creating the service client as shown in
51+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4952
* DeprecatedServiceStubSettings.Builder deprecatedServiceSettingsBuilder =
5053
* DeprecatedServiceStubSettings.newBuilder();
5154
* deprecatedServiceSettingsBuilder

0 commit comments

Comments
 (0)