google-cloud-dialogflow 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/AUTHENTICATION.md +199 -0
  4. data/README.md +2 -2
  5. data/lib/google/cloud/dialogflow.rb +21 -14
  6. data/lib/google/cloud/dialogflow/v2.rb +21 -14
  7. data/lib/google/cloud/dialogflow/v2/agent_pb.rb +1 -0
  8. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +14 -14
  9. data/lib/google/cloud/dialogflow/v2/agents_client.rb +56 -36
  10. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +51 -0
  11. data/lib/google/cloud/dialogflow/v2/context_pb.rb +1 -0
  12. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +7 -3
  13. data/lib/google/cloud/dialogflow/v2/contexts_client.rb +48 -26
  14. data/lib/google/cloud/dialogflow/v2/credentials.rb +3 -2
  15. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +31 -26
  16. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +120 -0
  17. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +8 -4
  18. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +74 -56
  19. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +78 -44
  20. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +111 -37
  21. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +11 -5
  22. data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +2 -44
  23. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +3 -2
  24. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb +1 -1
  25. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +19 -27
  26. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +1 -1
  27. data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +18 -15
  28. data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +1 -35
  29. data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +1 -0
  30. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +12 -14
  31. data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +104 -69
  32. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  33. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +6 -4
  34. data/lib/google/cloud/dialogflow/v2/intents_client.rb +73 -45
  35. data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +1 -0
  36. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -2
  37. data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +28 -8
  38. data/lib/google/cloud/dialogflow/v2/session_pb.rb +23 -0
  39. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +2 -1
  40. data/lib/google/cloud/dialogflow/v2/sessions_client.rb +15 -3
  41. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +2 -1
  42. metadata +28 -6
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -29,6 +29,9 @@ module Google
29
29
  # Required. The unique identifier of this session entity type. Format:
30
30
  # `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
31
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.
32
35
  # @!attribute [rw] entity_override_mode
33
36
  # @return [Google::Cloud::Dialogflow::V2::SessionEntityType::EntityOverrideMode]
34
37
  # Required. Indicates whether the additional data should override or
@@ -49,10 +52,13 @@ module Google
49
52
 
50
53
  # The collection of session entities extends the collection of entities in
51
54
  # the corresponding developer entity type.
52
- # Calls to `ListSessionEntityTypes`, `GetSessionEntityType`,
53
- # `CreateSessionEntityType` and `UpdateSessionEntityType` return the full
54
- # collection of entities from the developer entity type in the agent's
55
- # default language and the session 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 developer entity type
61
+ # and merge.
56
62
  ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2
57
63
  end
58
64
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ module Google
31
31
  # @!attribute [rw] done
32
32
  # @return [true, false]
33
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
34
+ # If `true`, the operation is completed, and either `error` or `response` is
35
35
  # available.
36
36
  # @!attribute [rw] error
37
37
  # @return [Google::Rpc::Status]
@@ -47,47 +47,5 @@ module Google
47
47
  # is `TakeSnapshot()`, the inferred response type is
48
48
  # `TakeSnapshotResponse`.
49
49
  class Operation; end
50
-
51
- # The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
52
- # @!attribute [rw] name
53
- # @return [String]
54
- # The name of the operation resource.
55
- class GetOperationRequest; end
56
-
57
- # The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
58
- # @!attribute [rw] name
59
- # @return [String]
60
- # The name of the operation collection.
61
- # @!attribute [rw] filter
62
- # @return [String]
63
- # The standard list filter.
64
- # @!attribute [rw] page_size
65
- # @return [Integer]
66
- # The standard list page size.
67
- # @!attribute [rw] page_token
68
- # @return [String]
69
- # The standard list page token.
70
- class ListOperationsRequest; end
71
-
72
- # The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
73
- # @!attribute [rw] operations
74
- # @return [Array<Google::Longrunning::Operation>]
75
- # A list of operations that matches the specified filter in the request.
76
- # @!attribute [rw] next_page_token
77
- # @return [String]
78
- # The standard List next-page token.
79
- class ListOperationsResponse; end
80
-
81
- # The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
82
- # @!attribute [rw] name
83
- # @return [String]
84
- # The name of the operation resource to be cancelled.
85
- class CancelOperationRequest; end
86
-
87
- # The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
88
- # @!attribute [rw] name
89
- # @return [String]
90
- # The name of the operation resource to be deleted.
91
- class DeleteOperationRequest; end
92
50
  end
93
51
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -97,7 +97,8 @@ module Google
97
97
  # @!attribute [rw] type_url
98
98
  # @return [String]
99
99
  # A URL/resource name that uniquely identifies the type of the serialized
100
- # protocol buffer message. The last segment of the URL's path must represent
100
+ # protocol buffer message. This string must contain at least
101
+ # one "/" character. The last segment of the URL's path must represent
101
102
  # the fully qualified name of the type (as in
102
103
  # `path/google.protobuf.Duration`). The name should be in a canonical form
103
104
  # (e.g., leading "." is not accepted).
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -83,57 +83,49 @@ module Google
83
83
  # describe the updated values, the API ignores the values of all
84
84
  # fields not covered by the mask.
85
85
  #
86
- # If a repeated field is specified for an update operation, the existing
87
- # repeated values in the target resource will be overwritten by the new values.
88
- # Note that a repeated field is only allowed in the last position of a `paths`
89
- # string.
86
+ # If a repeated field is specified for an update operation, new values will
87
+ # be appended to the existing repeated field in the target resource. Note that
88
+ # a repeated field is only allowed in the last position of a `paths` string.
90
89
  #
91
90
  # If a sub-message is specified in the last position of the field mask for an
92
- # update operation, then the existing sub-message in the target resource is
93
- # overwritten. Given the target message:
91
+ # update operation, then new value will be merged into the existing sub-message
92
+ # in the target resource.
93
+ #
94
+ # For example, given the target message:
94
95
  #
95
96
  # f {
96
97
  # b {
97
- # d : 1
98
- # x : 2
98
+ # d: 1
99
+ # x: 2
99
100
  # }
100
- # c : 1
101
+ # c: [1]
101
102
  # }
102
103
  #
103
104
  # And an update message:
104
105
  #
105
106
  # f {
106
107
  # b {
107
- # d : 10
108
+ # d: 10
108
109
  # }
110
+ # c: [2]
109
111
  # }
110
112
  #
111
113
  # then if the field mask is:
112
114
  #
113
- # paths: "f.b"
115
+ # paths: ["f.b", "f.c"]
114
116
  #
115
117
  # then the result will be:
116
118
  #
117
119
  # f {
118
120
  # b {
119
- # d : 10
121
+ # d: 10
122
+ # x: 2
120
123
  # }
121
- # c : 1
124
+ # c: [1, 2]
122
125
  # }
123
126
  #
124
- # However, if the update mask was:
125
- #
126
- # paths: "f.b.d"
127
- #
128
- # then the result would be:
129
- #
130
- # f {
131
- # b {
132
- # d : 10
133
- # x : 2
134
- # }
135
- # c : 1
136
- # }
127
+ # An implementation may provide options to override this default behavior for
128
+ # repeated and message fields.
137
129
  #
138
130
  # In order to reset a field's value to the default, the field must
139
131
  # be in the mask and set to the default value in the provided resource.
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -15,24 +15,25 @@
15
15
 
16
16
  module Google
17
17
  module Rpc
18
- # The `Status` type defines a logical error model that is suitable for different
19
- # programming environments, including REST APIs and RPC APIs. It is used by
20
- # [gRPC](https://github.com/grpc). The error model is designed to be:
18
+ # The `Status` type defines a logical error model that is suitable for
19
+ # different programming environments, including REST APIs and RPC APIs. It is
20
+ # used by [gRPC](https://github.com/grpc). The error model is designed to be:
21
21
  #
22
22
  # * Simple to use and understand for most users
23
23
  # * Flexible enough to meet unexpected needs
24
24
  #
25
25
  # = Overview
26
26
  #
27
- # The `Status` message contains three pieces of data: error code, error message,
28
- # and error details. The error code should be an enum value of
29
- # {Google::Rpc::Code}, but it may accept additional error codes if needed. The
30
- # error message should be a developer-facing English message that helps
31
- # developers *understand* and *resolve* the error. If a localized user-facing
32
- # error message is needed, put the localized message in the error details or
33
- # localize it in the client. The optional error details may contain arbitrary
34
- # information about the error. There is a predefined set of error detail types
35
- # in the package `google.rpc` that can be used for common error conditions.
27
+ # The `Status` message contains three pieces of data: error code, error
28
+ # message, and error details. The error code should be an enum value of
29
+ # {Google::Rpc::Code}, but it may accept additional error codes
30
+ # if needed. The error message should be a developer-facing English message
31
+ # that helps developers *understand* and *resolve* the error. If a localized
32
+ # user-facing error message is needed, put the localized message in the error
33
+ # details or localize it in the client. The optional error details may contain
34
+ # arbitrary information about the error. There is a predefined set of error
35
+ # detail types in the package `google.rpc` that can be used for common error
36
+ # conditions.
36
37
  #
37
38
  # = Language mapping
38
39
  #
@@ -69,12 +70,14 @@ module Google
69
70
  # be used directly after any stripping needed for security/privacy reasons.
70
71
  # @!attribute [rw] code
71
72
  # @return [Integer]
72
- # The status code, which should be an enum value of {Google::Rpc::Code}.
73
+ # The status code, which should be an enum value of
74
+ # {Google::Rpc::Code}.
73
75
  # @!attribute [rw] message
74
76
  # @return [String]
75
77
  # A developer-facing error message, which should be in English. Any
76
78
  # user-facing error message should be localized and sent in the
77
- # {Google::Rpc::Status#details} field, or localized by the client.
79
+ # {Google::Rpc::Status#details} field, or localized
80
+ # by the client.
78
81
  # @!attribute [rw] details
79
82
  # @return [Array<Google::Protobuf::Any>]
80
83
  # A list of messages that carry the error details. There is a common set of
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -20,40 +20,6 @@ module Google
20
20
  # specified otherwise, this must conform to the
21
21
  # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
22
22
  # standard</a>. Values must be within normalized ranges.
23
- #
24
- # Example of normalization code in Python:
25
- #
26
- # def NormalizeLongitude(longitude):
27
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
28
- # q, r = divmod(longitude, 360.0)
29
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
30
- # return r - 360.0
31
- # return r
32
- #
33
- # def NormalizeLatLng(latitude, longitude):
34
- # """Wraps decimal degrees latitude and longitude to
35
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
36
- # r = latitude % 360.0
37
- # if r <= 90.0:
38
- # return r, NormalizeLongitude(longitude)
39
- # elif r >= 270.0:
40
- # return r - 360, NormalizeLongitude(longitude)
41
- # else:
42
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
43
- #
44
- # assert 180.0 == NormalizeLongitude(180.0)
45
- # assert -180.0 == NormalizeLongitude(-180.0)
46
- # assert -179.0 == NormalizeLongitude(181.0)
47
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
48
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
49
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
50
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
51
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
52
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
53
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
54
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
55
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
56
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
57
23
  # @!attribute [rw] latitude
58
24
  # @return [Float]
59
25
  # The latitude in degrees. It must be in the range [-90.0, +90.0].
@@ -5,6 +5,7 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
+ require 'google/api/resource_pb'
8
9
  require 'google/longrunning/operations_pb'
9
10
  require 'google/protobuf/empty_pb'
10
11
  require 'google/protobuf/field_mask_pb'
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/dialogflow/v2/entity_type.proto for package 'google.cloud.dialogflow.v2'
3
3
  # Original file comments:
4
- # Copyright 2018 Google Inc.
4
+ # Copyright 2019 Google LLC.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
+ #
18
19
 
19
20
 
20
21
  require 'grpc'
@@ -51,7 +52,8 @@ module Google
51
52
  # represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
52
53
  #
53
54
  # For more information about entity types, see the
54
- # [Dialogflow documentation](https://dialogflow.com/docs/entities).
55
+ # [Dialogflow
56
+ # documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
55
57
  class Service
56
58
 
57
59
  include GRPC::GenericService
@@ -72,29 +74,25 @@ module Google
72
74
  rpc :DeleteEntityType, DeleteEntityTypeRequest, Google::Protobuf::Empty
73
75
  # Updates/Creates multiple entity types in the specified agent.
74
76
  #
75
- # Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse],
76
- # metadata: [google.protobuf.Struct][google.protobuf.Struct]>
77
+ # Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
77
78
  rpc :BatchUpdateEntityTypes, BatchUpdateEntityTypesRequest, Google::Longrunning::Operation
78
79
  # Deletes entity types in the specified agent.
79
80
  #
80
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
81
- # metadata: [google.protobuf.Struct][google.protobuf.Struct]>
81
+ # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
82
82
  rpc :BatchDeleteEntityTypes, BatchDeleteEntityTypesRequest, Google::Longrunning::Operation
83
- # Creates multiple new entities in the specified entity type (extends the
84
- # existing collection of entries).
83
+ # Creates multiple new entities in the specified entity type.
85
84
  #
86
85
  # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
87
86
  rpc :BatchCreateEntities, BatchCreateEntitiesRequest, Google::Longrunning::Operation
88
- # Updates entities in the specified entity type (replaces the existing
89
- # collection of entries).
87
+ # Updates or creates multiple entities in the specified entity type. This
88
+ # method does not affect entities in the entity type that aren't explicitly
89
+ # specified in the request.
90
90
  #
91
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
92
- # metadata: [google.protobuf.Struct][google.protobuf.Struct]>
91
+ # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
93
92
  rpc :BatchUpdateEntities, BatchUpdateEntitiesRequest, Google::Longrunning::Operation
94
93
  # Deletes entities in the specified entity type.
95
94
  #
96
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty],
97
- # metadata: [google.protobuf.Struct][google.protobuf.Struct]>
95
+ # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
98
96
  rpc :BatchDeleteEntities, BatchDeleteEntitiesRequest, Google::Longrunning::Operation
99
97
  end
100
98
 
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -60,7 +60,8 @@ module Google
60
60
  # represented by the {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
61
61
  #
62
62
  # For more information about entity types, see the
63
- # [Dialogflow documentation](https://dialogflow.com/docs/entities).
63
+ # [Dialogflow
64
+ # documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
64
65
  #
65
66
  # @!attribute [r] entity_types_stub
66
67
  # @return [Google::Cloud::Dialogflow::V2::EntityTypes::Stub]
@@ -91,7 +92,8 @@ module Google
91
92
  # The scopes needed to make gRPC calls to all of the methods defined in
92
93
  # this service.
93
94
  ALL_SCOPES = [
94
- "https://www.googleapis.com/auth/cloud-platform"
95
+ "https://www.googleapis.com/auth/cloud-platform",
96
+ "https://www.googleapis.com/auth/dialogflow"
95
97
  ].freeze
96
98
 
97
99
  # @private
@@ -100,26 +102,17 @@ module Google
100
102
  self::GRPC_INTERCEPTORS = EntityTypesClient::GRPC_INTERCEPTORS
101
103
  end
102
104
 
103
- PROJECT_AGENT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
104
- "projects/{project}/agent"
105
- )
106
-
107
- private_constant :PROJECT_AGENT_PATH_TEMPLATE
108
-
109
105
  ENTITY_TYPE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
110
106
  "projects/{project}/agent/entityTypes/{entity_type}"
111
107
  )
112
108
 
113
109
  private_constant :ENTITY_TYPE_PATH_TEMPLATE
114
110
 
115
- # Returns a fully-qualified project_agent resource name string.
116
- # @param project [String]
117
- # @return [String]
118
- def self.project_agent_path project
119
- PROJECT_AGENT_PATH_TEMPLATE.render(
120
- :"project" => project
121
- )
122
- end
111
+ PROJECT_AGENT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
112
+ "projects/{project}/agent"
113
+ )
114
+
115
+ private_constant :PROJECT_AGENT_PATH_TEMPLATE
123
116
 
124
117
  # Returns a fully-qualified entity_type resource name string.
125
118
  # @param project [String]
@@ -132,6 +125,15 @@ module Google
132
125
  )
133
126
  end
134
127
 
128
+ # Returns a fully-qualified project_agent resource name string.
129
+ # @param project [String]
130
+ # @return [String]
131
+ def self.project_agent_path project
132
+ PROJECT_AGENT_PATH_TEMPLATE.render(
133
+ :"project" => project
134
+ )
135
+ end
136
+
135
137
  # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
136
138
  # Provides the means for authenticating requests made by the client. This parameter can
137
139
  # be many types.
@@ -247,52 +249,82 @@ module Google
247
249
  @list_entity_types = Google::Gax.create_api_call(
248
250
  @entity_types_stub.method(:list_entity_types),
249
251
  defaults["list_entity_types"],
250
- exception_transformer: exception_transformer
252
+ exception_transformer: exception_transformer,
253
+ params_extractor: proc do |request|
254
+ {'parent' => request.parent}
255
+ end
251
256
  )
252
257
  @get_entity_type = Google::Gax.create_api_call(
253
258
  @entity_types_stub.method(:get_entity_type),
254
259
  defaults["get_entity_type"],
255
- exception_transformer: exception_transformer
260
+ exception_transformer: exception_transformer,
261
+ params_extractor: proc do |request|
262
+ {'name' => request.name}
263
+ end
256
264
  )
257
265
  @create_entity_type = Google::Gax.create_api_call(
258
266
  @entity_types_stub.method(:create_entity_type),
259
267
  defaults["create_entity_type"],
260
- exception_transformer: exception_transformer
268
+ exception_transformer: exception_transformer,
269
+ params_extractor: proc do |request|
270
+ {'parent' => request.parent}
271
+ end
261
272
  )
262
273
  @update_entity_type = Google::Gax.create_api_call(
263
274
  @entity_types_stub.method(:update_entity_type),
264
275
  defaults["update_entity_type"],
265
- exception_transformer: exception_transformer
276
+ exception_transformer: exception_transformer,
277
+ params_extractor: proc do |request|
278
+ {'entity_type.name' => request.entity_type.name}
279
+ end
266
280
  )
267
281
  @delete_entity_type = Google::Gax.create_api_call(
268
282
  @entity_types_stub.method(:delete_entity_type),
269
283
  defaults["delete_entity_type"],
270
- exception_transformer: exception_transformer
284
+ exception_transformer: exception_transformer,
285
+ params_extractor: proc do |request|
286
+ {'name' => request.name}
287
+ end
271
288
  )
272
289
  @batch_update_entity_types = Google::Gax.create_api_call(
273
290
  @entity_types_stub.method(:batch_update_entity_types),
274
291
  defaults["batch_update_entity_types"],
275
- exception_transformer: exception_transformer
292
+ exception_transformer: exception_transformer,
293
+ params_extractor: proc do |request|
294
+ {'parent' => request.parent}
295
+ end
276
296
  )
277
297
  @batch_delete_entity_types = Google::Gax.create_api_call(
278
298
  @entity_types_stub.method(:batch_delete_entity_types),
279
299
  defaults["batch_delete_entity_types"],
280
- exception_transformer: exception_transformer
300
+ exception_transformer: exception_transformer,
301
+ params_extractor: proc do |request|
302
+ {'parent' => request.parent}
303
+ end
281
304
  )
282
305
  @batch_create_entities = Google::Gax.create_api_call(
283
306
  @entity_types_stub.method(:batch_create_entities),
284
307
  defaults["batch_create_entities"],
285
- exception_transformer: exception_transformer
308
+ exception_transformer: exception_transformer,
309
+ params_extractor: proc do |request|
310
+ {'parent' => request.parent}
311
+ end
286
312
  )
287
313
  @batch_update_entities = Google::Gax.create_api_call(
288
314
  @entity_types_stub.method(:batch_update_entities),
289
315
  defaults["batch_update_entities"],
290
- exception_transformer: exception_transformer
316
+ exception_transformer: exception_transformer,
317
+ params_extractor: proc do |request|
318
+ {'parent' => request.parent}
319
+ end
291
320
  )
292
321
  @batch_delete_entities = Google::Gax.create_api_call(
293
322
  @entity_types_stub.method(:batch_delete_entities),
294
323
  defaults["batch_delete_entities"],
295
- exception_transformer: exception_transformer
324
+ exception_transformer: exception_transformer,
325
+ params_extractor: proc do |request|
326
+ {'parent' => request.parent}
327
+ end
296
328
  )
297
329
  end
298
330
 
@@ -306,9 +338,10 @@ module Google
306
338
  # @param language_code [String]
307
339
  # Optional. The language to list entity synonyms for. If not specified,
308
340
  # the agent's default language is used.
309
- # [More than a dozen
310
- # languages](https://dialogflow.com/docs/reference/language) are supported.
311
- # Note: languages must be enabled in the agent, before they can be used.
341
+ # [Many
342
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
343
+ # are supported. Note: languages must be enabled in the agent before they can
344
+ # be used.
312
345
  # @param page_size [Integer]
313
346
  # The maximum number of resources contained in the underlying API
314
347
  # response. If page streaming is performed per-resource, this
@@ -369,9 +402,10 @@ module Google
369
402
  # @param language_code [String]
370
403
  # Optional. The language to retrieve entity synonyms for. If not specified,
371
404
  # the agent's default language is used.
372
- # [More than a dozen
373
- # languages](https://dialogflow.com/docs/reference/language) are supported.
374
- # Note: languages must be enabled in the agent, before they can be used.
405
+ # [Many
406
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
407
+ # are supported. Note: languages must be enabled in the agent before they can
408
+ # be used.
375
409
  # @param options [Google::Gax::CallOptions]
376
410
  # Overrides the default settings for this call, e.g, timeout,
377
411
  # retries, etc.
@@ -412,9 +446,10 @@ module Google
412
446
  # @param language_code [String]
413
447
  # Optional. The language of entity synonyms defined in `entity_type`. If not
414
448
  # specified, the agent's default language is used.
415
- # [More than a dozen
416
- # languages](https://dialogflow.com/docs/reference/language) are supported.
417
- # Note: languages must be enabled in the agent, before they can be used.
449
+ # [Many
450
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
451
+ # are supported. Note: languages must be enabled in the agent before they can
452
+ # be used.
418
453
  # @param options [Google::Gax::CallOptions]
419
454
  # Overrides the default settings for this call, e.g, timeout,
420
455
  # retries, etc.
@@ -452,15 +487,15 @@ module Google
452
487
  #
453
488
  # @param entity_type [Google::Cloud::Dialogflow::V2::EntityType | Hash]
454
489
  # Required. The entity type to update.
455
- # Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
456
490
  # A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType`
457
491
  # can also be provided.
458
492
  # @param language_code [String]
459
493
  # Optional. The language of entity synonyms defined in `entity_type`. If not
460
494
  # specified, the agent's default language is used.
461
- # [More than a dozen
462
- # languages](https://dialogflow.com/docs/reference/language) are supported.
463
- # Note: languages must be enabled in the agent, before they can be used.
495
+ # [Many
496
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
497
+ # are supported. Note: languages must be enabled in the agent before they can
498
+ # be used.
464
499
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
465
500
  # Optional. The mask to control which fields get updated.
466
501
  # A hash of the same form as `Google::Protobuf::FieldMask`
@@ -530,8 +565,7 @@ module Google
530
565
 
531
566
  # Updates/Creates multiple entity types in the specified agent.
532
567
  #
533
- # Operation <response: {Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse},
534
- # metadata: {Google::Protobuf::Struct}>
568
+ # Operation <response: {Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}>
535
569
  #
536
570
  # @param parent [String]
537
571
  # Required. The name of the agent to update or create entity types in.
@@ -542,15 +576,16 @@ module Google
542
576
  # EntityBatch type) or a JSON object. Note: The URI must start with
543
577
  # "gs://".
544
578
  # @param entity_type_batch_inline [Google::Cloud::Dialogflow::V2::EntityTypeBatch | Hash]
545
- # The collection of entity type to update or create.
579
+ # The collection of entity types to update or create.
546
580
  # A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityTypeBatch`
547
581
  # can also be provided.
548
582
  # @param language_code [String]
549
583
  # Optional. The language of entity synonyms defined in `entity_types`. If not
550
584
  # specified, the agent's default language is used.
551
- # [More than a dozen
552
- # languages](https://dialogflow.com/docs/reference/language) are supported.
553
- # Note: languages must be enabled in the agent, before they can be used.
585
+ # [Many
586
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
587
+ # are supported. Note: languages must be enabled in the agent before they can
588
+ # be used.
554
589
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
555
590
  # Optional. The mask to control which fields get updated.
556
591
  # A hash of the same form as `Google::Protobuf::FieldMask`
@@ -621,8 +656,7 @@ module Google
621
656
 
622
657
  # Deletes entity types in the specified agent.
623
658
  #
624
- # Operation <response: {Google::Protobuf::Empty},
625
- # metadata: {Google::Protobuf::Struct}>
659
+ # Operation <response: {Google::Protobuf::Empty}>
626
660
  #
627
661
  # @param parent [String]
628
662
  # Required. The name of the agent to delete all entities types for. Format:
@@ -691,8 +725,7 @@ module Google
691
725
  operation
692
726
  end
693
727
 
694
- # Creates multiple new entities in the specified entity type (extends the
695
- # existing collection of entries).
728
+ # Creates multiple new entities in the specified entity type.
696
729
  #
697
730
  # Operation <response: {Google::Protobuf::Empty}>
698
731
  #
@@ -700,15 +733,16 @@ module Google
700
733
  # Required. The name of the entity type to create entities in. Format:
701
734
  # `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
702
735
  # @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
703
- # Required. The collection of entities to create.
736
+ # Required. The entities to create.
704
737
  # A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType::Entity`
705
738
  # can also be provided.
706
739
  # @param language_code [String]
707
740
  # Optional. The language of entity synonyms defined in `entities`. If not
708
741
  # specified, the agent's default language is used.
709
- # [More than a dozen
710
- # languages](https://dialogflow.com/docs/reference/language) are supported.
711
- # Note: languages must be enabled in the agent, before they can be used.
742
+ # [Many
743
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
744
+ # are supported. Note: languages must be enabled in the agent before they can
745
+ # be used.
712
746
  # @param options [Google::Gax::CallOptions]
713
747
  # Overrides the default settings for this call, e.g, timeout,
714
748
  # retries, etc.
@@ -772,25 +806,26 @@ module Google
772
806
  operation
773
807
  end
774
808
 
775
- # Updates entities in the specified entity type (replaces the existing
776
- # collection of entries).
809
+ # Updates or creates multiple entities in the specified entity type. This
810
+ # method does not affect entities in the entity type that aren't explicitly
811
+ # specified in the request.
777
812
  #
778
- # Operation <response: {Google::Protobuf::Empty},
779
- # metadata: {Google::Protobuf::Struct}>
813
+ # Operation <response: {Google::Protobuf::Empty}>
780
814
  #
781
815
  # @param parent [String]
782
- # Required. The name of the entity type to update the entities in. Format:
783
- # `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
816
+ # Required. The name of the entity type to update or create entities in.
817
+ # Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
784
818
  # @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
785
- # Required. The collection of new entities to replace the existing entities.
819
+ # Required. The entities to update or create.
786
820
  # A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType::Entity`
787
821
  # can also be provided.
788
822
  # @param language_code [String]
789
823
  # Optional. The language of entity synonyms defined in `entities`. If not
790
824
  # specified, the agent's default language is used.
791
- # [More than a dozen
792
- # languages](https://dialogflow.com/docs/reference/language) are supported.
793
- # Note: languages must be enabled in the agent, before they can be used.
825
+ # [Many
826
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
827
+ # are supported. Note: languages must be enabled in the agent before they can
828
+ # be used.
794
829
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
795
830
  # Optional. The mask to control which fields get updated.
796
831
  # A hash of the same form as `Google::Protobuf::FieldMask`
@@ -862,8 +897,7 @@ module Google
862
897
 
863
898
  # Deletes entities in the specified entity type.
864
899
  #
865
- # Operation <response: {Google::Protobuf::Empty},
866
- # metadata: {Google::Protobuf::Struct}>
900
+ # Operation <response: {Google::Protobuf::Empty}>
867
901
  #
868
902
  # @param parent [String]
869
903
  # Required. The name of the entity type to delete entries for. Format:
@@ -875,9 +909,10 @@ module Google
875
909
  # @param language_code [String]
876
910
  # Optional. The language of entity synonyms defined in `entities`. If not
877
911
  # specified, the agent's default language is used.
878
- # [More than a dozen
879
- # languages](https://dialogflow.com/docs/reference/language) are supported.
880
- # Note: languages must be enabled in the agent, before they can be used.
912
+ # [Many
913
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
914
+ # are supported. Note: languages must be enabled in the agent before they can
915
+ # be used.
881
916
  # @param options [Google::Gax::CallOptions]
882
917
  # Overrides the default settings for this call, e.g, timeout,
883
918
  # retries, etc.