Skip to content

Commit

Permalink
test: add golden generated files for wicked and collisions protos
Browse files Browse the repository at this point in the history
  • Loading branch information
emmileaf committed May 31, 2023
1 parent ca740ba commit 7ce4084
Show file tree
Hide file tree
Showing 67 changed files with 10,907 additions and 0 deletions.
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]
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]
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]
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]
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]
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]
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]
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]
Loading

0 comments on commit 7ce4084

Please sign in to comment.