google-cloud-trace 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66c46c37ec4448e49ac2fddd212eceb6955fc372affcda365b2df92695b0681
4
- data.tar.gz: b2258c73168191d36cb4f856c8090dfd0895dc8d8f0c569b2e02ea8eb69ed06c
3
+ metadata.gz: d574f63df936d1b723a90b85edd1b3d47bdf9277551a3381805dc81948f307bd
4
+ data.tar.gz: 2c74ee01e1ea547d8c571af74a012c89007843c8f63677ecf0a65c582006db14
5
5
  SHA512:
6
- metadata.gz: 5f1fa9ad6cd0227e39dceba174113c7784902711153af5a8632f34bc33265179b9ecc914dfdba6c79f20577fa7368f33683acfbf0086561b77b1a8498e7a6e98
7
- data.tar.gz: 6a9d28122b87f7eca21f2a29101d8736e903405fea5d802fd97db2ca15718553c00a23935cb1a1c1c786d3e67be61344ea8912a759f0804621d3c6465af4b0c4
6
+ metadata.gz: 25ee616dfaba762ca236c4501c1e385ae498f6d85f177c18eab8b6508c64d710d877a885a49565d537c561c79b5dd788cb059c43ca574d91800f3da6b458b7af
7
+ data.tar.gz: 12339946132e7d8bc218ff64ab1cb191ea3a9dc3a93e25e4e03b42713d42df763aa2809051c52ab8adb181075d0913903d1d849e9bfb47ff9fc58ee4b0214426
@@ -0,0 +1,114 @@
1
+ # Copyright 2017 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/cloud/trace/v2/trace_service_client"
16
+
17
+ module Google
18
+ module Cloud
19
+ # rubocop:disable LineLength
20
+
21
+ ##
22
+ # # Ruby Client for Stackdriver Trace API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
23
+ #
24
+ # [Stackdriver Trace API][Product Documentation]:
25
+ # Sends application trace data to Stackdriver Trace for viewing. Trace data is
26
+ # collected for all App Engine applications by default. Trace data from other
27
+ # applications can be provided using this API.
28
+ # - [Product Documentation][]
29
+ #
30
+ # ## Quick Start
31
+ # In order to use this library, you first need to go through the following
32
+ # steps:
33
+ #
34
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
35
+ # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
36
+ # 3. [Enable the Stackdriver Trace API.](https://console.cloud.google.com/apis/api/trace)
37
+ # 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
38
+ #
39
+ # ### Preview
40
+ # #### TraceServiceClient
41
+ # ```rb
42
+ # require "google/cloud/trace/v2"
43
+ #
44
+ # trace_service_client = Google::Cloud::Trace::V2.new
45
+ # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path(project_id)
46
+ # spans = []
47
+ # trace_service_client.batch_write_spans(formatted_name, spans)
48
+ # ```
49
+ #
50
+ # ### Next Steps
51
+ # - Read the [Stackdriver Trace API Product documentation][Product Documentation]
52
+ # to learn more about the product and see How-to Guides.
53
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
54
+ # to see the full list of Cloud APIs that we cover.
55
+ #
56
+ # [Product Documentation]: https://cloud.google.com/trace
57
+ #
58
+ #
59
+ module Trace
60
+ module V2
61
+ # rubocop:enable LineLength
62
+
63
+ ##
64
+ # This file describes an API for collecting and viewing traces and spans
65
+ # within a trace. A Trace is a collection of spans corresponding to a single
66
+ # operation or set of operations for an application. A span is an individual
67
+ # timed event which forms a node of the trace tree. A single trace may
68
+ # contain span(s) from multiple services.
69
+ #
70
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
71
+ # Provides the means for authenticating requests made by the client. This parameter can
72
+ # be many types.
73
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
74
+ # authenticating requests made by this client.
75
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
76
+ # credentials for this client.
77
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
78
+ # credentials for this client.
79
+ # A `GRPC::Core::Channel` will be used to make calls through.
80
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
81
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
82
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
83
+ # metadata for requests, generally, to give OAuth credentials.
84
+ # @param scopes [Array<String>]
85
+ # The OAuth scopes for this service. This parameter is ignored if
86
+ # an updater_proc is supplied.
87
+ # @param client_config [Hash]
88
+ # A Hash for call options for each method. See
89
+ # Google::Gax#construct_settings for the structure of
90
+ # this data. Falls back to the default config if not specified
91
+ # or the specified config is missing data points.
92
+ # @param timeout [Numeric]
93
+ # The default timeout, in seconds, for calls made through this client.
94
+ def self.new \
95
+ credentials: nil,
96
+ scopes: nil,
97
+ client_config: nil,
98
+ timeout: nil,
99
+ lib_name: nil,
100
+ lib_version: nil
101
+ kwargs = {
102
+ credentials: credentials,
103
+ scopes: scopes,
104
+ client_config: client_config,
105
+ timeout: timeout,
106
+ lib_name: lib_name,
107
+ lib_version: lib_version
108
+ }.select { |_, v| v != nil }
109
+ Google::Cloud::Trace::V2::TraceServiceClient.new(**kwargs)
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,320 @@
1
+ # Copyright 2017 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Devtools
17
+ module Cloudtrace
18
+ module V2
19
+ # A span represents a single operation within a trace. Spans can be
20
+ # nested to form a trace tree. Often, a trace contains a root span
21
+ # that describes the end-to-end latency, and one or more subspans for
22
+ # its sub-operations. A trace can also contain multiple root spans,
23
+ # or none at all. Spans do not need to be contiguous&mdash;there may be
24
+ # gaps or overlaps between spans in a trace.
25
+ # @!attribute [rw] name
26
+ # @return [String]
27
+ # The resource name of the span in the following format:
28
+ #
29
+ # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
30
+ #
31
+ # [TRACE_ID] is a unique identifier for a trace within a project;
32
+ # it is a 32-character hexadecimal encoding of a 16-byte array.
33
+ #
34
+ # [SPAN_ID] is a unique identifier for a span within a trace; it
35
+ # is a 16-character hexadecimal encoding of an 8-byte array.
36
+ # @!attribute [rw] span_id
37
+ # @return [String]
38
+ # The [SPAN_ID] portion of the span's resource name.
39
+ # @!attribute [rw] parent_span_id
40
+ # @return [String]
41
+ # The [SPAN_ID] of this span's parent span. If this is a root span,
42
+ # then this field must be empty.
43
+ # @!attribute [rw] display_name
44
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
45
+ # A description of the span's operation (up to 128 bytes).
46
+ # Stackdriver Trace displays the description in the
47
+ # {% dynamic print site_values.console_name %}.
48
+ # For example, the display name can be a qualified method name or a file name
49
+ # and a line number where the operation is called. A best practice is to use
50
+ # the same display name within an application and at the same call point.
51
+ # This makes it easier to correlate spans in different traces.
52
+ # @!attribute [rw] start_time
53
+ # @return [Google::Protobuf::Timestamp]
54
+ # The start time of the span. On the client side, this is the time kept by
55
+ # the local machine where the span execution starts. On the server side, this
56
+ # is the time when the server's application handler starts running.
57
+ # @!attribute [rw] end_time
58
+ # @return [Google::Protobuf::Timestamp]
59
+ # The end time of the span. On the client side, this is the time kept by
60
+ # the local machine where the span execution ends. On the server side, this
61
+ # is the time when the server application handler stops running.
62
+ # @!attribute [rw] attributes
63
+ # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
64
+ # A set of attributes on the span. You can have up to 32 attributes per
65
+ # span.
66
+ # @!attribute [rw] stack_trace
67
+ # @return [Google::Devtools::Cloudtrace::V2::StackTrace]
68
+ # Stack trace captured at the start of the span.
69
+ # @!attribute [rw] time_events
70
+ # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvents]
71
+ # A set of time events. You can have up to 32 annotations and 128 message
72
+ # events per span.
73
+ # @!attribute [rw] links
74
+ # @return [Google::Devtools::Cloudtrace::V2::Span::Links]
75
+ # Links associated with the span. You can have up to 128 links per Span.
76
+ # @!attribute [rw] status
77
+ # @return [Google::Rpc::Status]
78
+ # An optional final status for this span.
79
+ # @!attribute [rw] same_process_as_parent_span
80
+ # @return [Google::Protobuf::BoolValue]
81
+ # (Optional) Set this parameter to indicate whether this span is in
82
+ # the same process as its parent. If you do not set this parameter,
83
+ # Stackdriver Trace is unable to take advantage of this helpful
84
+ # information.
85
+ # @!attribute [rw] child_span_count
86
+ # @return [Google::Protobuf::Int32Value]
87
+ # An optional number of child spans that were generated while this span
88
+ # was active. If set, allows implementation to detect missing child spans.
89
+ class Span
90
+ # A set of attributes, each in the format +[KEY]:[VALUE]+.
91
+ # @!attribute [rw] attribute_map
92
+ # @return [Hash{String => Google::Devtools::Cloudtrace::V2::AttributeValue}]
93
+ # The set of attributes. Each attribute's key can be up to 128 bytes
94
+ # long. The value can be a string up to 256 bytes, an integer, or the
95
+ # Boolean values +true+ and +false+. For example:
96
+ #
97
+ # "/instance_id": "my-instance"
98
+ # "/http/user_agent": ""
99
+ # "/http/request_bytes": 300
100
+ # "abc.com/myattribute": true
101
+ # @!attribute [rw] dropped_attributes_count
102
+ # @return [Integer]
103
+ # The number of attributes that were discarded. Attributes can be discarded
104
+ # because their keys are too long or because there are too many attributes.
105
+ # If this value is 0 then all attributes are valid.
106
+ class Attributes; end
107
+
108
+ # A time-stamped annotation or message event in the Span.
109
+ # @!attribute [rw] time
110
+ # @return [Google::Protobuf::Timestamp]
111
+ # The timestamp indicating the time the event occurred.
112
+ # @!attribute [rw] annotation
113
+ # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::Annotation]
114
+ # Text annotation with a set of attributes.
115
+ # @!attribute [rw] message_event
116
+ # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::MessageEvent]
117
+ # An event describing a message sent/received between Spans.
118
+ class TimeEvent
119
+ # Text annotation with a set of attributes.
120
+ # @!attribute [rw] description
121
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
122
+ # A user-supplied message describing the event. The maximum length for
123
+ # the description is 256 bytes.
124
+ # @!attribute [rw] attributes
125
+ # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
126
+ # A set of attributes on the annotation. You can have up to 4 attributes
127
+ # per Annotation.
128
+ class Annotation; end
129
+
130
+ # An event describing a message sent/received between Spans.
131
+ # @!attribute [rw] type
132
+ # @return [Google::Devtools::Cloudtrace::V2::Span::TimeEvent::MessageEvent::Type]
133
+ # Type of MessageEvent. Indicates whether the message was sent or
134
+ # received.
135
+ # @!attribute [rw] id
136
+ # @return [Integer]
137
+ # An identifier for the MessageEvent's message that can be used to match
138
+ # SENT and RECEIVED MessageEvents. It is recommended to be unique within
139
+ # a Span.
140
+ # @!attribute [rw] uncompressed_size_bytes
141
+ # @return [Integer]
142
+ # The number of uncompressed bytes sent or received.
143
+ # @!attribute [rw] compressed_size_bytes
144
+ # @return [Integer]
145
+ # The number of compressed bytes sent or received. If missing assumed to
146
+ # be the same size as uncompressed.
147
+ class MessageEvent
148
+ # Indicates whether the message was sent or received.
149
+ module Type
150
+ # Unknown event type.
151
+ TYPE_UNSPECIFIED = 0
152
+
153
+ # Indicates a sent message.
154
+ SENT = 1
155
+
156
+ # Indicates a received message.
157
+ RECEIVED = 2
158
+ end
159
+ end
160
+ end
161
+
162
+ # A collection of +TimeEvent+s. A +TimeEvent+ is a time-stamped annotation
163
+ # on the span, consisting of either user-supplied key:value pairs, or
164
+ # details of a message sent/received between Spans.
165
+ # @!attribute [rw] time_event
166
+ # @return [Array<Google::Devtools::Cloudtrace::V2::Span::TimeEvent>]
167
+ # A collection of +TimeEvent+s.
168
+ # @!attribute [rw] dropped_annotations_count
169
+ # @return [Integer]
170
+ # The number of dropped annotations in all the included time events.
171
+ # If the value is 0, then no annotations were dropped.
172
+ # @!attribute [rw] dropped_message_events_count
173
+ # @return [Integer]
174
+ # The number of dropped message events in all the included time events.
175
+ # If the value is 0, then no message events were dropped.
176
+ class TimeEvents; end
177
+
178
+ # A pointer from the current span to another span in the same trace or in a
179
+ # different trace. For example, this can be used in batching operations,
180
+ # where a single batch handler processes multiple requests from different
181
+ # traces or when the handler receives a request from a different project.
182
+ # @!attribute [rw] trace_id
183
+ # @return [String]
184
+ # The [TRACE_ID] for a trace within a project.
185
+ # @!attribute [rw] span_id
186
+ # @return [String]
187
+ # The [SPAN_ID] for a span within a trace.
188
+ # @!attribute [rw] type
189
+ # @return [Google::Devtools::Cloudtrace::V2::Span::Link::Type]
190
+ # The relationship of the current span relative to the linked span.
191
+ # @!attribute [rw] attributes
192
+ # @return [Google::Devtools::Cloudtrace::V2::Span::Attributes]
193
+ # A set of attributes on the link. You have have up to 32 attributes per
194
+ # link.
195
+ class Link
196
+ # The relationship of the current span relative to the linked span: child,
197
+ # parent, or unspecified.
198
+ module Type
199
+ # The relationship of the two spans is unknown.
200
+ TYPE_UNSPECIFIED = 0
201
+
202
+ # The linked span is a child of the current span.
203
+ CHILD_LINKED_SPAN = 1
204
+
205
+ # The linked span is a parent of the current span.
206
+ PARENT_LINKED_SPAN = 2
207
+ end
208
+ end
209
+
210
+ # A collection of links, which are references from this span to a span
211
+ # in the same or different trace.
212
+ # @!attribute [rw] link
213
+ # @return [Array<Google::Devtools::Cloudtrace::V2::Span::Link>]
214
+ # A collection of links.
215
+ # @!attribute [rw] dropped_links_count
216
+ # @return [Integer]
217
+ # The number of dropped links after the maximum size was enforced. If
218
+ # this value is 0, then no links were dropped.
219
+ class Links; end
220
+ end
221
+
222
+ # The allowed types for [VALUE] in a +[KEY]:[VALUE]+ attribute.
223
+ # @!attribute [rw] string_value
224
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
225
+ # A string up to 256 bytes long.
226
+ # @!attribute [rw] int_value
227
+ # @return [Integer]
228
+ # A 64-bit signed integer.
229
+ # @!attribute [rw] bool_value
230
+ # @return [true, false]
231
+ # A Boolean value represented by +true+ or +false+.
232
+ class AttributeValue; end
233
+
234
+ # A call stack appearing in a trace.
235
+ # @!attribute [rw] stack_frames
236
+ # @return [Google::Devtools::Cloudtrace::V2::StackTrace::StackFrames]
237
+ # Stack frames in this stack trace. A maximum of 128 frames are allowed.
238
+ # @!attribute [rw] stack_trace_hash_id
239
+ # @return [Integer]
240
+ # The hash ID is used to conserve network bandwidth for duplicate
241
+ # stack traces within a single trace.
242
+ #
243
+ # Often multiple spans will have identical stack traces.
244
+ # The first occurrence of a stack trace should contain both the
245
+ # +stackFrame+ content and a value in +stackTraceHashId+.
246
+ #
247
+ # Subsequent spans within the same request can refer
248
+ # to that stack trace by only setting +stackTraceHashId+.
249
+ class StackTrace
250
+ # Represents a single stack frame in a stack trace.
251
+ # @!attribute [rw] function_name
252
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
253
+ # The fully-qualified name that uniquely identifies the function or
254
+ # method that is active in this frame (up to 1024 bytes).
255
+ # @!attribute [rw] original_function_name
256
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
257
+ # An un-mangled function name, if +function_name+ is
258
+ # [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
259
+ # be fully-qualified (up to 1024 bytes).
260
+ # @!attribute [rw] file_name
261
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
262
+ # The name of the source file where the function call appears (up to 256
263
+ # bytes).
264
+ # @!attribute [rw] line_number
265
+ # @return [Integer]
266
+ # The line number in +file_name+ where the function call appears.
267
+ # @!attribute [rw] column_number
268
+ # @return [Integer]
269
+ # The column number where the function call appears, if available.
270
+ # This is important in JavaScript because of its anonymous functions.
271
+ # @!attribute [rw] load_module
272
+ # @return [Google::Devtools::Cloudtrace::V2::Module]
273
+ # The binary module from where the code was loaded.
274
+ # @!attribute [rw] source_version
275
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
276
+ # The version of the deployed source code (up to 128 bytes).
277
+ class StackFrame; end
278
+
279
+ # A collection of stack frames, which can be truncated.
280
+ # @!attribute [rw] frame
281
+ # @return [Array<Google::Devtools::Cloudtrace::V2::StackTrace::StackFrame>]
282
+ # Stack frames in this call stack.
283
+ # @!attribute [rw] dropped_frames_count
284
+ # @return [Integer]
285
+ # The number of stack frames that were dropped because there
286
+ # were too many stack frames.
287
+ # If this value is 0, then no stack frames were dropped.
288
+ class StackFrames; end
289
+ end
290
+
291
+ # Binary module.
292
+ # @!attribute [rw] module
293
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
294
+ # For example: main binary, kernel modules, and dynamic libraries
295
+ # such as libc.so, sharedlib.so (up to 256 bytes).
296
+ # @!attribute [rw] build_id
297
+ # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
298
+ # A unique identifier for the module, usually a hash of its
299
+ # contents (up to 128 bytes).
300
+ class Module; end
301
+
302
+ # Represents a string that might be shortened to a specified length.
303
+ # @!attribute [rw] value
304
+ # @return [String]
305
+ # The shortened string. For example, if the original string is 500
306
+ # bytes long and the limit of the string is 128 bytes, then
307
+ # +value+ contains the first 128 bytes of the 500-byte string.
308
+ #
309
+ # Truncation always happens on a UTF8 character boundary. If there
310
+ # are multi-byte characters in the string, then the length of the
311
+ # shortened string might be less than the size limit.
312
+ # @!attribute [rw] truncated_byte_count
313
+ # @return [Integer]
314
+ # The number of bytes removed from the original string. If this
315
+ # value is 0, then the string was not shortened.
316
+ class TruncatableString; end
317
+ end
318
+ end
319
+ end
320
+ end
@@ -0,0 +1,124 @@
1
+ # Copyright 2017 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # +Any+ contains an arbitrary serialized protocol buffer message along with a
18
+ # URL that describes the type of the serialized message.
19
+ #
20
+ # Protobuf library provides support to pack/unpack Any values in the form
21
+ # of utility functions or additional generated methods of the Any type.
22
+ #
23
+ # Example 1: Pack and unpack a message in C++.
24
+ #
25
+ # Foo foo = ...;
26
+ # Any any;
27
+ # any.PackFrom(foo);
28
+ # ...
29
+ # if (any.UnpackTo(&foo)) {
30
+ # ...
31
+ # }
32
+ #
33
+ # Example 2: Pack and unpack a message in Java.
34
+ #
35
+ # Foo foo = ...;
36
+ # Any any = Any.pack(foo);
37
+ # ...
38
+ # if (any.is(Foo.class)) {
39
+ # foo = any.unpack(Foo.class);
40
+ # }
41
+ #
42
+ # Example 3: Pack and unpack a message in Python.
43
+ #
44
+ # foo = Foo(...)
45
+ # any = Any()
46
+ # any.Pack(foo)
47
+ # ...
48
+ # if any.Is(Foo.DESCRIPTOR):
49
+ # any.Unpack(foo)
50
+ # ...
51
+ #
52
+ # Example 4: Pack and unpack a message in Go
53
+ #
54
+ # foo := &pb.Foo{...}
55
+ # any, err := ptypes.MarshalAny(foo)
56
+ # ...
57
+ # foo := &pb.Foo{}
58
+ # if err := ptypes.UnmarshalAny(any, foo); err != nil {
59
+ # ...
60
+ # }
61
+ #
62
+ # The pack methods provided by protobuf library will by default use
63
+ # 'type.googleapis.com/full.type.name' as the type URL and the unpack
64
+ # methods only use the fully qualified type name after the last '/'
65
+ # in the type URL, for example "foo.bar.com/x/y.z" will yield type
66
+ # name "y.z".
67
+ #
68
+ #
69
+ # = JSON
70
+ #
71
+ # The JSON representation of an +Any+ value uses the regular
72
+ # representation of the deserialized, embedded message, with an
73
+ # additional field +@type+ which contains the type URL. Example:
74
+ #
75
+ # package google.profile;
76
+ # message Person {
77
+ # string first_name = 1;
78
+ # string last_name = 2;
79
+ # }
80
+ #
81
+ # {
82
+ # "@type": "type.googleapis.com/google.profile.Person",
83
+ # "firstName": <string>,
84
+ # "lastName": <string>
85
+ # }
86
+ #
87
+ # If the embedded message type is well-known and has a custom JSON
88
+ # representation, that representation will be embedded adding a field
89
+ # +value+ which holds the custom JSON in addition to the +@type+
90
+ # field. Example (for message {Google::Protobuf::Duration}):
91
+ #
92
+ # {
93
+ # "@type": "type.googleapis.com/google.protobuf.Duration",
94
+ # "value": "1.212s"
95
+ # }
96
+ # @!attribute [rw] type_url
97
+ # @return [String]
98
+ # A URL/resource name whose content describes the type of the
99
+ # serialized protocol buffer message.
100
+ #
101
+ # For URLs which use the scheme +http+, +https+, or no scheme, the
102
+ # following restrictions and interpretations apply:
103
+ #
104
+ # * If no scheme is provided, +https+ is assumed.
105
+ # * The last segment of the URL's path must represent the fully
106
+ # qualified name of the type (as in +path/google.protobuf.Duration+).
107
+ # The name should be in a canonical form (e.g., leading "." is
108
+ # not accepted).
109
+ # * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
110
+ # value in binary format, or produce an error.
111
+ # * Applications are allowed to cache lookup results based on the
112
+ # URL, or have them precompiled into a binary to avoid any
113
+ # lookup. Therefore, binary compatibility needs to be preserved
114
+ # on changes to types. (Use versioned type names to manage
115
+ # breaking changes.)
116
+ #
117
+ # Schemes other than +http+, +https+ (or the empty scheme) might be
118
+ # used with implementation specific semantics.
119
+ # @!attribute [rw] value
120
+ # @return [String]
121
+ # Must be a valid serialized protocol buffer of the above specified type.
122
+ class Any; end
123
+ end
124
+ end