google-cloud-commerce-consumer-procurement-v1 0.a → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/client.rb +680 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/credentials.rb +51 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/operations.rb +783 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths.rb +90 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/client.rb +630 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/operations.rb +874 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/service_stub.rb +230 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest.rb +65 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service.rb +68 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/order_pb.rb +60 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/procurement_service_pb.rb +58 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/procurement_service_services_pb.rb +74 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/rest.rb +41 -0
- data/lib/google/cloud/commerce/consumer/procurement/v1/version.rb +7 -2
- data/lib/google/cloud/commerce/consumer/procurement/v1.rb +49 -0
- data/lib/google-cloud-commerce-consumer-procurement-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/commerce/consumer/procurement/v1/order.rb +262 -0
- data/proto_docs/google/cloud/commerce/consumer/procurement/v1/procurement_service.rb +122 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +188 -13
@@ -0,0 +1,230 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/commerce/consumer/procurement/v1/procurement_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Commerce
|
24
|
+
module Consumer
|
25
|
+
module Procurement
|
26
|
+
module V1
|
27
|
+
module ConsumerProcurementService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST service stub for the ConsumerProcurementService service.
|
31
|
+
# Service stub contains baseline method implementations
|
32
|
+
# including transcoding, making the REST call, and deserialing the response.
|
33
|
+
#
|
34
|
+
class ServiceStub
|
35
|
+
def initialize endpoint:, credentials:
|
36
|
+
# These require statements are intentionally placed here to initialize
|
37
|
+
# the REST modules only when it's required.
|
38
|
+
require "gapic/rest"
|
39
|
+
|
40
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
41
|
+
numeric_enums: true,
|
42
|
+
raise_faraday_errors: false
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# Baseline implementation for the place_order REST call
|
47
|
+
#
|
48
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::PlaceOrderRequest]
|
49
|
+
# A request object representing the call parameters. Required.
|
50
|
+
# @param options [::Gapic::CallOptions]
|
51
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
52
|
+
#
|
53
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
54
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
55
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
56
|
+
#
|
57
|
+
# @return [::Google::Longrunning::Operation]
|
58
|
+
# A result object deserialized from the server's reply
|
59
|
+
def place_order request_pb, options = nil
|
60
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
61
|
+
|
62
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_place_order_request request_pb
|
63
|
+
query_string_params = if query_string_params.any?
|
64
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
65
|
+
else
|
66
|
+
{}
|
67
|
+
end
|
68
|
+
|
69
|
+
response = @client_stub.make_http_request(
|
70
|
+
verb,
|
71
|
+
uri: uri,
|
72
|
+
body: body || "",
|
73
|
+
params: query_string_params,
|
74
|
+
options: options
|
75
|
+
)
|
76
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
77
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
78
|
+
|
79
|
+
yield result, operation if block_given?
|
80
|
+
result
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Baseline implementation for the get_order REST call
|
85
|
+
#
|
86
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::GetOrderRequest]
|
87
|
+
# A request object representing the call parameters. Required.
|
88
|
+
# @param options [::Gapic::CallOptions]
|
89
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
90
|
+
#
|
91
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
92
|
+
# @yieldparam result [::Google::Cloud::Commerce::Consumer::Procurement::V1::Order]
|
93
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
94
|
+
#
|
95
|
+
# @return [::Google::Cloud::Commerce::Consumer::Procurement::V1::Order]
|
96
|
+
# A result object deserialized from the server's reply
|
97
|
+
def get_order request_pb, options = nil
|
98
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
99
|
+
|
100
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_order_request request_pb
|
101
|
+
query_string_params = if query_string_params.any?
|
102
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
103
|
+
else
|
104
|
+
{}
|
105
|
+
end
|
106
|
+
|
107
|
+
response = @client_stub.make_http_request(
|
108
|
+
verb,
|
109
|
+
uri: uri,
|
110
|
+
body: body || "",
|
111
|
+
params: query_string_params,
|
112
|
+
options: options
|
113
|
+
)
|
114
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
115
|
+
result = ::Google::Cloud::Commerce::Consumer::Procurement::V1::Order.decode_json response.body, ignore_unknown_fields: true
|
116
|
+
|
117
|
+
yield result, operation if block_given?
|
118
|
+
result
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Baseline implementation for the list_orders REST call
|
123
|
+
#
|
124
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersRequest]
|
125
|
+
# A request object representing the call parameters. Required.
|
126
|
+
# @param options [::Gapic::CallOptions]
|
127
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
128
|
+
#
|
129
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
130
|
+
# @yieldparam result [::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersResponse]
|
131
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
132
|
+
#
|
133
|
+
# @return [::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersResponse]
|
134
|
+
# A result object deserialized from the server's reply
|
135
|
+
def list_orders request_pb, options = nil
|
136
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
137
|
+
|
138
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_orders_request request_pb
|
139
|
+
query_string_params = if query_string_params.any?
|
140
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
141
|
+
else
|
142
|
+
{}
|
143
|
+
end
|
144
|
+
|
145
|
+
response = @client_stub.make_http_request(
|
146
|
+
verb,
|
147
|
+
uri: uri,
|
148
|
+
body: body || "",
|
149
|
+
params: query_string_params,
|
150
|
+
options: options
|
151
|
+
)
|
152
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
153
|
+
result = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersResponse.decode_json response.body, ignore_unknown_fields: true
|
154
|
+
|
155
|
+
yield result, operation if block_given?
|
156
|
+
result
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# @private
|
161
|
+
#
|
162
|
+
# GRPC transcoding helper method for the place_order REST call
|
163
|
+
#
|
164
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::PlaceOrderRequest]
|
165
|
+
# A request object representing the call parameters. Required.
|
166
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
167
|
+
# Uri, Body, Query string parameters
|
168
|
+
def self.transcode_place_order_request request_pb
|
169
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
170
|
+
.with_bindings(
|
171
|
+
uri_method: :post,
|
172
|
+
uri_template: "/v1/{parent}/orders:place",
|
173
|
+
body: "*",
|
174
|
+
matches: [
|
175
|
+
["parent", %r{^billingAccounts/[^/]+/?$}, false]
|
176
|
+
]
|
177
|
+
)
|
178
|
+
transcoder.transcode request_pb
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# @private
|
183
|
+
#
|
184
|
+
# GRPC transcoding helper method for the get_order REST call
|
185
|
+
#
|
186
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::GetOrderRequest]
|
187
|
+
# A request object representing the call parameters. Required.
|
188
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
189
|
+
# Uri, Body, Query string parameters
|
190
|
+
def self.transcode_get_order_request request_pb
|
191
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
192
|
+
.with_bindings(
|
193
|
+
uri_method: :get,
|
194
|
+
uri_template: "/v1/{name}",
|
195
|
+
matches: [
|
196
|
+
["name", %r{^billingAccounts/[^/]+/orders/[^/]+/?$}, false]
|
197
|
+
]
|
198
|
+
)
|
199
|
+
transcoder.transcode request_pb
|
200
|
+
end
|
201
|
+
|
202
|
+
##
|
203
|
+
# @private
|
204
|
+
#
|
205
|
+
# GRPC transcoding helper method for the list_orders REST call
|
206
|
+
#
|
207
|
+
# @param request_pb [::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersRequest]
|
208
|
+
# A request object representing the call parameters. Required.
|
209
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
210
|
+
# Uri, Body, Query string parameters
|
211
|
+
def self.transcode_list_orders_request request_pb
|
212
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
213
|
+
.with_bindings(
|
214
|
+
uri_method: :get,
|
215
|
+
uri_template: "/v1/{parent}/orders",
|
216
|
+
matches: [
|
217
|
+
["parent", %r{^billingAccounts/[^/]+/?$}, false]
|
218
|
+
]
|
219
|
+
)
|
220
|
+
transcoder.transcode request_pb
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/commerce/consumer/procurement/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/credentials"
|
26
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths"
|
27
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/operations"
|
28
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module Commerce
|
33
|
+
module Consumer
|
34
|
+
module Procurement
|
35
|
+
module V1
|
36
|
+
##
|
37
|
+
# ConsumerProcurementService allows customers to make purchases of products
|
38
|
+
# served by the Cloud Commerce platform.
|
39
|
+
#
|
40
|
+
#
|
41
|
+
# When purchases are made, the
|
42
|
+
# {::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client ConsumerProcurementService}
|
43
|
+
# programs the appropriate backends, including both Google's own
|
44
|
+
# infrastructure, as well as third-party systems, and to enable billing setup
|
45
|
+
# for charging for the procured item.
|
46
|
+
#
|
47
|
+
# To load this service and instantiate a REST client:
|
48
|
+
#
|
49
|
+
# require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest"
|
50
|
+
# client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
|
51
|
+
#
|
52
|
+
module ConsumerProcurementService
|
53
|
+
# Client for the REST transport
|
54
|
+
module Rest
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
65
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/commerce/consumer/procurement/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/credentials"
|
26
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/paths"
|
27
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/operations"
|
28
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/client"
|
29
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest"
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module Commerce
|
34
|
+
module Consumer
|
35
|
+
module Procurement
|
36
|
+
module V1
|
37
|
+
##
|
38
|
+
# ConsumerProcurementService allows customers to make purchases of products
|
39
|
+
# served by the Cloud Commerce platform.
|
40
|
+
#
|
41
|
+
#
|
42
|
+
# When purchases are made, the
|
43
|
+
# {::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client ConsumerProcurementService}
|
44
|
+
# programs the appropriate backends, including both Google's own
|
45
|
+
# infrastructure, as well as third-party systems, and to enable billing setup
|
46
|
+
# for charging for the procured item.
|
47
|
+
#
|
48
|
+
# @example Load this service and instantiate a gRPC client
|
49
|
+
#
|
50
|
+
# require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service"
|
51
|
+
# client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client.new
|
52
|
+
#
|
53
|
+
# @example Load this service and instantiate a REST client
|
54
|
+
#
|
55
|
+
# require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest"
|
56
|
+
# client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
|
57
|
+
#
|
58
|
+
module ConsumerProcurementService
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
helper_path = ::File.join __dir__, "consumer_procurement_service", "helpers.rb"
|
68
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/commerce/consumer/procurement/v1/order.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/field_behavior_pb'
|
8
|
+
require 'google/api/resource_pb'
|
9
|
+
require 'google/protobuf/timestamp_pb'
|
10
|
+
|
11
|
+
|
12
|
+
descriptor_data = "\n9google/cloud/commerce/consumer/procurement/v1/order.proto\x12-google.cloud.commerce.consumer.procurement.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcb\x03\n\x05Order\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x02\x12P\n\nline_items\x18\x06 \x03(\x0b\x32\x37.google.cloud.commerce.consumer.procurement.v1.LineItemB\x03\xe0\x41\x03\x12Z\n\x14\x63\x61ncelled_line_items\x18\x07 \x03(\x0b\x32\x37.google.cloud.commerce.consumer.procurement.v1.LineItemB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t:l\xea\x41i\n5cloudcommerceconsumerprocurement.googleapis.com/Order\x12\x30\x62illingAccounts/{billing_account}/orders/{order}\"\xb7\x02\n\x08LineItem\x12\x19\n\x0cline_item_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12X\n\x0eline_item_info\x18\x02 \x01(\x0b\x32;.google.cloud.commerce.consumer.procurement.v1.LineItemInfoB\x03\xe0\x41\x03\x12Z\n\x0epending_change\x18\x03 \x01(\x0b\x32=.google.cloud.commerce.consumer.procurement.v1.LineItemChangeB\x03\xe0\x41\x03\x12Z\n\x0e\x63hange_history\x18\x04 \x03(\x0b\x32=.google.cloud.commerce.consumer.procurement.v1.LineItemChangeB\x03\xe0\x41\x03\"\xd7\x05\n\x0eLineItemChange\x12\x16\n\tchange_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12[\n\x0b\x63hange_type\x18\x02 \x01(\x0e\x32\x41.google.cloud.commerce.consumer.procurement.v1.LineItemChangeTypeB\x03\xe0\x41\x02\x12\\\n\x12old_line_item_info\x18\x03 \x01(\x0b\x32;.google.cloud.commerce.consumer.procurement.v1.LineItemInfoB\x03\xe0\x41\x03\x12W\n\x12new_line_item_info\x18\x04 \x01(\x0b\x32;.google.cloud.commerce.consumer.procurement.v1.LineItemInfo\x12]\n\x0c\x63hange_state\x18\x05 \x01(\x0e\x32\x42.google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateB\x03\xe0\x41\x03\x12\x19\n\x0cstate_reason\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12s\n\x18\x63hange_state_reason_type\x18\n \x01(\x0e\x32L.google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateReasonTypeB\x03\xe0\x41\x03\x12>\n\x15\x63hange_effective_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xfb\x01\n\x0cLineItemInfo\x12@\n\x05offer\x18\r \x01(\tB1\xe0\x41\x01\xfa\x41+\n)commerceoffercatalog.googleapis.com/Offer\x12Q\n\nparameters\x18\t \x03(\x0b\x32\x38.google.cloud.commerce.consumer.procurement.v1.ParameterB\x03\xe0\x41\x01\x12V\n\x0csubscription\x18\n \x01(\x0b\x32;.google.cloud.commerce.consumer.procurement.v1.SubscriptionB\x03\xe0\x41\x03\"\xc0\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05value\x18\x02 \x01(\x0b\x32>.google.cloud.commerce.consumer.procurement.v1.Parameter.Value\x1aV\n\x05Value\x12\x15\n\x0bint64_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0cstring_value\x18\x04 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x00\x42\x06\n\x04kind\"\x8a\x01\n\x0cSubscription\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x14\x61uto_renewal_enabled\x18\x02 \x01(\x08*\xd0\x01\n\x12LineItemChangeType\x12%\n!LINE_ITEM_CHANGE_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cLINE_ITEM_CHANGE_TYPE_CREATE\x10\x01\x12 \n\x1cLINE_ITEM_CHANGE_TYPE_UPDATE\x10\x02\x12 \n\x1cLINE_ITEM_CHANGE_TYPE_CANCEL\x10\x03\x12-\n)LINE_ITEM_CHANGE_TYPE_REVERT_CANCELLATION\x10\x04*\xa7\x02\n\x13LineItemChangeState\x12&\n\"LINE_ITEM_CHANGE_STATE_UNSPECIFIED\x10\x00\x12+\n\'LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL\x10\x01\x12#\n\x1fLINE_ITEM_CHANGE_STATE_APPROVED\x10\x02\x12$\n LINE_ITEM_CHANGE_STATE_COMPLETED\x10\x03\x12#\n\x1fLINE_ITEM_CHANGE_STATE_REJECTED\x10\x04\x12$\n LINE_ITEM_CHANGE_STATE_ABANDONED\x10\x05\x12%\n!LINE_ITEM_CHANGE_STATE_ACTIVATING\x10\x06*\xf3\x01\n\x1dLineItemChangeStateReasonType\x12\x32\n.LINE_ITEM_CHANGE_STATE_REASON_TYPE_UNSPECIFIED\x10\x00\x12.\n*LINE_ITEM_CHANGE_STATE_REASON_TYPE_EXPIRED\x10\x01\x12\x35\n1LINE_ITEM_CHANGE_STATE_REASON_TYPE_USER_CANCELLED\x10\x02\x12\x37\n3LINE_ITEM_CHANGE_STATE_REASON_TYPE_SYSTEM_CANCELLED\x10\x03\x42\xb4\x03\n1com.google.cloud.commerce.consumer.procurement.v1P\x01ZScloud.google.com/go/commerce/consumer/procurement/apiv1/procurementpb;procurementpb\xaa\x02-Google.Cloud.Commerce.Consumer.Procurement.V1\xca\x02-Google\\Cloud\\Commerce\\Consumer\\Procurement\\V1\xea\x02\x32Google::Cloud::Commerce::Consumer::Procurement::V1\xea\x41\x91\x01\n)commerceoffercatalog.googleapis.com/Offer\x12)services/{service}/standardOffers/{offer}\x12\x39\x62illingAccounts/{consumer_billing_account}/offers/{offer}b\x06proto3"
|
13
|
+
|
14
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
15
|
+
|
16
|
+
begin
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
18
|
+
rescue TypeError => e
|
19
|
+
# Compatibility code: will be removed in the next major version.
|
20
|
+
require 'google/protobuf/descriptor_pb'
|
21
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
22
|
+
parsed.clear_dependency
|
23
|
+
serialized = parsed.class.encode(parsed)
|
24
|
+
file = pool.add_serialized_file(serialized)
|
25
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
26
|
+
imports = [
|
27
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
28
|
+
]
|
29
|
+
imports.each do |type_name, expected_filename|
|
30
|
+
import_file = pool.lookup(type_name).file_descriptor
|
31
|
+
if import_file.name != expected_filename
|
32
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
36
|
+
warn "This will become an error in the next major version."
|
37
|
+
end
|
38
|
+
|
39
|
+
module Google
|
40
|
+
module Cloud
|
41
|
+
module Commerce
|
42
|
+
module Consumer
|
43
|
+
module Procurement
|
44
|
+
module V1
|
45
|
+
Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.Order").msgclass
|
46
|
+
LineItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItem").msgclass
|
47
|
+
LineItemChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItemChange").msgclass
|
48
|
+
LineItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItemInfo").msgclass
|
49
|
+
Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.Parameter").msgclass
|
50
|
+
Parameter::Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.Parameter.Value").msgclass
|
51
|
+
Subscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.Subscription").msgclass
|
52
|
+
LineItemChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItemChangeType").enummodule
|
53
|
+
LineItemChangeState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItemChangeState").enummodule
|
54
|
+
LineItemChangeStateReasonType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateReasonType").enummodule
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/commerce/consumer/procurement/v1/procurement_service.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
11
|
+
require 'google/cloud/commerce/consumer/procurement/v1/order_pb'
|
12
|
+
require 'google/longrunning/operations_pb'
|
13
|
+
|
14
|
+
|
15
|
+
descriptor_data = "\nGgoogle/cloud/commerce/consumer/procurement/v1/procurement_service.proto\x12-google.cloud.commerce.consumer.procurement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/commerce/consumer/procurement/v1/order.proto\x1a#google/longrunning/operations.proto\"\xe5\x01\n\x11PlaceOrderRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12X\n\x0eline_item_info\x18\n \x03(\x0b\x32;.google.cloud.commerce.consumer.procurement.v1.LineItemInfoB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x14\n\x12PlaceOrderMetadata\"$\n\x0fGetOrderRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x11ListOrdersRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"s\n\x12ListOrdersResponse\x12\x44\n\x06orders\x18\x01 \x03(\x0b\x32\x34.google.cloud.commerce.consumer.procurement.v1.Order\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xcc\x05\n\x1a\x43onsumerProcurementService\x12\xc3\x01\n\nPlaceOrder\x12@.google.cloud.commerce.consumer.procurement.v1.PlaceOrderRequest\x1a\x1d.google.longrunning.Operation\"T\x82\xd3\xe4\x93\x02\x30\"+/v1/{parent=billingAccounts/*}/orders:place:\x01*\xca\x41\x1b\n\x05Order\x12\x12PlaceOrderMetadata\x12\xb6\x01\n\x08GetOrder\x12>.google.cloud.commerce.consumer.procurement.v1.GetOrderRequest\x1a\x34.google.cloud.commerce.consumer.procurement.v1.Order\"4\x82\xd3\xe4\x93\x02\'\x12%/v1/{name=billingAccounts/*/orders/*}\xda\x41\x04name\x12\xc9\x01\n\nListOrders\x12@.google.cloud.commerce.consumer.procurement.v1.ListOrdersRequest\x1a\x41.google.cloud.commerce.consumer.procurement.v1.ListOrdersResponse\"6\x82\xd3\xe4\x93\x02\'\x12%/v1/{parent=billingAccounts/*}/orders\xda\x41\x06parent\x1a\x63\xca\x41/cloudcommerceconsumerprocurement.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9f\x02\n1com.google.cloud.commerce.consumer.procurement.v1P\x01ZScloud.google.com/go/commerce/consumer/procurement/apiv1/procurementpb;procurementpb\xaa\x02-Google.Cloud.Commerce.Consumer.Procurement.V1\xca\x02-Google\\Cloud\\Commerce\\Consumer\\Procurement\\V1\xea\x02\x32Google::Cloud::Commerce::Consumer::Procurement::V1b\x06proto3"
|
16
|
+
|
17
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
18
|
+
|
19
|
+
begin
|
20
|
+
pool.add_serialized_file(descriptor_data)
|
21
|
+
rescue TypeError => e
|
22
|
+
# Compatibility code: will be removed in the next major version.
|
23
|
+
require 'google/protobuf/descriptor_pb'
|
24
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
25
|
+
parsed.clear_dependency
|
26
|
+
serialized = parsed.class.encode(parsed)
|
27
|
+
file = pool.add_serialized_file(serialized)
|
28
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
29
|
+
imports = [
|
30
|
+
["google.cloud.commerce.consumer.procurement.v1.LineItemInfo", "google/cloud/commerce/consumer/procurement/v1/order.proto"],
|
31
|
+
]
|
32
|
+
imports.each do |type_name, expected_filename|
|
33
|
+
import_file = pool.lookup(type_name).file_descriptor
|
34
|
+
if import_file.name != expected_filename
|
35
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
39
|
+
warn "This will become an error in the next major version."
|
40
|
+
end
|
41
|
+
|
42
|
+
module Google
|
43
|
+
module Cloud
|
44
|
+
module Commerce
|
45
|
+
module Consumer
|
46
|
+
module Procurement
|
47
|
+
module V1
|
48
|
+
PlaceOrderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.PlaceOrderRequest").msgclass
|
49
|
+
PlaceOrderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.PlaceOrderMetadata").msgclass
|
50
|
+
GetOrderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.GetOrderRequest").msgclass
|
51
|
+
ListOrdersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.ListOrdersRequest").msgclass
|
52
|
+
ListOrdersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.commerce.consumer.procurement.v1.ListOrdersResponse").msgclass
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/commerce/consumer/procurement/v1/procurement_service.proto for package 'Google.Cloud.Commerce.Consumer.Procurement.V1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2023 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/commerce/consumer/procurement/v1/procurement_service_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Commerce
|
25
|
+
module Consumer
|
26
|
+
module Procurement
|
27
|
+
module V1
|
28
|
+
module ConsumerProcurementService
|
29
|
+
# ConsumerProcurementService allows customers to make purchases of products
|
30
|
+
# served by the Cloud Commerce platform.
|
31
|
+
#
|
32
|
+
#
|
33
|
+
# When purchases are made, the
|
34
|
+
# [ConsumerProcurementService][google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService]
|
35
|
+
# programs the appropriate backends, including both Google's own
|
36
|
+
# infrastructure, as well as third-party systems, and to enable billing setup
|
37
|
+
# for charging for the procured item.
|
38
|
+
#
|
39
|
+
class Service
|
40
|
+
|
41
|
+
include ::GRPC::GenericService
|
42
|
+
|
43
|
+
self.marshal_class_method = :encode
|
44
|
+
self.unmarshal_class_method = :decode
|
45
|
+
self.service_name = 'google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService'
|
46
|
+
|
47
|
+
# Creates a new [Order][google.cloud.commerce.consumer.procurement.v1.Order].
|
48
|
+
#
|
49
|
+
# This API only supports GCP spend-based committed use
|
50
|
+
# discounts specified by GCP documentation.
|
51
|
+
#
|
52
|
+
# The returned long-running operation is in-progress until the backend
|
53
|
+
# completes the creation of the resource. Once completed, the order is
|
54
|
+
# in
|
55
|
+
# [OrderState.ORDER_STATE_ACTIVE][google.cloud.commerce.consumer.procurement.v1.OrderState.ORDER_STATE_ACTIVE].
|
56
|
+
# In case of failure, the order resource will be removed.
|
57
|
+
rpc :PlaceOrder, ::Google::Cloud::Commerce::Consumer::Procurement::V1::PlaceOrderRequest, ::Google::Longrunning::Operation
|
58
|
+
# Returns the requested
|
59
|
+
# [Order][google.cloud.commerce.consumer.procurement.v1.Order] resource.
|
60
|
+
rpc :GetOrder, ::Google::Cloud::Commerce::Consumer::Procurement::V1::GetOrderRequest, ::Google::Cloud::Commerce::Consumer::Procurement::V1::Order
|
61
|
+
# Lists [Order][google.cloud.commerce.consumer.procurement.v1.Order]
|
62
|
+
# resources that the user has access to, within the scope of the parent
|
63
|
+
# resource.
|
64
|
+
rpc :ListOrders, ::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersRequest, ::Google::Cloud::Commerce::Consumer::Procurement::V1::ListOrdersResponse
|
65
|
+
end
|
66
|
+
|
67
|
+
Stub = Service.rpc_stub_class
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest"
|
20
|
+
require "google/cloud/commerce/consumer/procurement/v1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Commerce
|
25
|
+
module Consumer
|
26
|
+
module Procurement
|
27
|
+
##
|
28
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
#
|
32
|
+
# require "google/cloud/commerce/consumer/procurement/v1/rest"
|
33
|
+
# client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new
|
34
|
+
#
|
35
|
+
module V1
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2023 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
5
7
|
# You may obtain a copy of the License at
|
6
8
|
#
|
7
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
10
|
#
|
9
11
|
# Unless required by applicable law or agreed to in writing, software
|
10
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -12,13 +14,16 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
15
20
|
module Google
|
16
21
|
module Cloud
|
17
22
|
module Commerce
|
18
23
|
module Consumer
|
19
24
|
module Procurement
|
20
25
|
module V1
|
21
|
-
VERSION = "0.
|
26
|
+
VERSION = "0.2.0"
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|