Skip to content

Commit 4814ee4

Browse files
feat: [cloudcommerceconsumerprocurement] Consumer Procurement API v1 (#9681)
* feat: Consumer Procurement API v1 fix: correct csharp, php, and ruby package namespaces for order.proto PiperOrigin-RevId: 551246266 Source-Link: googleapis/googleapis@c87770d Source-Link: https://github.com/googleapis/googleapis-gen/commit/26b976ee3f9eaa7b2e5d5ecd809ec4314f90df66 Copy-Tag: eyJwIjoiamF2YS1jbG91ZGNvbW1lcmNlY29uc3VtZXJwcm9jdXJlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiMjZiOTc2ZWUzZjllYWE3YjJlNWQ1ZWNkODA5ZWM0MzE0ZjkwZGY2NiJ9 feat: Consumer Procurement API v1 Initial release of Order-related APIs for the GCP Consumer Procurement API. PiperOrigin-RevId: 550547826 Source-Link: googleapis/googleapis@318544e Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0a2a7bd8e87ebba313a8a30e5d2330bd2824404 Copy-Tag: eyJwIjoiamF2YS1jbG91ZGNvbW1lcmNlY29uc3VtZXJwcm9jdXJlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiYjBhMmE3YmQ4ZTg3ZWJiYTMxM2E4YTMwZTVkMjMzMGJkMjgyNDQwNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix cloudcommerceconsumerprocurement pom --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Joe Wang <[email protected]>
1 parent 19df621 commit 4814ee4

File tree

69 files changed

+26739
-1
lines changed

Some content is hidden

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

69 files changed

+26739
-1
lines changed

java-cloudcommerceconsumerprocurement/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
201201
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
202202
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
203203
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-cloudcommerceconsumerprocurement.svg
204-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-cloudcommerceconsumerprocurement/0.19.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-cloudcommerceconsumerprocurement/0.20.0
205205
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
206206
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
207207
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-cloudcommerceconsumerprocurement/google-cloud-cloudcommerceconsumerprocurement-bom/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,21 @@
3434
<artifactId>grpc-google-cloud-cloudcommerceconsumerprocurement-v1alpha1</artifactId>
3535
<version>0.21.0-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-cloudcommerceconsumerprocurement-v1alpha1:current} -->
3636
</dependency>
37+
<dependency>
38+
<groupId>com.google.api.grpc</groupId>
39+
<artifactId>grpc-google-cloud-cloudcommerceconsumerprocurement-v1</artifactId>
40+
<version>0.21.0-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-cloudcommerceconsumerprocurement-v1:current} -->
41+
</dependency>
3742
<dependency>
3843
<groupId>com.google.api.grpc</groupId>
3944
<artifactId>proto-google-cloud-cloudcommerceconsumerprocurement-v1alpha1</artifactId>
4045
<version>0.21.0-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-cloudcommerceconsumerprocurement-v1alpha1:current} -->
4146
</dependency>
47+
<dependency>
48+
<groupId>com.google.api.grpc</groupId>
49+
<artifactId>proto-google-cloud-cloudcommerceconsumerprocurement-v1</artifactId>
50+
<version>0.21.0-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-cloudcommerceconsumerprocurement-v1:current} -->
51+
</dependency>
4252
</dependencies>
4353
</dependencyManagement>
4454
</project>

java-cloudcommerceconsumerprocurement/google-cloud-cloudcommerceconsumerprocurement/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<artifactId>proto-google-common-protos</artifactId>
4242
</dependency>
4343

44+
<dependency>
45+
<groupId>com.google.api.grpc</groupId>
46+
<artifactId>proto-google-cloud-cloudcommerceconsumerprocurement-v1</artifactId>
47+
</dependency>
4448
<dependency>
4549
<groupId>com.google.api.grpc</groupId>
4650
<artifactId>proto-google-cloud-cloudcommerceconsumerprocurement-v1alpha1</artifactId>
@@ -78,6 +82,11 @@
7882
<artifactId>grpc-google-cloud-cloudcommerceconsumerprocurement-v1alpha1</artifactId>
7983
<scope>test</scope>
8084
</dependency>
85+
<dependency>
86+
<groupId>com.google.api.grpc</groupId>
87+
<artifactId>grpc-google-cloud-cloudcommerceconsumerprocurement-v1</artifactId>
88+
<scope>test</scope>
89+
</dependency>
8190
<!-- Need testing utility classes for generated gRPC clients tests -->
8291
<dependency>
8392
<groupId>com.google.api</groupId>

java-cloudcommerceconsumerprocurement/google-cloud-cloudcommerceconsumerprocurement/src/main/java/com/google/cloud/commerce/consumer/procurement/v1/ConsumerProcurementServiceClient.java

Lines changed: 663 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
/*
2+
* Copyright 2023 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.cloud.commerce.consumer.procurement.v1;
18+
19+
import static com.google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementServiceClient.ListOrdersPagedResponse;
20+
21+
import com.google.api.core.ApiFunction;
22+
import com.google.api.core.BetaApi;
23+
import com.google.api.gax.core.GoogleCredentialsProvider;
24+
import com.google.api.gax.core.InstantiatingExecutorProvider;
25+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
26+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
27+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
28+
import com.google.api.gax.rpc.ClientContext;
29+
import com.google.api.gax.rpc.ClientSettings;
30+
import com.google.api.gax.rpc.OperationCallSettings;
31+
import com.google.api.gax.rpc.PagedCallSettings;
32+
import com.google.api.gax.rpc.TransportChannelProvider;
33+
import com.google.api.gax.rpc.UnaryCallSettings;
34+
import com.google.cloud.commerce.consumer.procurement.v1.stub.ConsumerProcurementServiceStubSettings;
35+
import com.google.longrunning.Operation;
36+
import java.io.IOException;
37+
import java.util.List;
38+
import javax.annotation.Generated;
39+
40+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
41+
/**
42+
* Settings class to configure an instance of {@link ConsumerProcurementServiceClient}.
43+
*
44+
* <p>The default instance has everything set to sensible defaults:
45+
*
46+
* <ul>
47+
* <li>The default service address (cloudcommerceconsumerprocurement.googleapis.com) and default
48+
* port (443) are used.
49+
* <li>Credentials are acquired automatically through Application Default Credentials.
50+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
51+
* </ul>
52+
*
53+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
54+
* build() is called, the tree of builders is called to create the complete settings object.
55+
*
56+
* <p>For example, to set the total timeout of getOrder to 30 seconds:
57+
*
58+
* <pre>{@code
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
64+
* ConsumerProcurementServiceSettings.Builder consumerProcurementServiceSettingsBuilder =
65+
* ConsumerProcurementServiceSettings.newBuilder();
66+
* consumerProcurementServiceSettingsBuilder
67+
* .getOrderSettings()
68+
* .setRetrySettings(
69+
* consumerProcurementServiceSettingsBuilder
70+
* .getOrderSettings()
71+
* .getRetrySettings()
72+
* .toBuilder()
73+
* .setTotalTimeout(Duration.ofSeconds(30))
74+
* .build());
75+
* ConsumerProcurementServiceSettings consumerProcurementServiceSettings =
76+
* consumerProcurementServiceSettingsBuilder.build();
77+
* }</pre>
78+
*/
79+
@Generated("by gapic-generator-java")
80+
public class ConsumerProcurementServiceSettings
81+
extends ClientSettings<ConsumerProcurementServiceSettings> {
82+
83+
/** Returns the object with the settings used for calls to placeOrder. */
84+
public UnaryCallSettings<PlaceOrderRequest, Operation> placeOrderSettings() {
85+
return ((ConsumerProcurementServiceStubSettings) getStubSettings()).placeOrderSettings();
86+
}
87+
88+
/** Returns the object with the settings used for calls to placeOrder. */
89+
public OperationCallSettings<PlaceOrderRequest, Order, PlaceOrderMetadata>
90+
placeOrderOperationSettings() {
91+
return ((ConsumerProcurementServiceStubSettings) getStubSettings())
92+
.placeOrderOperationSettings();
93+
}
94+
95+
/** Returns the object with the settings used for calls to getOrder. */
96+
public UnaryCallSettings<GetOrderRequest, Order> getOrderSettings() {
97+
return ((ConsumerProcurementServiceStubSettings) getStubSettings()).getOrderSettings();
98+
}
99+
100+
/** Returns the object with the settings used for calls to listOrders. */
101+
public PagedCallSettings<ListOrdersRequest, ListOrdersResponse, ListOrdersPagedResponse>
102+
listOrdersSettings() {
103+
return ((ConsumerProcurementServiceStubSettings) getStubSettings()).listOrdersSettings();
104+
}
105+
106+
public static final ConsumerProcurementServiceSettings create(
107+
ConsumerProcurementServiceStubSettings stub) throws IOException {
108+
return new ConsumerProcurementServiceSettings.Builder(stub.toBuilder()).build();
109+
}
110+
111+
/** Returns a builder for the default ExecutorProvider for this service. */
112+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
113+
return ConsumerProcurementServiceStubSettings.defaultExecutorProviderBuilder();
114+
}
115+
116+
/** Returns the default service endpoint. */
117+
public static String getDefaultEndpoint() {
118+
return ConsumerProcurementServiceStubSettings.getDefaultEndpoint();
119+
}
120+
121+
/** Returns the default service scopes. */
122+
public static List<String> getDefaultServiceScopes() {
123+
return ConsumerProcurementServiceStubSettings.getDefaultServiceScopes();
124+
}
125+
126+
/** Returns a builder for the default credentials for this service. */
127+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
128+
return ConsumerProcurementServiceStubSettings.defaultCredentialsProviderBuilder();
129+
}
130+
131+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
132+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
133+
return ConsumerProcurementServiceStubSettings.defaultGrpcTransportProviderBuilder();
134+
}
135+
136+
/** Returns a builder for the default REST ChannelProvider for this service. */
137+
@BetaApi
138+
public static InstantiatingHttpJsonChannelProvider.Builder
139+
defaultHttpJsonTransportProviderBuilder() {
140+
return ConsumerProcurementServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
141+
}
142+
143+
public static TransportChannelProvider defaultTransportChannelProvider() {
144+
return ConsumerProcurementServiceStubSettings.defaultTransportChannelProvider();
145+
}
146+
147+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
148+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
149+
return ConsumerProcurementServiceStubSettings.defaultApiClientHeaderProviderBuilder();
150+
}
151+
152+
/** Returns a new gRPC builder for this class. */
153+
public static Builder newBuilder() {
154+
return Builder.createDefault();
155+
}
156+
157+
/** Returns a new REST builder for this class. */
158+
@BetaApi
159+
public static Builder newHttpJsonBuilder() {
160+
return Builder.createHttpJsonDefault();
161+
}
162+
163+
/** Returns a new builder for this class. */
164+
public static Builder newBuilder(ClientContext clientContext) {
165+
return new Builder(clientContext);
166+
}
167+
168+
/** Returns a builder containing all the values of this settings class. */
169+
public Builder toBuilder() {
170+
return new Builder(this);
171+
}
172+
173+
protected ConsumerProcurementServiceSettings(Builder settingsBuilder) throws IOException {
174+
super(settingsBuilder);
175+
}
176+
177+
/** Builder for ConsumerProcurementServiceSettings. */
178+
public static class Builder
179+
extends ClientSettings.Builder<ConsumerProcurementServiceSettings, Builder> {
180+
181+
protected Builder() throws IOException {
182+
this(((ClientContext) null));
183+
}
184+
185+
protected Builder(ClientContext clientContext) {
186+
super(ConsumerProcurementServiceStubSettings.newBuilder(clientContext));
187+
}
188+
189+
protected Builder(ConsumerProcurementServiceSettings settings) {
190+
super(settings.getStubSettings().toBuilder());
191+
}
192+
193+
protected Builder(ConsumerProcurementServiceStubSettings.Builder stubSettings) {
194+
super(stubSettings);
195+
}
196+
197+
private static Builder createDefault() {
198+
return new Builder(ConsumerProcurementServiceStubSettings.newBuilder());
199+
}
200+
201+
@BetaApi
202+
private static Builder createHttpJsonDefault() {
203+
return new Builder(ConsumerProcurementServiceStubSettings.newHttpJsonBuilder());
204+
}
205+
206+
public ConsumerProcurementServiceStubSettings.Builder getStubSettingsBuilder() {
207+
return ((ConsumerProcurementServiceStubSettings.Builder) getStubSettings());
208+
}
209+
210+
/**
211+
* Applies the given settings updater function to all of the unary API methods in this service.
212+
*
213+
* <p>Note: This method does not support applying settings to streaming methods.
214+
*/
215+
public Builder applyToAllUnaryMethods(
216+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
217+
super.applyToAllUnaryMethods(
218+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
219+
return this;
220+
}
221+
222+
/** Returns the builder for the settings used for calls to placeOrder. */
223+
public UnaryCallSettings.Builder<PlaceOrderRequest, Operation> placeOrderSettings() {
224+
return getStubSettingsBuilder().placeOrderSettings();
225+
}
226+
227+
/** Returns the builder for the settings used for calls to placeOrder. */
228+
public OperationCallSettings.Builder<PlaceOrderRequest, Order, PlaceOrderMetadata>
229+
placeOrderOperationSettings() {
230+
return getStubSettingsBuilder().placeOrderOperationSettings();
231+
}
232+
233+
/** Returns the builder for the settings used for calls to getOrder. */
234+
public UnaryCallSettings.Builder<GetOrderRequest, Order> getOrderSettings() {
235+
return getStubSettingsBuilder().getOrderSettings();
236+
}
237+
238+
/** Returns the builder for the settings used for calls to listOrders. */
239+
public PagedCallSettings.Builder<ListOrdersRequest, ListOrdersResponse, ListOrdersPagedResponse>
240+
listOrdersSettings() {
241+
return getStubSettingsBuilder().listOrdersSettings();
242+
}
243+
244+
@Override
245+
public ConsumerProcurementServiceSettings build() throws IOException {
246+
return new ConsumerProcurementServiceSettings(this);
247+
}
248+
}
249+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"schema": "1.0",
3+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
4+
"language": "java",
5+
"protoPackage": "google.cloud.commerce.consumer.procurement.v1",
6+
"libraryPackage": "com.google.cloud.commerce.consumer.procurement.v1",
7+
"services": {
8+
"ConsumerProcurementService": {
9+
"clients": {
10+
"grpc": {
11+
"libraryClient": "ConsumerProcurementServiceClient",
12+
"rpcs": {
13+
"GetOrder": {
14+
"methods": ["getOrder", "getOrder", "getOrderCallable"]
15+
},
16+
"ListOrders": {
17+
"methods": ["listOrders", "listOrders", "listOrdersPagedCallable", "listOrdersCallable"]
18+
},
19+
"PlaceOrder": {
20+
"methods": ["placeOrderAsync", "placeOrderOperationCallable", "placeOrderCallable"]
21+
}
22+
}
23+
}
24+
}
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2023 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+
/**
18+
* A client to Cloud Commerce Consumer Procurement API
19+
*
20+
* <p>The interfaces provided are listed below, along with usage samples.
21+
*
22+
* <p>======================= ConsumerProcurementServiceClient =======================
23+
*
24+
* <p>Service Description: ConsumerProcurementService allows customers to make purchases of products
25+
* served by the Cloud Commerce platform.
26+
*
27+
* <p>When purchases are made, the
28+
* [ConsumerProcurementService][google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService]
29+
* programs the appropriate backends, including both Google's own infrastructure, as well as
30+
* third-party systems, and to enable billing setup for charging for the procured item.
31+
*
32+
* <p>Sample for ConsumerProcurementServiceClient:
33+
*
34+
* <pre>{@code
35+
* // This snippet has been automatically generated and should be regarded as a code template only.
36+
* // It will require modifications to work:
37+
* // - It may require correct/in-range values for request initialization.
38+
* // - It may require specifying regional endpoints when creating the service client as shown in
39+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
40+
* try (ConsumerProcurementServiceClient consumerProcurementServiceClient =
41+
* ConsumerProcurementServiceClient.create()) {
42+
* String name = "name3373707";
43+
* Order response = consumerProcurementServiceClient.getOrder(name);
44+
* }
45+
* }</pre>
46+
*/
47+
@Generated("by gapic-generator-java")
48+
package com.google.cloud.commerce.consumer.procurement.v1;
49+
50+
import javax.annotation.Generated;

0 commit comments

Comments
 (0)