parent
e0745546d7
commit
f910a48aaa
5 changed files with 837 additions and 0 deletions
@ -0,0 +1,366 @@ |
||||
# This file was automatically generated by BuildFileGenerator |
||||
# https://github.com/googleapis/rules_gapic/tree/master/bazel |
||||
|
||||
# Most of the manual changes to this file will be overwritten. |
||||
# It's **only** allowed to change the following rule attribute values: |
||||
# - names of *_gapic_assembly_* rules |
||||
# - certain parameters of *_gapic_library rules, including but not limited to: |
||||
# * extra_protoc_parameters |
||||
# * extra_protoc_file_parameters |
||||
# The complete list of preserved parameters can be found in the source code. |
||||
|
||||
# This is an API workspace, having public visibility by default makes perfect sense. |
||||
package(default_visibility = ["//visibility:public"]) |
||||
|
||||
############################################################################## |
||||
# Common |
||||
############################################################################## |
||||
load("@rules_proto//proto:defs.bzl", "proto_library") |
||||
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") |
||||
|
||||
proto_library( |
||||
name = "procurement_proto", |
||||
srcs = [ |
||||
"order.proto", |
||||
"procurement_service.proto", |
||||
], |
||||
deps = [ |
||||
"//google/api:annotations_proto", |
||||
"//google/api:client_proto", |
||||
"//google/api:field_behavior_proto", |
||||
"//google/api:resource_proto", |
||||
"//google/longrunning:operations_proto", |
||||
"@com_google_protobuf//:timestamp_proto", |
||||
], |
||||
) |
||||
|
||||
proto_library_with_info( |
||||
name = "procurement_proto_with_info", |
||||
deps = [ |
||||
":procurement_proto", |
||||
"//google/cloud:common_resources_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# Java |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"java_gapic_assembly_gradle_pkg", |
||||
"java_gapic_library", |
||||
"java_gapic_test", |
||||
"java_grpc_library", |
||||
"java_proto_library", |
||||
) |
||||
|
||||
java_proto_library( |
||||
name = "procurement_java_proto", |
||||
deps = [":procurement_proto"], |
||||
) |
||||
|
||||
java_grpc_library( |
||||
name = "procurement_java_grpc", |
||||
srcs = [":procurement_proto"], |
||||
deps = [":procurement_java_proto"], |
||||
) |
||||
|
||||
java_gapic_library( |
||||
name = "procurement_java_gapic", |
||||
srcs = [":procurement_proto_with_info"], |
||||
gapic_yaml = None, |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
test_deps = [ |
||||
":procurement_java_grpc", |
||||
], |
||||
transport = "grpc+rest", |
||||
deps = [ |
||||
":procurement_java_proto", |
||||
"//google/api:api_java_proto", |
||||
], |
||||
) |
||||
|
||||
java_gapic_test( |
||||
name = "procurement_java_gapic_test_suite", |
||||
test_classes = [ |
||||
"com.google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementServiceClientHttpJsonTest", |
||||
"com.google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementServiceClientTest", |
||||
], |
||||
runtime_deps = [":procurement_java_gapic_test"], |
||||
) |
||||
|
||||
# Open Source Packages |
||||
java_gapic_assembly_gradle_pkg( |
||||
name = "google-cloud-consumer-procurement-v1alpha1-java", |
||||
transport = "grpc+rest", |
||||
deps = [ |
||||
":procurement_java_gapic", |
||||
":procurement_java_grpc", |
||||
":procurement_java_proto", |
||||
":procurement_proto", |
||||
], |
||||
include_samples = True, |
||||
) |
||||
|
||||
############################################################################## |
||||
# Go |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"go_gapic_assembly_pkg", |
||||
"go_gapic_library", |
||||
"go_proto_library", |
||||
"go_test", |
||||
) |
||||
|
||||
go_proto_library( |
||||
name = "procurement_go_proto", |
||||
compilers = ["@io_bazel_rules_go//proto:go_grpc"], |
||||
importpath = "google.golang.org/genproto/googleapis/cloud/commerce/consumer/procurement/v1alpha1", |
||||
protos = [":procurement_proto"], |
||||
deps = [ |
||||
"//google/api:annotations_go_proto", |
||||
"//google/longrunning:longrunning_go_proto", |
||||
], |
||||
) |
||||
|
||||
go_gapic_library( |
||||
name = "procurement_go_gapic", |
||||
srcs = [":procurement_proto_with_info"], |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
importpath = "cloud.google.com/go/commerce/consumer/procurement/apiv1alpha1;procurement", |
||||
metadata = True, |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
transport = "grpc+rest", |
||||
deps = [ |
||||
":procurement_go_proto", |
||||
"//google/longrunning:longrunning_go_proto", |
||||
"@com_google_cloud_go//longrunning/autogen:go_default_library", |
||||
"@com_google_cloud_go//longrunning:go_default_library", |
||||
], |
||||
) |
||||
|
||||
go_test( |
||||
name = "procurement_go_gapic_test", |
||||
srcs = [":procurement_go_gapic_srcjar_test"], |
||||
embed = [":procurement_go_gapic"], |
||||
importpath = "cloud.google.com/go/commerce/consumer/procurement/apiv1alpha1", |
||||
) |
||||
|
||||
# Open Source Packages |
||||
go_gapic_assembly_pkg( |
||||
name = "gapi-cloud-consumer-procurement-v1alpha1-go", |
||||
deps = [ |
||||
":procurement_go_gapic", |
||||
":procurement_go_gapic_srcjar-test.srcjar", |
||||
":procurement_go_gapic_srcjar-metadata.srcjar", |
||||
":procurement_go_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# Python |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"py_gapic_assembly_pkg", |
||||
"py_gapic_library", |
||||
) |
||||
|
||||
py_gapic_library( |
||||
name = "procurement_py_gapic", |
||||
srcs = [":procurement_proto"], |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
) |
||||
|
||||
# Open Source Packages |
||||
py_gapic_assembly_pkg( |
||||
name = "consumer-procurement-v1alpha1-py", |
||||
deps = [ |
||||
":procurement_py_gapic", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# PHP |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"php_gapic_assembly_pkg", |
||||
"php_gapic_library", |
||||
"php_grpc_library", |
||||
"php_proto_library", |
||||
) |
||||
|
||||
php_proto_library( |
||||
name = "procurement_php_proto", |
||||
deps = [":procurement_proto"], |
||||
) |
||||
|
||||
php_grpc_library( |
||||
name = "procurement_php_grpc", |
||||
srcs = [":procurement_proto"], |
||||
deps = [":procurement_php_proto"], |
||||
) |
||||
|
||||
php_gapic_library( |
||||
name = "procurement_php_gapic", |
||||
srcs = [":procurement_proto_with_info"], |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
deps = [ |
||||
":procurement_php_grpc", |
||||
":procurement_php_proto", |
||||
], |
||||
) |
||||
|
||||
# Open Source Packages |
||||
php_gapic_assembly_pkg( |
||||
name = "google-cloud-consumer-procurement-v1alpha1-php", |
||||
deps = [ |
||||
":procurement_php_gapic", |
||||
":procurement_php_grpc", |
||||
":procurement_php_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# Node.js |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"nodejs_gapic_assembly_pkg", |
||||
"nodejs_gapic_library", |
||||
) |
||||
|
||||
nodejs_gapic_library( |
||||
name = "procurement_nodejs_gapic", |
||||
package_name = "@google-cloud/procurement", |
||||
src = ":procurement_proto_with_info", |
||||
extra_protoc_parameters = ["metadata"], |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
package = "google.cloud.commerce.consumer.procurement.v1alpha1", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
deps = [], |
||||
) |
||||
|
||||
nodejs_gapic_assembly_pkg( |
||||
name = "consumer-procurement-v1alpha1-nodejs", |
||||
deps = [ |
||||
":procurement_nodejs_gapic", |
||||
":procurement_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# Ruby |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"ruby_gapic_assembly_pkg", |
||||
"ruby_cloud_gapic_library", |
||||
"ruby_grpc_library", |
||||
"ruby_proto_library", |
||||
) |
||||
|
||||
ruby_proto_library( |
||||
name = "procurement_ruby_proto", |
||||
deps = [":procurement_proto"], |
||||
) |
||||
|
||||
ruby_grpc_library( |
||||
name = "procurement_ruby_grpc", |
||||
srcs = [":procurement_proto"], |
||||
deps = [":procurement_ruby_proto"], |
||||
) |
||||
|
||||
ruby_cloud_gapic_library( |
||||
name = "procurement_ruby_gapic", |
||||
srcs = [":procurement_proto_with_info"], |
||||
extra_protoc_parameters = [ |
||||
"ruby-cloud-gem-name=google-cloud-consumer-procurement-v1alpha1", |
||||
], |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
deps = [ |
||||
":procurement_ruby_grpc", |
||||
":procurement_ruby_proto", |
||||
], |
||||
) |
||||
|
||||
# Open Source Packages |
||||
ruby_gapic_assembly_pkg( |
||||
name = "google-cloud-consumer-procurement-v1alpha1-ruby", |
||||
deps = [ |
||||
":procurement_ruby_gapic", |
||||
":procurement_ruby_grpc", |
||||
":procurement_ruby_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# C# |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"csharp_gapic_assembly_pkg", |
||||
"csharp_gapic_library", |
||||
"csharp_grpc_library", |
||||
"csharp_proto_library", |
||||
) |
||||
|
||||
csharp_proto_library( |
||||
name = "procurement_csharp_proto", |
||||
deps = [":procurement_proto"], |
||||
) |
||||
|
||||
csharp_grpc_library( |
||||
name = "procurement_csharp_grpc", |
||||
srcs = [":procurement_proto"], |
||||
deps = [":procurement_csharp_proto"], |
||||
) |
||||
|
||||
csharp_gapic_library( |
||||
name = "procurement_csharp_gapic", |
||||
srcs = [":procurement_proto_with_info"], |
||||
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json", |
||||
grpc_service_config = "commerceconsumerprocurement_grpc_service_config.json", |
||||
service_yaml = "cloudcommerceconsumerprocurement_v1alpha1.yaml", |
||||
deps = [ |
||||
":procurement_csharp_grpc", |
||||
":procurement_csharp_proto", |
||||
], |
||||
) |
||||
|
||||
# Open Source Packages |
||||
csharp_gapic_assembly_pkg( |
||||
name = "google-cloud-consumer-procurement-v1alpha1-csharp", |
||||
deps = [ |
||||
":procurement_csharp_gapic", |
||||
":procurement_csharp_grpc", |
||||
":procurement_csharp_proto", |
||||
], |
||||
) |
||||
|
||||
############################################################################## |
||||
# C++ |
||||
############################################################################## |
||||
load( |
||||
"@com_google_googleapis_imports//:imports.bzl", |
||||
"cc_grpc_library", |
||||
"cc_proto_library", |
||||
) |
||||
|
||||
cc_proto_library( |
||||
name = "procurement_cc_proto", |
||||
deps = [":procurement_proto"], |
||||
) |
||||
|
||||
cc_grpc_library( |
||||
name = "procurement_cc_grpc", |
||||
srcs = [":procurement_proto"], |
||||
grpc_only = True, |
||||
deps = [":procurement_cc_proto"], |
||||
) |
@ -0,0 +1,30 @@ |
||||
type: google.api.Service |
||||
config_version: 3 |
||||
name: cloudcommerceconsumerprocurement.googleapis.com |
||||
title: Cloud Commerce Consumer Procurement API |
||||
|
||||
apis: |
||||
- name: google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService |
||||
- name: google.longrunning.Operations |
||||
|
||||
types: |
||||
- name: google.cloud.commerce.consumer.procurement.v1alpha1.PlaceOrderMetadata |
||||
|
||||
documentation: |
||||
summary: Enables consumers to procure products served by Cloud Marketplace platform |
||||
|
||||
http: |
||||
rules: |
||||
- selector: google.longrunning.Operations.GetOperation |
||||
get: '/v1alpha1/{name=billingAccounts/*/orders/*/operations/*}' |
||||
|
||||
authentication: |
||||
rules: |
||||
- selector: 'google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.*' |
||||
oauth: |
||||
canonical_scopes: |- |
||||
https://www.googleapis.com/auth/cloud-platform |
||||
- selector: google.longrunning.Operations.GetOperation |
||||
oauth: |
||||
canonical_scopes: |- |
||||
https://www.googleapis.com/auth/cloud-platform |
@ -0,0 +1,33 @@ |
||||
{ |
||||
"methodConfig": [ |
||||
{ |
||||
"name": [ |
||||
{ |
||||
"service": "google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService", |
||||
"method": "GetOrder" |
||||
}, |
||||
{ |
||||
"service": "google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService", |
||||
"method": "ListOrders" |
||||
} |
||||
], |
||||
"timeout": "60s", |
||||
"retryPolicy": { |
||||
"maxAttempts": 5, |
||||
"initialBackoff": "1s", |
||||
"maxBackoff": "60s", |
||||
"backoffMultiplier": 1.3, |
||||
"retryableStatusCodes": ["UNAVAILABLE"] |
||||
} |
||||
}, |
||||
{ |
||||
"name": [ |
||||
{ |
||||
"service": "google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService", |
||||
"method": "PlaceOrder" |
||||
} |
||||
], |
||||
"timeout": "60s" |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,254 @@ |
||||
// 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 |
||||
// |
||||
// http://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. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.cloud.commerce.consumer.procurement.v1alpha1; |
||||
|
||||
import "google/api/field_behavior.proto"; |
||||
import "google/api/resource.proto"; |
||||
import "google/protobuf/timestamp.proto"; |
||||
|
||||
option go_package = "google.golang.org/genproto/googleapis/cloud/commerce/consumer/procurement/v1alpha1;procurement"; |
||||
option java_multiple_files = true; |
||||
option java_package = "com.google.cloud.commerce.consumer.procurement.v1alpha1"; |
||||
option (google.api.resource_definition) = { |
||||
type: "commerceoffercatalog.googleapis.com/Offer" |
||||
pattern: "services/{service}/standardOffers/{offer}" |
||||
pattern: "billingAccounts/{consumer_billing_account}/offers/{offer}" |
||||
}; |
||||
|
||||
// Represents a purchase made by a customer on Cloud Marketplace. |
||||
// Creating an order makes sure that both the Google backend systems |
||||
// as well as external service provider's systems (if needed) allow use of |
||||
// purchased products and ensures the appropriate billing events occur. |
||||
// |
||||
// An Order can be made against one Product with multiple add-ons (optional) or |
||||
// one Quote which might reference multiple products. |
||||
// |
||||
// Customers typically choose a price plan for each Product purchased when |
||||
// they create an order and can change their plan later, if the product allows. |
||||
message Order { |
||||
option (google.api.resource) = { |
||||
type: "cloudcommerceconsumerprocurement.googleapis.com/Order" |
||||
pattern: "billingAccounts/{billing_account}/orders/{order}" |
||||
}; |
||||
|
||||
// Output only. The resource name of the order. |
||||
// Has the form |
||||
// `billingAccounts/{billing_account}/orders/{order}`. |
||||
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Required. The user-specified name of the order. |
||||
// Must be unique within a billing account. |
||||
string display_name = 10 [(google.api.field_behavior) = REQUIRED]; |
||||
|
||||
// Output only. The items being purchased. |
||||
repeated LineItem line_items = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. Line items that were cancelled. |
||||
repeated LineItem cancelled_line_items = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. The creation timestamp. |
||||
google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. The last update timestamp. |
||||
google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// The weak etag of the order. |
||||
string etag = 11; |
||||
} |
||||
|
||||
// A single item within an order. |
||||
message LineItem { |
||||
// Output only. Line item ID. |
||||
string line_item_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. Current state and information of this item. It tells what, |
||||
// e.g. which offer, is currently effective. |
||||
LineItemInfo line_item_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. A change made on the item which is pending and not yet |
||||
// effective. Absence of this field indicates the line item is not undergoing |
||||
// a change. |
||||
LineItemChange pending_change = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. Changes made on the item that are not pending anymore which might be |
||||
// because they already took effect, were reverted by the customer, or were |
||||
// rejected by the partner. No more operations are allowed on these changes. |
||||
repeated LineItemChange change_history = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
} |
||||
|
||||
// A change made on a line item. |
||||
message LineItemChange { |
||||
// Output only. Change ID. |
||||
// All changes made within one order update operation have the same change_id. |
||||
string change_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Required. Type of the change to make. |
||||
LineItemChangeType change_type = 2 [(google.api.field_behavior) = REQUIRED]; |
||||
|
||||
// Output only. Line item info before the change. |
||||
LineItemInfo old_line_item_info = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Line item info after the change. |
||||
LineItemInfo new_line_item_info = 4; |
||||
|
||||
// Output only. State of the change. |
||||
LineItemChangeState change_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. Provider-supplied message explaining the LineItemChange's |
||||
// state. Mainly used to communicate progress and ETA for provisioning in the |
||||
// case of `PENDING_APPROVAL`, and to explain why the change request was |
||||
// denied or canceled in the case of `REJECTED` and `CANCELED` states. |
||||
string state_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. Predefined enum types for why this line item change is in current state. |
||||
// For example, a line item change's state could be |
||||
// `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration, |
||||
// immediate cancellation initiated by the user, or system-initiated |
||||
// cancellation. |
||||
LineItemChangeStateReasonType change_state_reason_type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. A time at which the change became or will become (in case of |
||||
// pending change) effective. |
||||
google.protobuf.Timestamp change_effective_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. The time when change was initiated. |
||||
google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
|
||||
// Output only. The time when change was updated, e.g. approved/rejected by |
||||
// partners or cancelled by the user. |
||||
google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
} |
||||
|
||||
// Line item information. |
||||
message LineItemInfo { |
||||
// Optional. The name of the offer can have either of these formats: |
||||
// 'billingAccounts/{billing_account}/offers/{offer}', |
||||
// or 'services/{service}/standardOffers/{offer}'. |
||||
string offer = 13 [ |
||||
(google.api.field_behavior) = OPTIONAL, |
||||
(google.api.resource_reference) = { |
||||
type: "commerceoffercatalog.googleapis.com/Offer" |
||||
} |
||||
]; |
||||
|
||||
// Optional. User-provided parameters. |
||||
repeated Parameter parameters = 9 [(google.api.field_behavior) = OPTIONAL]; |
||||
|
||||
// Output only. Information about the subscription created, if applicable. |
||||
Subscription subscription = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; |
||||
} |
||||
|
||||
// User-provided Parameters. |
||||
message Parameter { |
||||
message Value { |
||||
// The kind of value. |
||||
oneof kind { |
||||
// Represents an int64 value. |
||||
int64 int64_value = 3; |
||||
|
||||
// Represents a string value. |
||||
string string_value = 4; |
||||
|
||||
// Represents a double value. |
||||
double double_value = 5; |
||||
} |
||||
} |
||||
|
||||
// Name of the parameter. |
||||
string name = 1; |
||||
|
||||
// Value of parameter. |
||||
Value value = 2; |
||||
} |
||||
|
||||
// Type of a line item change. |
||||
enum LineItemChangeType { |
||||
// Sentinel value. Do not use. |
||||
LINE_ITEM_CHANGE_TYPE_UNSPECIFIED = 0; |
||||
|
||||
// The change is to create a new line item. |
||||
LINE_ITEM_CHANGE_TYPE_CREATE = 1; |
||||
|
||||
// The change is to update an existing line item. |
||||
LINE_ITEM_CHANGE_TYPE_UPDATE = 2; |
||||
|
||||
// The change is to cancel an existing line item. |
||||
LINE_ITEM_CHANGE_TYPE_CANCEL = 3; |
||||
|
||||
// The change is to revert a cancellation. |
||||
LINE_ITEM_CHANGE_TYPE_REVERT_CANCELLATION = 4; |
||||
} |
||||
|
||||
// State of a change. |
||||
enum LineItemChangeState { |
||||
// Sentinel value. Do not use. |
||||
LINE_ITEM_CHANGE_STATE_UNSPECIFIED = 0; |
||||
|
||||
// Change is in this state when a change is initiated and waiting for |
||||
// partner approval. |
||||
LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL = 1; |
||||
|
||||
// Change is in this state after it's approved by the partner or auto-approved |
||||
// but before it takes effect. The change can be overwritten |
||||
// or cancelled depending on the new line item info property (pending Private |
||||
// Offer change cannot be cancelled and can only be overwritten by another |
||||
// Private Offer). |
||||
LINE_ITEM_CHANGE_STATE_APPROVED = 2; |
||||
|
||||
// Change is in this state after it's been activated. |
||||
LINE_ITEM_CHANGE_STATE_COMPLETED = 3; |
||||
|
||||
// Change is in this state if it was rejected by the partner. |
||||
LINE_ITEM_CHANGE_STATE_REJECTED = 4; |
||||
|
||||
// Change is in this state if it was abandoned by the user. |
||||
LINE_ITEM_CHANGE_STATE_ABANDONED = 5; |
||||
|
||||
// Change is in this state if it's currently being provisioned downstream. The |
||||
// change can't be overwritten or cancelled when it's in this state. |
||||
LINE_ITEM_CHANGE_STATE_ACTIVATING = 6; |
||||
} |
||||
|
||||
// Predefined types for line item change state reason. |
||||
enum LineItemChangeStateReasonType { |
||||
// Default value, indicating there's no predefined type for change state |
||||
// reason. |
||||
LINE_ITEM_CHANGE_STATE_REASON_TYPE_UNSPECIFIED = 0; |
||||
|
||||
// Change is in current state due to term expiration. |
||||
LINE_ITEM_CHANGE_STATE_REASON_TYPE_EXPIRED = 1; |
||||
|
||||
// Change is in current state due to user-initiated cancellation. |
||||
LINE_ITEM_CHANGE_STATE_REASON_TYPE_USER_CANCELLED = 2; |
||||
|
||||
// Change is in current state due to system-initiated cancellation. |
||||
LINE_ITEM_CHANGE_STATE_REASON_TYPE_SYSTEM_CANCELLED = 3; |
||||
} |
||||
|
||||
// Subscription information. |
||||
message Subscription { |
||||
// The timestamp when the subscription begins, if applicable. |
||||
google.protobuf.Timestamp start_time = 3; |
||||
|
||||
// The timestamp when the subscription ends, if applicable. |
||||
google.protobuf.Timestamp end_time = 1; |
||||
|
||||
// Whether auto renewal is enabled by user choice on current subscription. |
||||
// This field indicates order/subscription status after pending plan change is |
||||
// cancelled or rejected. |
||||
bool auto_renewal_enabled = 2; |
||||
} |
@ -0,0 +1,154 @@ |
||||
// 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 |
||||
// |
||||
// http://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. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package google.cloud.commerce.consumer.procurement.v1alpha1; |
||||
|
||||
import "google/api/annotations.proto"; |
||||
import "google/api/client.proto"; |
||||
import "google/api/field_behavior.proto"; |
||||
import "google/api/resource.proto"; |
||||
import "google/cloud/commerce/consumer/procurement/v1alpha1/order.proto"; |
||||
import "google/longrunning/operations.proto"; |
||||
|
||||
option go_package = "google.golang.org/genproto/googleapis/cloud/commerce/consumer/procurement/v1alpha1;procurement"; |
||||
option java_multiple_files = true; |
||||
option java_package = "com.google.cloud.commerce.consumer.procurement.v1alpha1"; |
||||
|
||||
// ConsumerProcurementService allows customers to make purchases of products |
||||
// served by the Cloud Commerce platform. |
||||
// |
||||
// |
||||
// When purchases are made, the |
||||
// [ConsumerProcurementService][google.cloud.commerce.consumer.procurement.v1alpha1.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. |
||||
// |
||||
service ConsumerProcurementService { |
||||
option (google.api.default_host) = "cloudcommerceconsumerprocurement.googleapis.com"; |
||||
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; |
||||
|
||||
// Creates a new [Order][google.cloud.commerce.consumer.procurement.v1alpha1.Order]. |
||||
// |
||||
// 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.v1alpha1.OrderState.ORDER_STATE_ACTIVE]. In case of failure, the |
||||
// order resource will be removed. |
||||
rpc PlaceOrder(PlaceOrderRequest) returns (google.longrunning.Operation) { |
||||
option (google.api.http) = { |
||||
post: "/v1alpha1/{parent=billingAccounts/*}/orders:place" |
||||
body: "*" |
||||
}; |
||||
option (google.longrunning.operation_info) = { |
||||
response_type: "Order" |
||||
metadata_type: "PlaceOrderMetadata" |
||||
}; |
||||
} |
||||
|
||||
// Returns the requested [Order][google.cloud.commerce.consumer.procurement.v1alpha1.Order] resource. |
||||
rpc GetOrder(GetOrderRequest) returns (Order) { |
||||
option (google.api.http) = { |
||||
get: "/v1alpha1/{name=billingAccounts/*/orders/*}" |
||||
}; |
||||
} |
||||
|
||||
// Lists [Order][google.cloud.commerce.consumer.procurement.v1alpha1.Order] resources that the user has access to, within the |
||||
// scope of the parent resource. |
||||
rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse) { |
||||
option (google.api.http) = { |
||||
get: "/v1alpha1/{parent=billingAccounts/*}/orders" |
||||
}; |
||||
} |
||||
} |
||||
|
||||
// Request message for [ConsumerProcurementService.PlaceOrder][google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.PlaceOrder]. |
||||
message PlaceOrderRequest { |
||||
// Required. The resource name of the parent resource. |
||||
// This field has the form `billingAccounts/{billing-account-id}`. |
||||
string parent = 1 [ |
||||
(google.api.field_behavior) = REQUIRED, |
||||
(google.api.resource_reference) = { |
||||
type: "cloudbilling.googleapis.com/BillingAccount" |
||||
} |
||||
]; |
||||
|
||||
// Required. The user-specified name of the order being placed. |
||||
// Must be unique within a billing account. |
||||
string display_name = 6 [(google.api.field_behavior) = REQUIRED]; |
||||
|
||||
// Optional. Places order for offer. Required when an offer-based order is being placed. |
||||
repeated LineItemInfo line_item_info = 10 [(google.api.field_behavior) = OPTIONAL]; |
||||
|
||||
// Optional. A unique identifier for this request. |
||||
// The server will ignore subsequent requests that provide a duplicate request |
||||
// ID for at least 120 minutes after the first request. |
||||
// |
||||
// The request ID must be a valid |
||||
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). |
||||
string request_id = 7 [(google.api.field_behavior) = OPTIONAL]; |
||||
} |
||||
|
||||
// Message stored in the metadata field of the Operation returned by |
||||
// [ConsumerProcurementService.PlaceOrder][google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.PlaceOrder]. |
||||
message PlaceOrderMetadata { |
||||
|
||||
} |
||||
|
||||
// Request message for [ConsumerProcurementService.GetOrder][google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.GetOrder] |
||||
message GetOrderRequest { |
||||
// Required. The name of the order to retrieve. |
||||
string name = 1 [(google.api.field_behavior) = REQUIRED]; |
||||
} |
||||
|
||||
// Request message for [ConsumerProcurementService.ListOrders][google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.ListOrders]. |
||||
message ListOrdersRequest { |
||||
// Required. The parent resource to query for orders. |
||||
// This field has the form `billingAccounts/{billing-account-id}`. |
||||
string parent = 1 [(google.api.field_behavior) = REQUIRED]; |
||||
|
||||
// The maximum number of entries requested. |
||||
// The default page size is 25 and the maximum page size is 200. |
||||
int32 page_size = 2; |
||||
|
||||
// The token for fetching the next page. |
||||
string page_token = 3; |
||||
|
||||
// Filter that you can use to limit the list request. |
||||
// |
||||
// A query string that can match a selected set of attributes |
||||
// with string values. For example, `display_name=abc`. |
||||
// Supported query attributes are |
||||
// |
||||
// * `display_name` |
||||
// |
||||
// If the query contains special characters other than letters, |
||||
// underscore, or digits, the phrase must be quoted with double quotes. For |
||||
// example, `display_name="foo:bar"`, where the display name needs to be |
||||
// quoted because it contains special character colon. |
||||
// |
||||
// Queries can be combined with `OR`, and `NOT` to form more complex queries. |
||||
// You can also group them to force a desired evaluation order. |
||||
// For example, `display_name=abc OR display_name=def`. |
||||
string filter = 4; |
||||
} |
||||
|
||||
// Response message for [ConsumerProcurementService.ListOrders][google.cloud.commerce.consumer.procurement.v1alpha1.ConsumerProcurementService.ListOrders]. |
||||
message ListOrdersResponse { |
||||
// The list of orders in this response. |
||||
repeated Order orders = 1; |
||||
|
||||
// The token for fetching the next page. |
||||
string next_page_token = 2; |
||||
} |
Loading…
Reference in new issue