Skip to content

Commit 7ce4084

Browse files
committed
test: add golden generated files for wicked and collisions protos
1 parent ca740ba commit 7ce4084

File tree

67 files changed

+10907
-0
lines changed

Some content is hidden

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

67 files changed

+10907
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider_sync]
20+
import com.google.api.gax.core.FixedCredentialsProvider;
21+
import com.google.showcase.v1beta1.CollisionsClient;
22+
import com.google.showcase.v1beta1.CollisionsSettings;
23+
import com.google.showcase.v1beta1.myCredentials;
24+
25+
public class SyncCreateSetCredentialsProvider {
26+
27+
public static void main(String[] args) throws Exception {
28+
syncCreateSetCredentialsProvider();
29+
}
30+
31+
public static void syncCreateSetCredentialsProvider() throws Exception {
32+
// This snippet has been automatically generated and should be regarded as a code template only.
33+
// It will require modifications to work:
34+
// - It may require correct/in-range values for request initialization.
35+
// - It may require specifying regional endpoints when creating the service client as shown in
36+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
37+
CollisionsSettings collisionsSettings =
38+
CollisionsSettings.newBuilder()
39+
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
40+
.build();
41+
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings);
42+
}
43+
}
44+
// [END localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider1_sync]
20+
import com.google.showcase.v1beta1.CollisionsClient;
21+
import com.google.showcase.v1beta1.CollisionsSettings;
22+
23+
public class SyncCreateSetCredentialsProvider1 {
24+
25+
public static void main(String[] args) throws Exception {
26+
syncCreateSetCredentialsProvider1();
27+
}
28+
29+
public static void syncCreateSetCredentialsProvider1() throws Exception {
30+
// This snippet has been automatically generated and should be regarded as a code template only.
31+
// It will require modifications to work:
32+
// - It may require correct/in-range values for request initialization.
33+
// - It may require specifying regional endpoints when creating the service client as shown in
34+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
35+
CollisionsSettings collisionsSettings = CollisionsSettings.newHttpJsonBuilder().build();
36+
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings);
37+
}
38+
}
39+
// [END localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider1_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_Create_SetEndpoint_sync]
20+
import com.google.showcase.v1beta1.CollisionsClient;
21+
import com.google.showcase.v1beta1.CollisionsSettings;
22+
import com.google.showcase.v1beta1.myEndpoint;
23+
24+
public class SyncCreateSetEndpoint {
25+
26+
public static void main(String[] args) throws Exception {
27+
syncCreateSetEndpoint();
28+
}
29+
30+
public static void syncCreateSetEndpoint() throws Exception {
31+
// This snippet has been automatically generated and should be regarded as a code template only.
32+
// It will require modifications to work:
33+
// - It may require correct/in-range values for request initialization.
34+
// - It may require specifying regional endpoints when creating the service client as shown in
35+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
36+
CollisionsSettings collisionsSettings =
37+
CollisionsSettings.newBuilder().setEndpoint(myEndpoint).build();
38+
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings);
39+
}
40+
}
41+
// [END localhost7469_v1beta1_generated_Collisions_Create_SetEndpoint_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_async]
20+
import com.google.api.core.ApiFuture;
21+
import com.google.longrunning.Operation;
22+
import com.google.showcase.v1beta1.Annotation;
23+
import com.google.showcase.v1beta1.CollisionsClient;
24+
import com.google.showcase.v1beta1.Location;
25+
import com.google.showcase.v1beta1.Request;
26+
27+
public class AsyncDoSomething {
28+
29+
public static void main(String[] args) throws Exception {
30+
asyncDoSomething();
31+
}
32+
33+
public static void asyncDoSomething() throws Exception {
34+
// This snippet has been automatically generated and should be regarded as a code template only.
35+
// It will require modifications to work:
36+
// - It may require correct/in-range values for request initialization.
37+
// - It may require specifying regional endpoints when creating the service client as shown in
38+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
39+
try (CollisionsClient collisionsClient = CollisionsClient.create()) {
40+
Request request =
41+
Request.newBuilder()
42+
.setName("name3373707")
43+
.setAnnotation(Annotation.newBuilder().build())
44+
.setLocation(Location.newBuilder().build())
45+
.build();
46+
ApiFuture<Operation> future = collisionsClient.doSomethingCallable().futureCall(request);
47+
// Do something.
48+
Operation response = future.get();
49+
}
50+
}
51+
}
52+
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_LRO_async]
20+
import com.google.api.gax.longrunning.OperationFuture;
21+
import com.google.protobuf.DescriptorProtos;
22+
import com.google.showcase.v1beta1.Annotation;
23+
import com.google.showcase.v1beta1.CollisionsClient;
24+
import com.google.showcase.v1beta1.Location;
25+
import com.google.showcase.v1beta1.Request;
26+
27+
public class AsyncDoSomethingLRO {
28+
29+
public static void main(String[] args) throws Exception {
30+
asyncDoSomethingLRO();
31+
}
32+
33+
public static void asyncDoSomethingLRO() throws Exception {
34+
// This snippet has been automatically generated and should be regarded as a code template only.
35+
// It will require modifications to work:
36+
// - It may require correct/in-range values for request initialization.
37+
// - It may require specifying regional endpoints when creating the service client as shown in
38+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
39+
try (CollisionsClient collisionsClient = CollisionsClient.create()) {
40+
Request request =
41+
Request.newBuilder()
42+
.setName("name3373707")
43+
.setAnnotation(Annotation.newBuilder().build())
44+
.setLocation(Location.newBuilder().build())
45+
.build();
46+
OperationFuture<
47+
DescriptorProtos.GeneratedCodeInfo.Annotation,
48+
DescriptorProtos.SourceCodeInfo.Location>
49+
future = collisionsClient.doSomethingOperationCallable().futureCall(request);
50+
// Do something.
51+
DescriptorProtos.GeneratedCodeInfo.Annotation response = future.get();
52+
}
53+
}
54+
}
55+
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_LRO_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_sync]
20+
import com.google.protobuf.DescriptorProtos;
21+
import com.google.showcase.v1beta1.Annotation;
22+
import com.google.showcase.v1beta1.CollisionsClient;
23+
import com.google.showcase.v1beta1.Location;
24+
import com.google.showcase.v1beta1.Request;
25+
26+
public class SyncDoSomething {
27+
28+
public static void main(String[] args) throws Exception {
29+
syncDoSomething();
30+
}
31+
32+
public static void syncDoSomething() throws Exception {
33+
// This snippet has been automatically generated and should be regarded as a code template only.
34+
// It will require modifications to work:
35+
// - It may require correct/in-range values for request initialization.
36+
// - It may require specifying regional endpoints when creating the service client as shown in
37+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
38+
try (CollisionsClient collisionsClient = CollisionsClient.create()) {
39+
Request request =
40+
Request.newBuilder()
41+
.setName("name3373707")
42+
.setAnnotation(Annotation.newBuilder().build())
43+
.setLocation(Location.newBuilder().build())
44+
.build();
45+
DescriptorProtos.GeneratedCodeInfo.Annotation response =
46+
collisionsClient.doSomethingAsync(request).get();
47+
}
48+
}
49+
}
50+
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_GetLocation_async]
20+
import com.google.api.core.ApiFuture;
21+
import com.google.cloud.location.GetLocationRequest;
22+
import com.google.cloud.location.Location;
23+
import com.google.showcase.v1beta1.CollisionsClient;
24+
25+
public class AsyncGetLocation {
26+
27+
public static void main(String[] args) throws Exception {
28+
asyncGetLocation();
29+
}
30+
31+
public static void asyncGetLocation() throws Exception {
32+
// This snippet has been automatically generated and should be regarded as a code template only.
33+
// It will require modifications to work:
34+
// - It may require correct/in-range values for request initialization.
35+
// - It may require specifying regional endpoints when creating the service client as shown in
36+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
37+
try (CollisionsClient collisionsClient = CollisionsClient.create()) {
38+
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
39+
ApiFuture<Location> future = collisionsClient.getLocationCallable().futureCall(request);
40+
// Do something.
41+
Location response = future.get();
42+
}
43+
}
44+
}
45+
// [END localhost7469_v1beta1_generated_Collisions_GetLocation_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.showcase.v1beta1.samples;
18+
19+
// [START localhost7469_v1beta1_generated_Collisions_GetLocation_sync]
20+
import com.google.cloud.location.GetLocationRequest;
21+
import com.google.cloud.location.Location;
22+
import com.google.showcase.v1beta1.CollisionsClient;
23+
24+
public class SyncGetLocation {
25+
26+
public static void main(String[] args) throws Exception {
27+
syncGetLocation();
28+
}
29+
30+
public static void syncGetLocation() throws Exception {
31+
// This snippet has been automatically generated and should be regarded as a code template only.
32+
// It will require modifications to work:
33+
// - It may require correct/in-range values for request initialization.
34+
// - It may require specifying regional endpoints when creating the service client as shown in
35+
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
36+
try (CollisionsClient collisionsClient = CollisionsClient.create()) {
37+
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
38+
Location response = collisionsClient.getLocation(request);
39+
}
40+
}
41+
}
42+
// [END localhost7469_v1beta1_generated_Collisions_GetLocation_sync]

0 commit comments

Comments
 (0)