google-cloud-workflows-v1beta 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-workflows-v1beta.rb +21 -0
- data/lib/google/cloud/workflows/v1beta.rb +35 -0
- data/lib/google/cloud/workflows/v1beta/version.rb +28 -0
- data/lib/google/cloud/workflows/v1beta/workflows.rb +52 -0
- data/lib/google/cloud/workflows/v1beta/workflows/client.rb +724 -0
- data/lib/google/cloud/workflows/v1beta/workflows/credentials.rb +51 -0
- data/lib/google/cloud/workflows/v1beta/workflows/operations.rb +570 -0
- data/lib/google/cloud/workflows/v1beta/workflows/paths.rb +69 -0
- data/lib/google/cloud/workflows/v1beta/workflows_pb.rb +86 -0
- data/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb +64 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/workflows/v1beta/workflows.rb +242 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +210 -0
@@ -0,0 +1,242 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Workflows
|
23
|
+
module V1beta
|
24
|
+
# Workflow program to be executed by Workflows.
|
25
|
+
# @!attribute [rw] name
|
26
|
+
# @return [::String]
|
27
|
+
# The resource name of the workflow.
|
28
|
+
# Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow}
|
29
|
+
# @!attribute [rw] description
|
30
|
+
# @return [::String]
|
31
|
+
# Description of the workflow provided by the user.
|
32
|
+
# Must be at most 1000 unicode characters long.
|
33
|
+
# @!attribute [r] state
|
34
|
+
# @return [::Google::Cloud::Workflows::V1beta::Workflow::State]
|
35
|
+
# Output only. State of the workflow deployment.
|
36
|
+
# @!attribute [r] revision_id
|
37
|
+
# @return [::String]
|
38
|
+
# Output only. The revision of the workflow.
|
39
|
+
# A new revision of a workflow is created as a result of updating the
|
40
|
+
# following fields of a workflow:
|
41
|
+
# - `source_code`
|
42
|
+
# - `service_account`
|
43
|
+
# The format is "000001-a4d", where the first 6 characters define
|
44
|
+
# the zero-padded revision ordinal number. They are followed by a hyphen and
|
45
|
+
# 3 hexadecimal random characters.
|
46
|
+
# @!attribute [r] create_time
|
47
|
+
# @return [::Google::Protobuf::Timestamp]
|
48
|
+
# Output only. The timestamp of when the workflow was created.
|
49
|
+
# @!attribute [r] update_time
|
50
|
+
# @return [::Google::Protobuf::Timestamp]
|
51
|
+
# Output only. The last update timestamp of the workflow.
|
52
|
+
# @!attribute [r] revision_create_time
|
53
|
+
# @return [::Google::Protobuf::Timestamp]
|
54
|
+
# Output only. The timestamp that the latest revision of the workflow
|
55
|
+
# was created.
|
56
|
+
# @!attribute [rw] labels
|
57
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
58
|
+
# Labels associated with this workflow.
|
59
|
+
# Labels can contain at most 64 entries. Keys and values can be no longer
|
60
|
+
# than 63 characters and can only contain lowercase letters, numeric
|
61
|
+
# characters, underscores and dashes. Label keys must start with a letter.
|
62
|
+
# International characters are allowed.
|
63
|
+
# @!attribute [rw] service_account
|
64
|
+
# @return [::String]
|
65
|
+
# Name of the service account associated with the latest workflow version.
|
66
|
+
# This service account represents the identity of the workflow and determines
|
67
|
+
# what permissions the workflow has.
|
68
|
+
# Format: projects/\\{project}/serviceAccounts/\\{account}
|
69
|
+
#
|
70
|
+
# Using `-` as a wildcard for the `{project}` will infer the project from
|
71
|
+
# the account. The `{account}` value can be the `email` address or the
|
72
|
+
# `unique_id` of the service account.
|
73
|
+
#
|
74
|
+
# If not provided, workflow will use the project's default service account.
|
75
|
+
# Modifying this field for an existing workflow results in a new workflow
|
76
|
+
# revision.
|
77
|
+
# @!attribute [rw] source_contents
|
78
|
+
# @return [::String]
|
79
|
+
# Workflow code to be executed. The size limit is 32KB.
|
80
|
+
class Workflow
|
81
|
+
include ::Google::Protobuf::MessageExts
|
82
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
83
|
+
|
84
|
+
# @!attribute [rw] key
|
85
|
+
# @return [::String]
|
86
|
+
# @!attribute [rw] value
|
87
|
+
# @return [::String]
|
88
|
+
class LabelsEntry
|
89
|
+
include ::Google::Protobuf::MessageExts
|
90
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
91
|
+
end
|
92
|
+
|
93
|
+
# Describes the current state of workflow deployment. More states may be
|
94
|
+
# added in the future.
|
95
|
+
module State
|
96
|
+
# Invalid state.
|
97
|
+
STATE_UNSPECIFIED = 0
|
98
|
+
|
99
|
+
# The workflow has been deployed successfully and is serving.
|
100
|
+
ACTIVE = 1
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Request for the
|
105
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows}
|
106
|
+
# method.
|
107
|
+
# @!attribute [rw] parent
|
108
|
+
# @return [::String]
|
109
|
+
# Required. Project and location from which the workflows should be listed.
|
110
|
+
# Format: projects/\\{project}/locations/\\{location}
|
111
|
+
# @!attribute [rw] page_size
|
112
|
+
# @return [::Integer]
|
113
|
+
# Maximum number of workflows to return per call. The service may return
|
114
|
+
# fewer than this value. If the value is not specified, a default value of
|
115
|
+
# 500 will be used. The maximum permitted value is 1000 and values greater
|
116
|
+
# than 1000 will be coerced down to 1000.
|
117
|
+
# @!attribute [rw] page_token
|
118
|
+
# @return [::String]
|
119
|
+
# A page token, received from a previous `ListWorkflows` call.
|
120
|
+
# Provide this to retrieve the subsequent page.
|
121
|
+
#
|
122
|
+
# When paginating, all other parameters provided to `ListWorkflows` must
|
123
|
+
# match the call that provided the page token.
|
124
|
+
# @!attribute [rw] filter
|
125
|
+
# @return [::String]
|
126
|
+
# Filter to restrict results to specific workflows.
|
127
|
+
# @!attribute [rw] order_by
|
128
|
+
# @return [::String]
|
129
|
+
# Comma-separated list of fields that that specify the order of the results.
|
130
|
+
# Default sorting order for a field is ascending. To specify descending order
|
131
|
+
# for a field, append a " desc" suffix.
|
132
|
+
# If not specified, the results will be returned in an unspecified order.
|
133
|
+
class ListWorkflowsRequest
|
134
|
+
include ::Google::Protobuf::MessageExts
|
135
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
136
|
+
end
|
137
|
+
|
138
|
+
# Response for the
|
139
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows}
|
140
|
+
# method.
|
141
|
+
# @!attribute [rw] workflows
|
142
|
+
# @return [::Array<::Google::Cloud::Workflows::V1beta::Workflow>]
|
143
|
+
# The workflows which match the request.
|
144
|
+
# @!attribute [rw] next_page_token
|
145
|
+
# @return [::String]
|
146
|
+
# A token, which can be sent as `page_token` to retrieve the next page.
|
147
|
+
# If this field is omitted, there are no subsequent pages.
|
148
|
+
# @!attribute [rw] unreachable
|
149
|
+
# @return [::Array<::String>]
|
150
|
+
# Unreachable resources.
|
151
|
+
class ListWorkflowsResponse
|
152
|
+
include ::Google::Protobuf::MessageExts
|
153
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
154
|
+
end
|
155
|
+
|
156
|
+
# Request for the
|
157
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow GetWorkflow} method.
|
158
|
+
# @!attribute [rw] name
|
159
|
+
# @return [::String]
|
160
|
+
# Required. Name of the workflow which information should be retrieved.
|
161
|
+
# Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow}
|
162
|
+
class GetWorkflowRequest
|
163
|
+
include ::Google::Protobuf::MessageExts
|
164
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
165
|
+
end
|
166
|
+
|
167
|
+
# Request for the
|
168
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow CreateWorkflow}
|
169
|
+
# method.
|
170
|
+
# @!attribute [rw] parent
|
171
|
+
# @return [::String]
|
172
|
+
# Required. Project and location in which the workflow should be created.
|
173
|
+
# Format: projects/\\{project}/locations/\\{location}
|
174
|
+
# @!attribute [rw] workflow
|
175
|
+
# @return [::Google::Cloud::Workflows::V1beta::Workflow]
|
176
|
+
# Required. Workflow to be created.
|
177
|
+
# @!attribute [rw] workflow_id
|
178
|
+
# @return [::String]
|
179
|
+
# Required. The ID of the workflow to be created. It has to fulfill the
|
180
|
+
# following requirements:
|
181
|
+
#
|
182
|
+
# * Must contain only letters, numbers, underscores and hyphens.
|
183
|
+
# * Must start with a letter.
|
184
|
+
# * Must be between 1-64 characters.
|
185
|
+
# * Must end with a number or a letter.
|
186
|
+
# * Must be unique within the customer project and location.
|
187
|
+
class CreateWorkflowRequest
|
188
|
+
include ::Google::Protobuf::MessageExts
|
189
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
190
|
+
end
|
191
|
+
|
192
|
+
# Request for the
|
193
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow DeleteWorkflow}
|
194
|
+
# method.
|
195
|
+
# @!attribute [rw] name
|
196
|
+
# @return [::String]
|
197
|
+
# Required. Name of the workflow to be deleted.
|
198
|
+
# Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow}
|
199
|
+
class DeleteWorkflowRequest
|
200
|
+
include ::Google::Protobuf::MessageExts
|
201
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
202
|
+
end
|
203
|
+
|
204
|
+
# Request for the
|
205
|
+
# {::Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow UpdateWorkflow}
|
206
|
+
# method.
|
207
|
+
# @!attribute [rw] workflow
|
208
|
+
# @return [::Google::Cloud::Workflows::V1beta::Workflow]
|
209
|
+
# Required. Workflow to be updated.
|
210
|
+
# @!attribute [rw] update_mask
|
211
|
+
# @return [::Google::Protobuf::FieldMask]
|
212
|
+
# List of fields to be updated. If not present, the entire workflow
|
213
|
+
# will be updated.
|
214
|
+
class UpdateWorkflowRequest
|
215
|
+
include ::Google::Protobuf::MessageExts
|
216
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
217
|
+
end
|
218
|
+
|
219
|
+
# Represents the metadata of the long-running operation.
|
220
|
+
# @!attribute [rw] create_time
|
221
|
+
# @return [::Google::Protobuf::Timestamp]
|
222
|
+
# The time the operation was created.
|
223
|
+
# @!attribute [rw] end_time
|
224
|
+
# @return [::Google::Protobuf::Timestamp]
|
225
|
+
# The time the operation finished running.
|
226
|
+
# @!attribute [rw] target
|
227
|
+
# @return [::String]
|
228
|
+
# Server-defined resource path for the target of the operation.
|
229
|
+
# @!attribute [rw] verb
|
230
|
+
# @return [::String]
|
231
|
+
# Name of the verb executed by the operation.
|
232
|
+
# @!attribute [rw] api_version
|
233
|
+
# @return [::String]
|
234
|
+
# API version used to start the operation.
|
235
|
+
class OperationMetadata
|
236
|
+
include ::Google::Protobuf::MessageExts
|
237
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
|
20
|
+
module Google
|
21
|
+
module Longrunning
|
22
|
+
# This resource represents a long-running operation that is the result of a
|
23
|
+
# network API call.
|
24
|
+
# @!attribute [rw] name
|
25
|
+
# @return [::String]
|
26
|
+
# The server-assigned name, which is only unique within the same service that
|
27
|
+
# originally returns it. If you use the default HTTP mapping, the
|
28
|
+
# `name` should have the format of `operations/some/unique/name`.
|
29
|
+
# @!attribute [rw] metadata
|
30
|
+
# @return [::Google::Protobuf::Any]
|
31
|
+
# Service-specific metadata associated with the operation. It typically
|
32
|
+
# contains progress information and common metadata such as create time.
|
33
|
+
# Some services might not provide such metadata. Any method that returns a
|
34
|
+
# long-running operation should document the metadata type, if any.
|
35
|
+
# @!attribute [rw] done
|
36
|
+
# @return [::Boolean]
|
37
|
+
# If the value is `false`, it means the operation is still in progress.
|
38
|
+
# If true, the operation is completed, and either `error` or `response` is
|
39
|
+
# available.
|
40
|
+
# @!attribute [rw] error
|
41
|
+
# @return [::Google::Rpc::Status]
|
42
|
+
# The error result of the operation in case of failure or cancellation.
|
43
|
+
# @!attribute [rw] response
|
44
|
+
# @return [::Google::Protobuf::Any]
|
45
|
+
# The normal response of the operation in case of success. If the original
|
46
|
+
# method returns no data on success, such as `Delete`, the response is
|
47
|
+
# `google.protobuf.Empty`. If the original method is standard
|
48
|
+
# `Get`/`Create`/`Update`, the response should be the resource. For other
|
49
|
+
# methods, the response should have the type `XxxResponse`, where `Xxx`
|
50
|
+
# is the original method name. For example, if the original method name
|
51
|
+
# is `TakeSnapshot()`, the inferred response type is
|
52
|
+
# `TakeSnapshotResponse`.
|
53
|
+
class Operation
|
54
|
+
include ::Google::Protobuf::MessageExts
|
55
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
56
|
+
end
|
57
|
+
|
58
|
+
# The request message for Operations.GetOperation.
|
59
|
+
# @!attribute [rw] name
|
60
|
+
# @return [::String]
|
61
|
+
# The name of the operation resource.
|
62
|
+
class GetOperationRequest
|
63
|
+
include ::Google::Protobuf::MessageExts
|
64
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
65
|
+
end
|
66
|
+
|
67
|
+
# The request message for Operations.ListOperations.
|
68
|
+
# @!attribute [rw] name
|
69
|
+
# @return [::String]
|
70
|
+
# The name of the operation collection.
|
71
|
+
# @!attribute [rw] filter
|
72
|
+
# @return [::String]
|
73
|
+
# The standard list filter.
|
74
|
+
# @!attribute [rw] page_size
|
75
|
+
# @return [::Integer]
|
76
|
+
# The standard list page size.
|
77
|
+
# @!attribute [rw] page_token
|
78
|
+
# @return [::String]
|
79
|
+
# The standard list page token.
|
80
|
+
class ListOperationsRequest
|
81
|
+
include ::Google::Protobuf::MessageExts
|
82
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
83
|
+
end
|
84
|
+
|
85
|
+
# The response message for Operations.ListOperations.
|
86
|
+
# @!attribute [rw] operations
|
87
|
+
# @return [::Array<::Google::Longrunning::Operation>]
|
88
|
+
# A list of operations that matches the specified filter in the request.
|
89
|
+
# @!attribute [rw] next_page_token
|
90
|
+
# @return [::String]
|
91
|
+
# The standard List next-page token.
|
92
|
+
class ListOperationsResponse
|
93
|
+
include ::Google::Protobuf::MessageExts
|
94
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
95
|
+
end
|
96
|
+
|
97
|
+
# The request message for Operations.CancelOperation.
|
98
|
+
# @!attribute [rw] name
|
99
|
+
# @return [::String]
|
100
|
+
# The name of the operation resource to be cancelled.
|
101
|
+
class CancelOperationRequest
|
102
|
+
include ::Google::Protobuf::MessageExts
|
103
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
104
|
+
end
|
105
|
+
|
106
|
+
# The request message for Operations.DeleteOperation.
|
107
|
+
# @!attribute [rw] name
|
108
|
+
# @return [::String]
|
109
|
+
# The name of the operation resource to be deleted.
|
110
|
+
class DeleteOperationRequest
|
111
|
+
include ::Google::Protobuf::MessageExts
|
112
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
113
|
+
end
|
114
|
+
|
115
|
+
# A message representing the message types used by a long-running operation.
|
116
|
+
#
|
117
|
+
# Example:
|
118
|
+
#
|
119
|
+
# rpc LongRunningRecognize(LongRunningRecognizeRequest)
|
120
|
+
# returns (google.longrunning.Operation) {
|
121
|
+
# option (google.longrunning.operation_info) = {
|
122
|
+
# response_type: "LongRunningRecognizeResponse"
|
123
|
+
# metadata_type: "LongRunningRecognizeMetadata"
|
124
|
+
# };
|
125
|
+
# }
|
126
|
+
# @!attribute [rw] response_type
|
127
|
+
# @return [::String]
|
128
|
+
# Required. The message name of the primary return type for this
|
129
|
+
# long-running operation.
|
130
|
+
# This type will be used to deserialize the LRO's response.
|
131
|
+
#
|
132
|
+
# If the response is in a different package from the rpc, a fully-qualified
|
133
|
+
# message name must be used (e.g. `google.protobuf.Struct`).
|
134
|
+
#
|
135
|
+
# Note: Altering this value constitutes a breaking change.
|
136
|
+
# @!attribute [rw] metadata_type
|
137
|
+
# @return [::String]
|
138
|
+
# Required. The message name of the metadata type for this long-running
|
139
|
+
# operation.
|
140
|
+
#
|
141
|
+
# If the response is in a different package from the rpc, a fully-qualified
|
142
|
+
# message name must be used (e.g. `google.protobuf.Struct`).
|
143
|
+
#
|
144
|
+
# Note: Altering this value constitutes a breaking change.
|
145
|
+
class OperationInfo
|
146
|
+
include ::Google::Protobuf::MessageExts
|
147
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
|
20
|
+
module Google
|
21
|
+
module Protobuf
|
22
|
+
# `Any` contains an arbitrary serialized protocol buffer message along with a
|
23
|
+
# URL that describes the type of the serialized message.
|
24
|
+
#
|
25
|
+
# Protobuf library provides support to pack/unpack Any values in the form
|
26
|
+
# of utility functions or additional generated methods of the Any type.
|
27
|
+
#
|
28
|
+
# Example 1: Pack and unpack a message in C++.
|
29
|
+
#
|
30
|
+
# Foo foo = ...;
|
31
|
+
# Any any;
|
32
|
+
# any.PackFrom(foo);
|
33
|
+
# ...
|
34
|
+
# if (any.UnpackTo(&foo)) {
|
35
|
+
# ...
|
36
|
+
# }
|
37
|
+
#
|
38
|
+
# Example 2: Pack and unpack a message in Java.
|
39
|
+
#
|
40
|
+
# Foo foo = ...;
|
41
|
+
# Any any = Any.pack(foo);
|
42
|
+
# ...
|
43
|
+
# if (any.is(Foo.class)) {
|
44
|
+
# foo = any.unpack(Foo.class);
|
45
|
+
# }
|
46
|
+
#
|
47
|
+
# Example 3: Pack and unpack a message in Python.
|
48
|
+
#
|
49
|
+
# foo = Foo(...)
|
50
|
+
# any = Any()
|
51
|
+
# any.Pack(foo)
|
52
|
+
# ...
|
53
|
+
# if any.Is(Foo.DESCRIPTOR):
|
54
|
+
# any.Unpack(foo)
|
55
|
+
# ...
|
56
|
+
#
|
57
|
+
# Example 4: Pack and unpack a message in Go
|
58
|
+
#
|
59
|
+
# foo := &pb.Foo{...}
|
60
|
+
# any, err := ptypes.MarshalAny(foo)
|
61
|
+
# ...
|
62
|
+
# foo := &pb.Foo{}
|
63
|
+
# if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
64
|
+
# ...
|
65
|
+
# }
|
66
|
+
#
|
67
|
+
# The pack methods provided by protobuf library will by default use
|
68
|
+
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
69
|
+
# methods only use the fully qualified type name after the last '/'
|
70
|
+
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
71
|
+
# name "y.z".
|
72
|
+
#
|
73
|
+
#
|
74
|
+
# JSON
|
75
|
+
# ====
|
76
|
+
# The JSON representation of an `Any` value uses the regular
|
77
|
+
# representation of the deserialized, embedded message, with an
|
78
|
+
# additional field `@type` which contains the type URL. Example:
|
79
|
+
#
|
80
|
+
# package google.profile;
|
81
|
+
# message Person {
|
82
|
+
# string first_name = 1;
|
83
|
+
# string last_name = 2;
|
84
|
+
# }
|
85
|
+
#
|
86
|
+
# {
|
87
|
+
# "@type": "type.googleapis.com/google.profile.Person",
|
88
|
+
# "firstName": <string>,
|
89
|
+
# "lastName": <string>
|
90
|
+
# }
|
91
|
+
#
|
92
|
+
# If the embedded message type is well-known and has a custom JSON
|
93
|
+
# representation, that representation will be embedded adding a field
|
94
|
+
# `value` which holds the custom JSON in addition to the `@type`
|
95
|
+
# field. Example (for message [google.protobuf.Duration][]):
|
96
|
+
#
|
97
|
+
# {
|
98
|
+
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
99
|
+
# "value": "1.212s"
|
100
|
+
# }
|
101
|
+
# @!attribute [rw] type_url
|
102
|
+
# @return [::String]
|
103
|
+
# A URL/resource name that uniquely identifies the type of the serialized
|
104
|
+
# protocol buffer message. This string must contain at least
|
105
|
+
# one "/" character. The last segment of the URL's path must represent
|
106
|
+
# the fully qualified name of the type (as in
|
107
|
+
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
108
|
+
# (e.g., leading "." is not accepted).
|
109
|
+
#
|
110
|
+
# In practice, teams usually precompile into the binary all types that they
|
111
|
+
# expect it to use in the context of Any. However, for URLs which use the
|
112
|
+
# scheme `http`, `https`, or no scheme, one can optionally set up a type
|
113
|
+
# server that maps type URLs to message definitions as follows:
|
114
|
+
#
|
115
|
+
# * If no scheme is provided, `https` is assumed.
|
116
|
+
# * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
117
|
+
# value in binary format, or produce an error.
|
118
|
+
# * Applications are allowed to cache lookup results based on the
|
119
|
+
# URL, or have them precompiled into a binary to avoid any
|
120
|
+
# lookup. Therefore, binary compatibility needs to be preserved
|
121
|
+
# on changes to types. (Use versioned type names to manage
|
122
|
+
# breaking changes.)
|
123
|
+
#
|
124
|
+
# Note: this functionality is not currently available in the official
|
125
|
+
# protobuf release, and it is not used for type URLs beginning with
|
126
|
+
# type.googleapis.com.
|
127
|
+
#
|
128
|
+
# Schemes other than `http`, `https` (or the empty scheme) might be
|
129
|
+
# used with implementation specific semantics.
|
130
|
+
# @!attribute [rw] value
|
131
|
+
# @return [::String]
|
132
|
+
# Must be a valid serialized protocol buffer of the above specified type.
|
133
|
+
class Any
|
134
|
+
include ::Google::Protobuf::MessageExts
|
135
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|