ConsumerProcurementService allows customers to make purchases of products served by the Cloud Commerce platform.
When purchases are made, the ConsumerProcurementService programs the appropriate backends, including both Google's own infrastructure, as well as third-party systems, and to enable billing setup for charging for the procured item.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
ConsumerProcurementServiceClient(ConsumerProcurementServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ConsumerProcurementServiceClient const &
|
ConsumerProcurementServiceClient(ConsumerProcurementServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ConsumerProcurementServiceClient &&
|
ConsumerProcurementServiceClient(std::shared_ptr< ConsumerProcurementServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ConsumerProcurementServiceConnection >
|
opts |
Options
|
Operators
operator=(ConsumerProcurementServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ConsumerProcurementServiceClient const &
|
Returns | |
---|---|
Type | Description |
ConsumerProcurementServiceClient & |
operator=(ConsumerProcurementServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ConsumerProcurementServiceClient &&
|
Returns | |
---|---|
Type | Description |
ConsumerProcurementServiceClient & |
Functions
PlaceOrder(google::cloud::commerce::consumer::procurement::v1::PlaceOrderRequest const &, Options)
Creates a new Order.
This API only supports GCP spend-based committed use discounts specified by GCP documentation.
The returned long-running operation is in-progress until the backend completes the creation of the resource. Once completed, the order is in [OrderState.ORDER_STATE_ACTIVE][google.cloud.commerce.consumer.procurement.v1.OrderState.ORDER_STATE_ACTIVE]. In case of failure, the order resource will be removed.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::commerce::consumer::procurement::v1::PlaceOrderRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
A |
PlaceOrder(NoAwaitTag, google::cloud::commerce::consumer::procurement::v1::PlaceOrderRequest const &, Options)
Creates a new Order.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::commerce::consumer::procurement::v1::PlaceOrderRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
PlaceOrder(google::longrunning::Operation const &, Options)
Creates a new Order.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
GetOrder(std::string const &, Options)
Returns the requested Order resource.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the order to retrieve. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > |
the result of the RPC. The response message type (google.cloud.commerce.consumer.procurement.v1.Order) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOrder(google::cloud::commerce::consumer::procurement::v1::GetOrderRequest const &, Options)
Returns the requested Order resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::commerce::consumer::procurement::v1::GetOrderRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > |
the result of the RPC. The response message type (google.cloud.commerce.consumer.procurement.v1.Order) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListOrders(std::string const &, Options)
Lists Order resources that the user has access to, within the scope of the parent resource.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent resource to query for orders. This field has the form |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::commerce::consumer::procurement::v1::Order > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListOrders(google::cloud::commerce::consumer::procurement::v1::ListOrdersRequest, Options)
Lists Order resources that the user has access to, within the scope of the parent resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::commerce::consumer::procurement::v1::ListOrdersRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::commerce::consumer::procurement::v1::Order > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ModifyOrder(google::cloud::commerce::consumer::procurement::v1::ModifyOrderRequest const &, Options)
Modifies an existing Order resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::commerce::consumer::procurement::v1::ModifyOrderRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
A |
ModifyOrder(NoAwaitTag, google::cloud::commerce::consumer::procurement::v1::ModifyOrderRequest const &, Options)
Modifies an existing Order resource.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::commerce::consumer::procurement::v1::ModifyOrderRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
ModifyOrder(google::longrunning::Operation const &, Options)
Modifies an existing Order resource.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
CancelOrder(google::cloud::commerce::consumer::procurement::v1::CancelOrderRequest const &, Options)
Cancels an existing Order.
Every product procured in the Order will be cancelled.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::commerce::consumer::procurement::v1::CancelOrderRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
A |
CancelOrder(NoAwaitTag, google::cloud::commerce::consumer::procurement::v1::CancelOrderRequest const &, Options)
Cancels an existing Order.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::commerce::consumer::procurement::v1::CancelOrderRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
CancelOrder(google::longrunning::Operation const &, Options)
Cancels an existing Order.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::commerce::consumer::procurement::v1::Order > > |
GetOperation(std::string const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOperation(google::longrunning::GetOperationRequest const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::GetOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |