-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add golden generated files for wicked and collisions protos
- Loading branch information
Showing
67 changed files
with
10,907 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
.../java/com/google/showcase/v1beta1/collisions/create/SyncCreateSetCredentialsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.CollisionsSettings; | ||
import com.google.showcase.v1beta1.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 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 | ||
CollisionsSettings collisionsSettings = | ||
CollisionsSettings.newBuilder() | ||
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) | ||
.build(); | ||
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings); | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider_sync] |
39 changes: 39 additions & 0 deletions
39
...java/com/google/showcase/v1beta1/collisions/create/SyncCreateSetCredentialsProvider1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider1_sync] | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.CollisionsSettings; | ||
|
||
public class SyncCreateSetCredentialsProvider1 { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider1(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider1() 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 | ||
CollisionsSettings collisionsSettings = CollisionsSettings.newHttpJsonBuilder().build(); | ||
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings); | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_Create_SetCredentialsProvider1_sync] |
41 changes: 41 additions & 0 deletions
41
...ed/src/main/java/com/google/showcase/v1beta1/collisions/create/SyncCreateSetEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_Create_SetEndpoint_sync] | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.CollisionsSettings; | ||
import com.google.showcase.v1beta1.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 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 | ||
CollisionsSettings collisionsSettings = | ||
CollisionsSettings.newBuilder().setEndpoint(myEndpoint).build(); | ||
CollisionsClient collisionsClient = CollisionsClient.create(collisionsSettings); | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_Create_SetEndpoint_sync] |
52 changes: 52 additions & 0 deletions
52
...ed/src/main/java/com/google/showcase/v1beta1/collisions/dosomething/AsyncDoSomething.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.longrunning.Operation; | ||
import com.google.showcase.v1beta1.Annotation; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.Location; | ||
import com.google.showcase.v1beta1.Request; | ||
|
||
public class AsyncDoSomething { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncDoSomething(); | ||
} | ||
|
||
public static void asyncDoSomething() 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 | ||
try (CollisionsClient collisionsClient = CollisionsClient.create()) { | ||
Request request = | ||
Request.newBuilder() | ||
.setName("name3373707") | ||
.setAnnotation(Annotation.newBuilder().build()) | ||
.setLocation(Location.newBuilder().build()) | ||
.build(); | ||
ApiFuture<Operation> future = collisionsClient.doSomethingCallable().futureCall(request); | ||
// Do something. | ||
Operation response = future.get(); | ||
} | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_async] |
55 changes: 55 additions & 0 deletions
55
...src/main/java/com/google/showcase/v1beta1/collisions/dosomething/AsyncDoSomethingLRO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_LRO_async] | ||
import com.google.api.gax.longrunning.OperationFuture; | ||
import com.google.protobuf.DescriptorProtos; | ||
import com.google.showcase.v1beta1.Annotation; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.Location; | ||
import com.google.showcase.v1beta1.Request; | ||
|
||
public class AsyncDoSomethingLRO { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncDoSomethingLRO(); | ||
} | ||
|
||
public static void asyncDoSomethingLRO() 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 | ||
try (CollisionsClient collisionsClient = CollisionsClient.create()) { | ||
Request request = | ||
Request.newBuilder() | ||
.setName("name3373707") | ||
.setAnnotation(Annotation.newBuilder().build()) | ||
.setLocation(Location.newBuilder().build()) | ||
.build(); | ||
OperationFuture< | ||
DescriptorProtos.GeneratedCodeInfo.Annotation, | ||
DescriptorProtos.SourceCodeInfo.Location> | ||
future = collisionsClient.doSomethingOperationCallable().futureCall(request); | ||
// Do something. | ||
DescriptorProtos.GeneratedCodeInfo.Annotation response = future.get(); | ||
} | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_LRO_async] |
50 changes: 50 additions & 0 deletions
50
...ted/src/main/java/com/google/showcase/v1beta1/collisions/dosomething/SyncDoSomething.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* 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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_DoSomething_sync] | ||
import com.google.protobuf.DescriptorProtos; | ||
import com.google.showcase.v1beta1.Annotation; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
import com.google.showcase.v1beta1.Location; | ||
import com.google.showcase.v1beta1.Request; | ||
|
||
public class SyncDoSomething { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncDoSomething(); | ||
} | ||
|
||
public static void syncDoSomething() 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 | ||
try (CollisionsClient collisionsClient = CollisionsClient.create()) { | ||
Request request = | ||
Request.newBuilder() | ||
.setName("name3373707") | ||
.setAnnotation(Annotation.newBuilder().build()) | ||
.setLocation(Location.newBuilder().build()) | ||
.build(); | ||
DescriptorProtos.GeneratedCodeInfo.Annotation response = | ||
collisionsClient.doSomethingAsync(request).get(); | ||
} | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_DoSomething_sync] |
45 changes: 45 additions & 0 deletions
45
...ed/src/main/java/com/google/showcase/v1beta1/collisions/getlocation/AsyncGetLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_GetLocation_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.cloud.location.GetLocationRequest; | ||
import com.google.cloud.location.Location; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
|
||
public class AsyncGetLocation { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncGetLocation(); | ||
} | ||
|
||
public static void asyncGetLocation() 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 | ||
try (CollisionsClient collisionsClient = CollisionsClient.create()) { | ||
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); | ||
ApiFuture<Location> future = collisionsClient.getLocationCallable().futureCall(request); | ||
// Do something. | ||
Location response = future.get(); | ||
} | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_GetLocation_async] |
42 changes: 42 additions & 0 deletions
42
...ted/src/main/java/com/google/showcase/v1beta1/collisions/getlocation/SyncGetLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.showcase.v1beta1.samples; | ||
|
||
// [START localhost7469_v1beta1_generated_Collisions_GetLocation_sync] | ||
import com.google.cloud.location.GetLocationRequest; | ||
import com.google.cloud.location.Location; | ||
import com.google.showcase.v1beta1.CollisionsClient; | ||
|
||
public class SyncGetLocation { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncGetLocation(); | ||
} | ||
|
||
public static void syncGetLocation() 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 | ||
try (CollisionsClient collisionsClient = CollisionsClient.create()) { | ||
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); | ||
Location response = collisionsClient.getLocation(request); | ||
} | ||
} | ||
} | ||
// [END localhost7469_v1beta1_generated_Collisions_GetLocation_sync] |
Oops, something went wrong.