google-cloud-dialogflow 0.15.0 → 1.0.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 +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +397 -0
- data/README.md +35 -25
- data/lib/{google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb → google-cloud-dialogflow.rb} +4 -14
- data/lib/google/cloud/dialogflow.rb +368 -506
- data/lib/google/cloud/dialogflow/version.rb +1 -1
- metadata +88 -83
- data/LICENSE +0 -201
- data/lib/google/cloud/dialogflow/v2.rb +0 -598
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +0 -121
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +0 -111
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +0 -810
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +0 -71
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +0 -96
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +0 -63
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +0 -75
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +0 -522
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +0 -56
- data/lib/google/cloud/dialogflow/v2/credentials.rb +0 -42
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +0 -247
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +0 -341
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +0 -116
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +0 -305
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +0 -937
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +0 -498
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +0 -130
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/validation_result.rb +0 -71
- data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +0 -31
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +0 -125
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +0 -105
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +0 -997
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +0 -76
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +0 -367
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +0 -763
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +0 -61
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +0 -65
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +0 -507
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +0 -51
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +0 -141
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +0 -56
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +0 -340
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +0 -36
- data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +0 -36
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +0 -46
@@ -1,130 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Cloud
|
18
|
-
module Dialogflow
|
19
|
-
module V2
|
20
|
-
# Represents a session entity type.
|
21
|
-
#
|
22
|
-
# Extends or replaces a custom entity type at the user session level (we
|
23
|
-
# refer to the entity types defined at the agent level as "custom entity
|
24
|
-
# types").
|
25
|
-
#
|
26
|
-
# Note: session entity types apply to all queries, regardless of the language.
|
27
|
-
# @!attribute [rw] name
|
28
|
-
# @return [String]
|
29
|
-
# Required. The unique identifier of this session entity type. Format:
|
30
|
-
# `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
|
31
|
-
# Display Name>`.
|
32
|
-
#
|
33
|
-
# `<Entity Type Display Name>` must be the display name of an existing entity
|
34
|
-
# type in the same agent that will be overridden or supplemented.
|
35
|
-
# @!attribute [rw] entity_override_mode
|
36
|
-
# @return [Google::Cloud::Dialogflow::V2::SessionEntityType::EntityOverrideMode]
|
37
|
-
# Required. Indicates whether the additional data should override or
|
38
|
-
# supplement the custom entity type definition.
|
39
|
-
# @!attribute [rw] entities
|
40
|
-
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity>]
|
41
|
-
# Required. The collection of entities associated with this session entity
|
42
|
-
# type.
|
43
|
-
class SessionEntityType
|
44
|
-
# The types of modifications for a session entity type.
|
45
|
-
module EntityOverrideMode
|
46
|
-
# Not specified. This value should be never used.
|
47
|
-
ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0
|
48
|
-
|
49
|
-
# The collection of session entities overrides the collection of entities
|
50
|
-
# in the corresponding custom entity type.
|
51
|
-
ENTITY_OVERRIDE_MODE_OVERRIDE = 1
|
52
|
-
|
53
|
-
# The collection of session entities extends the collection of entities in
|
54
|
-
# the corresponding custom entity type.
|
55
|
-
#
|
56
|
-
# Note: Even in this override mode calls to `ListSessionEntityTypes`,
|
57
|
-
# `GetSessionEntityType`, `CreateSessionEntityType` and
|
58
|
-
# `UpdateSessionEntityType` only return the additional entities added in
|
59
|
-
# this session entity type. If you want to get the supplemented list,
|
60
|
-
# please call {Google::Cloud::Dialogflow::V2::EntityTypes::GetEntityType EntityTypes::GetEntityType} on the custom entity type
|
61
|
-
# and merge.
|
62
|
-
ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# The request message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::ListSessionEntityTypes SessionEntityTypes::ListSessionEntityTypes}.
|
67
|
-
# @!attribute [rw] parent
|
68
|
-
# @return [String]
|
69
|
-
# Required. The session to list all session entity types from.
|
70
|
-
# Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
|
71
|
-
# @!attribute [rw] page_size
|
72
|
-
# @return [Integer]
|
73
|
-
# Optional. The maximum number of items to return in a single page. By
|
74
|
-
# default 100 and at most 1000.
|
75
|
-
# @!attribute [rw] page_token
|
76
|
-
# @return [String]
|
77
|
-
# Optional. The next_page_token value returned from a previous list request.
|
78
|
-
class ListSessionEntityTypesRequest; end
|
79
|
-
|
80
|
-
# The response message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::ListSessionEntityTypes SessionEntityTypes::ListSessionEntityTypes}.
|
81
|
-
# @!attribute [rw] session_entity_types
|
82
|
-
# @return [Array<Google::Cloud::Dialogflow::V2::SessionEntityType>]
|
83
|
-
# The list of session entity types. There will be a maximum number of items
|
84
|
-
# returned based on the page_size field in the request.
|
85
|
-
# @!attribute [rw] next_page_token
|
86
|
-
# @return [String]
|
87
|
-
# Token to retrieve the next page of results, or empty if there are no
|
88
|
-
# more results in the list.
|
89
|
-
class ListSessionEntityTypesResponse; end
|
90
|
-
|
91
|
-
# The request message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::GetSessionEntityType SessionEntityTypes::GetSessionEntityType}.
|
92
|
-
# @!attribute [rw] name
|
93
|
-
# @return [String]
|
94
|
-
# Required. The name of the session entity type. Format:
|
95
|
-
# `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
|
96
|
-
# Display Name>`.
|
97
|
-
class GetSessionEntityTypeRequest; end
|
98
|
-
|
99
|
-
# The request message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::CreateSessionEntityType SessionEntityTypes::CreateSessionEntityType}.
|
100
|
-
# @!attribute [rw] parent
|
101
|
-
# @return [String]
|
102
|
-
# Required. The session to create a session entity type for.
|
103
|
-
# Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
|
104
|
-
# @!attribute [rw] session_entity_type
|
105
|
-
# @return [Google::Cloud::Dialogflow::V2::SessionEntityType]
|
106
|
-
# Required. The session entity type to create.
|
107
|
-
class CreateSessionEntityTypeRequest; end
|
108
|
-
|
109
|
-
# The request message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::UpdateSessionEntityType SessionEntityTypes::UpdateSessionEntityType}.
|
110
|
-
# @!attribute [rw] session_entity_type
|
111
|
-
# @return [Google::Cloud::Dialogflow::V2::SessionEntityType]
|
112
|
-
# Required. The entity type to update. Format:
|
113
|
-
# `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
|
114
|
-
# Display Name>`.
|
115
|
-
# @!attribute [rw] update_mask
|
116
|
-
# @return [Google::Protobuf::FieldMask]
|
117
|
-
# Optional. The mask to control which fields get updated.
|
118
|
-
class UpdateSessionEntityTypeRequest; end
|
119
|
-
|
120
|
-
# The request message for {Google::Cloud::Dialogflow::V2::SessionEntityTypes::DeleteSessionEntityType SessionEntityTypes::DeleteSessionEntityType}.
|
121
|
-
# @!attribute [rw] name
|
122
|
-
# @return [String]
|
123
|
-
# Required. The name of the entity type to delete. Format:
|
124
|
-
# `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
|
125
|
-
# Display Name>`.
|
126
|
-
class DeleteSessionEntityTypeRequest; end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Cloud
|
18
|
-
module Dialogflow
|
19
|
-
module V2
|
20
|
-
# Represents a single validation error.
|
21
|
-
# @!attribute [rw] severity
|
22
|
-
# @return [Google::Cloud::Dialogflow::V2::ValidationError::Severity]
|
23
|
-
# The severity of the error.
|
24
|
-
# @!attribute [rw] entries
|
25
|
-
# @return [Array<String>]
|
26
|
-
# The names of the entries that the error is associated with.
|
27
|
-
# Format:
|
28
|
-
#
|
29
|
-
# * "projects/<Project ID>/agent", if the error is associated with the entire
|
30
|
-
# agent.
|
31
|
-
# * "projects/<Project ID>/agent/intents/<Intent ID>", if the error is
|
32
|
-
# associated with certain intents.
|
33
|
-
# * "projects/<Project
|
34
|
-
# ID>/agent/intents/<Intent Id>/trainingPhrases/<Training Phrase ID>", if the
|
35
|
-
# error is associated with certain intent training phrases.
|
36
|
-
# * "projects/<Project ID>/agent/intents/<Intent Id>/parameters/<Parameter
|
37
|
-
# ID>", if the error is associated with certain intent parameters.
|
38
|
-
# * "projects/<Project ID>/agent/entities/<Entity ID>", if the error is
|
39
|
-
# associated with certain entities.
|
40
|
-
# @!attribute [rw] error_message
|
41
|
-
# @return [String]
|
42
|
-
# The detailed error messsage.
|
43
|
-
class ValidationError
|
44
|
-
# Represents a level of severity.
|
45
|
-
module Severity
|
46
|
-
# Not specified. This value should never be used.
|
47
|
-
SEVERITY_UNSPECIFIED = 0
|
48
|
-
|
49
|
-
# The agent doesn't follow Dialogflow best practicies.
|
50
|
-
INFO = 1
|
51
|
-
|
52
|
-
# The agent may not behave as expected.
|
53
|
-
WARNING = 2
|
54
|
-
|
55
|
-
# The agent may experience partial failures.
|
56
|
-
ERROR = 3
|
57
|
-
|
58
|
-
# The agent may completely fail.
|
59
|
-
CRITICAL = 4
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# Represents the output of agent validation.
|
64
|
-
# @!attribute [rw] validation_errors
|
65
|
-
# @return [Array<Google::Cloud::Dialogflow::V2::ValidationError>]
|
66
|
-
# Contains all validation errors.
|
67
|
-
class ValidationResult; end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Longrunning
|
18
|
-
# This resource represents a long-running operation that is the result of a
|
19
|
-
# network API call.
|
20
|
-
# @!attribute [rw] name
|
21
|
-
# @return [String]
|
22
|
-
# The server-assigned name, which is only unique within the same service that
|
23
|
-
# originally returns it. If you use the default HTTP mapping, the
|
24
|
-
# `name` should be a resource name ending with `operations/{unique_id}`.
|
25
|
-
# @!attribute [rw] metadata
|
26
|
-
# @return [Google::Protobuf::Any]
|
27
|
-
# Service-specific metadata associated with the operation. It typically
|
28
|
-
# contains progress information and common metadata such as create time.
|
29
|
-
# Some services might not provide such metadata. Any method that returns a
|
30
|
-
# long-running operation should document the metadata type, if any.
|
31
|
-
# @!attribute [rw] done
|
32
|
-
# @return [true, false]
|
33
|
-
# If the value is `false`, it means the operation is still in progress.
|
34
|
-
# If `true`, the operation is completed, and either `error` or `response` is
|
35
|
-
# available.
|
36
|
-
# @!attribute [rw] error
|
37
|
-
# @return [Google::Rpc::Status]
|
38
|
-
# The error result of the operation in case of failure or cancellation.
|
39
|
-
# @!attribute [rw] response
|
40
|
-
# @return [Google::Protobuf::Any]
|
41
|
-
# The normal response of the operation in case of success. If the original
|
42
|
-
# method returns no data on success, such as `Delete`, the response is
|
43
|
-
# `google.protobuf.Empty`. If the original method is standard
|
44
|
-
# `Get`/`Create`/`Update`, the response should be the resource. For other
|
45
|
-
# methods, the response should have the type `XxxResponse`, where `Xxx`
|
46
|
-
# is the original method name. For example, if the original method name
|
47
|
-
# is `TakeSnapshot()`, the inferred response type is
|
48
|
-
# `TakeSnapshotResponse`.
|
49
|
-
class Operation; end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Protobuf
|
18
|
-
# `Any` contains an arbitrary serialized protocol buffer message along with a
|
19
|
-
# URL that describes the type of the serialized message.
|
20
|
-
#
|
21
|
-
# Protobuf library provides support to pack/unpack Any values in the form
|
22
|
-
# of utility functions or additional generated methods of the Any type.
|
23
|
-
#
|
24
|
-
# Example 1: Pack and unpack a message in C++.
|
25
|
-
#
|
26
|
-
# Foo foo = ...;
|
27
|
-
# Any any;
|
28
|
-
# any.PackFrom(foo);
|
29
|
-
# ...
|
30
|
-
# if (any.UnpackTo(&foo)) {
|
31
|
-
# ...
|
32
|
-
# }
|
33
|
-
#
|
34
|
-
# Example 2: Pack and unpack a message in Java.
|
35
|
-
#
|
36
|
-
# Foo foo = ...;
|
37
|
-
# Any any = Any.pack(foo);
|
38
|
-
# ...
|
39
|
-
# if (any.is(Foo.class)) {
|
40
|
-
# foo = any.unpack(Foo.class);
|
41
|
-
# }
|
42
|
-
#
|
43
|
-
# Example 3: Pack and unpack a message in Python.
|
44
|
-
#
|
45
|
-
# foo = Foo(...)
|
46
|
-
# any = Any()
|
47
|
-
# any.Pack(foo)
|
48
|
-
# ...
|
49
|
-
# if any.Is(Foo.DESCRIPTOR):
|
50
|
-
# any.Unpack(foo)
|
51
|
-
# ...
|
52
|
-
#
|
53
|
-
# Example 4: Pack and unpack a message in Go
|
54
|
-
#
|
55
|
-
# foo := &pb.Foo{...}
|
56
|
-
# any, err := ptypes.MarshalAny(foo)
|
57
|
-
# ...
|
58
|
-
# foo := &pb.Foo{}
|
59
|
-
# if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
60
|
-
# ...
|
61
|
-
# }
|
62
|
-
#
|
63
|
-
# The pack methods provided by protobuf library will by default use
|
64
|
-
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
65
|
-
# methods only use the fully qualified type name after the last '/'
|
66
|
-
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
67
|
-
# name "y.z".
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# = JSON
|
71
|
-
#
|
72
|
-
# The JSON representation of an `Any` value uses the regular
|
73
|
-
# representation of the deserialized, embedded message, with an
|
74
|
-
# additional field `@type` which contains the type URL. Example:
|
75
|
-
#
|
76
|
-
# package google.profile;
|
77
|
-
# message Person {
|
78
|
-
# string first_name = 1;
|
79
|
-
# string last_name = 2;
|
80
|
-
# }
|
81
|
-
#
|
82
|
-
# {
|
83
|
-
# "@type": "type.googleapis.com/google.profile.Person",
|
84
|
-
# "firstName": <string>,
|
85
|
-
# "lastName": <string>
|
86
|
-
# }
|
87
|
-
#
|
88
|
-
# If the embedded message type is well-known and has a custom JSON
|
89
|
-
# representation, that representation will be embedded adding a field
|
90
|
-
# `value` which holds the custom JSON in addition to the `@type`
|
91
|
-
# field. Example (for message {Google::Protobuf::Duration}):
|
92
|
-
#
|
93
|
-
# {
|
94
|
-
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
95
|
-
# "value": "1.212s"
|
96
|
-
# }
|
97
|
-
# @!attribute [rw] type_url
|
98
|
-
# @return [String]
|
99
|
-
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
-
# protocol buffer message. This string must contain at least
|
101
|
-
# one "/" character. The last segment of the URL's path must represent
|
102
|
-
# the fully qualified name of the type (as in
|
103
|
-
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
104
|
-
# (e.g., leading "." is not accepted).
|
105
|
-
#
|
106
|
-
# In practice, teams usually precompile into the binary all types that they
|
107
|
-
# expect it to use in the context of Any. However, for URLs which use the
|
108
|
-
# scheme `http`, `https`, or no scheme, one can optionally set up a type
|
109
|
-
# server that maps type URLs to message definitions as follows:
|
110
|
-
#
|
111
|
-
# * If no scheme is provided, `https` is assumed.
|
112
|
-
# * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
|
113
|
-
# value in binary format, or produce an error.
|
114
|
-
# * Applications are allowed to cache lookup results based on the
|
115
|
-
# URL, or have them precompiled into a binary to avoid any
|
116
|
-
# lookup. Therefore, binary compatibility needs to be preserved
|
117
|
-
# on changes to types. (Use versioned type names to manage
|
118
|
-
# breaking changes.)
|
119
|
-
#
|
120
|
-
# Note: this functionality is not currently available in the official
|
121
|
-
# protobuf release, and it is not used for type URLs beginning with
|
122
|
-
# type.googleapis.com.
|
123
|
-
#
|
124
|
-
# Schemes other than `http`, `https` (or the empty scheme) might be
|
125
|
-
# used with implementation specific semantics.
|
126
|
-
# @!attribute [rw] value
|
127
|
-
# @return [String]
|
128
|
-
# Must be a valid serialized protocol buffer of the above specified type.
|
129
|
-
class Any; end
|
130
|
-
end
|
131
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Protobuf
|
18
|
-
# A Duration represents a signed, fixed-length span of time represented
|
19
|
-
# as a count of seconds and fractions of seconds at nanosecond
|
20
|
-
# resolution. It is independent of any calendar and concepts like "day"
|
21
|
-
# or "month". It is related to Timestamp in that the difference between
|
22
|
-
# two Timestamp values is a Duration and it can be added or subtracted
|
23
|
-
# from a Timestamp. Range is approximately +-10,000 years.
|
24
|
-
#
|
25
|
-
# = Examples
|
26
|
-
#
|
27
|
-
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
28
|
-
#
|
29
|
-
# Timestamp start = ...;
|
30
|
-
# Timestamp end = ...;
|
31
|
-
# Duration duration = ...;
|
32
|
-
#
|
33
|
-
# duration.seconds = end.seconds - start.seconds;
|
34
|
-
# duration.nanos = end.nanos - start.nanos;
|
35
|
-
#
|
36
|
-
# if (duration.seconds < 0 && duration.nanos > 0) {
|
37
|
-
# duration.seconds += 1;
|
38
|
-
# duration.nanos -= 1000000000;
|
39
|
-
# } else if (durations.seconds > 0 && duration.nanos < 0) {
|
40
|
-
# duration.seconds -= 1;
|
41
|
-
# duration.nanos += 1000000000;
|
42
|
-
# }
|
43
|
-
#
|
44
|
-
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
45
|
-
#
|
46
|
-
# Timestamp start = ...;
|
47
|
-
# Duration duration = ...;
|
48
|
-
# Timestamp end = ...;
|
49
|
-
#
|
50
|
-
# end.seconds = start.seconds + duration.seconds;
|
51
|
-
# end.nanos = start.nanos + duration.nanos;
|
52
|
-
#
|
53
|
-
# if (end.nanos < 0) {
|
54
|
-
# end.seconds -= 1;
|
55
|
-
# end.nanos += 1000000000;
|
56
|
-
# } else if (end.nanos >= 1000000000) {
|
57
|
-
# end.seconds += 1;
|
58
|
-
# end.nanos -= 1000000000;
|
59
|
-
# }
|
60
|
-
#
|
61
|
-
# Example 3: Compute Duration from datetime.timedelta in Python.
|
62
|
-
#
|
63
|
-
# td = datetime.timedelta(days=3, minutes=10)
|
64
|
-
# duration = Duration()
|
65
|
-
# duration.FromTimedelta(td)
|
66
|
-
#
|
67
|
-
# = JSON Mapping
|
68
|
-
#
|
69
|
-
# In JSON format, the Duration type is encoded as a string rather than an
|
70
|
-
# object, where the string ends in the suffix "s" (indicating seconds) and
|
71
|
-
# is preceded by the number of seconds, with nanoseconds expressed as
|
72
|
-
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
73
|
-
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
74
|
-
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
75
|
-
# microsecond should be expressed in JSON format as "3.000001s".
|
76
|
-
# @!attribute [rw] seconds
|
77
|
-
# @return [Integer]
|
78
|
-
# Signed seconds of the span of time. Must be from -315,576,000,000
|
79
|
-
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
80
|
-
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
81
|
-
# @!attribute [rw] nanos
|
82
|
-
# @return [Integer]
|
83
|
-
# Signed fractions of a second at nanosecond resolution of the span
|
84
|
-
# of time. Durations less than one second are represented with a 0
|
85
|
-
# `seconds` field and a positive or negative `nanos` field. For durations
|
86
|
-
# of one second or more, a non-zero value for the `nanos` field must be
|
87
|
-
# of the same sign as the `seconds` field. Must be from -999,999,999
|
88
|
-
# to +999,999,999 inclusive.
|
89
|
-
class Duration; end
|
90
|
-
end
|
91
|
-
end
|