google-cloud-error_reporting 0.27.0 → 0.28.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.
@@ -25,41 +25,22 @@ module Google
25
25
  # @private Represents the gRPC Error Reporting service, including all the
26
26
  # API methods.
27
27
  class Service
28
- attr_accessor :project, :credentials, :host, :timeout, :client_config
28
+ attr_accessor :project, :credentials, :timeout, :client_config
29
29
 
30
30
  ##
31
31
  # Creates a new Service instance.
32
- def initialize project, credentials,
33
- host: nil, timeout: nil, client_config: nil
32
+ def initialize project, credentials, timeout: nil, client_config: nil
34
33
  @project = project
35
34
  @credentials = credentials
36
- @host = host || V1beta1::ReportErrorsServiceClient::SERVICE_ADDRESS
37
35
  @timeout = timeout
38
36
  @client_config = client_config || {}
39
37
  end
40
38
 
41
- def channel
42
- require "grpc"
43
- GRPC::Core::Channel.new host, nil, chan_creds
44
- end
45
-
46
- def chan_creds
47
- require "grpc"
48
- return credentials if insecure?
49
- GRPC::Core::ChannelCredentials.new.compose \
50
- GRPC::Core::CallCredentials.new credentials.client.updater_proc
51
- end
52
-
53
- def insecure?
54
- credentials == :this_channel_is_insecure
55
- end
56
-
57
39
  def error_reporting
58
40
  return mocked_error_reporting if mocked_error_reporting
59
41
  @error_reporting ||= \
60
42
  V1beta1::ReportErrorsServiceClient.new(
61
- service_path: host,
62
- channel: channel,
43
+ credentials: credentials,
63
44
  timeout: timeout,
64
45
  client_config: client_config,
65
46
  lib_name: "gccl",
@@ -15,6 +15,21 @@
15
15
  module Google
16
16
  module Devtools
17
17
  module Clouderrorreporting
18
+ ##
19
+ # # Stackdriver Error Reporting API Contents
20
+ #
21
+ # | Class | Description |
22
+ # | ----- | ----------- |
23
+ # | [ErrorGroupServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
24
+ # | [ErrorStatsServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
25
+ # | [ReportErrorsServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
26
+ # | [Data Types][] | Data types for Google::Cloud::ErrorReporting::V1beta1 |
27
+ #
28
+ # [ErrorGroupServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/errorgroupserviceclient
29
+ # [ErrorStatsServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/errorstatsserviceclient
30
+ # [ReportErrorsServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/reporterrorsserviceclient
31
+ # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/datatypes
32
+ #
18
33
  module V1beta1
19
34
  # Specifies a set of +ErrorGroupStats+ to return.
20
35
  # @!attribute [rw] project_name
@@ -114,9 +129,9 @@ module Google
114
129
  # Approximate number of occurrences over time.
115
130
  # Timed counts returned by ListGroups are guaranteed to be:
116
131
  #
117
- # - Inside the requested time interval
118
- # - Non-overlapping, and
119
- # - Ordered by ascending time.
132
+ # * Inside the requested time interval
133
+ # * Non-overlapping, and
134
+ # * Ordered by ascending time.
120
135
  # @!attribute [rw] first_seen_time
121
136
  # @return [Google::Protobuf::Timestamp]
122
137
  # Approximate first occurrence that was ever seen for this group
@@ -164,8 +179,8 @@ module Google
164
179
  # @return [String]
165
180
  # [Required] The resource name of the Google Cloud Platform project. Written
166
181
  # as +projects/+ plus the
167
- # {Google Cloud Platform project
168
- # ID}[https://support.google.com/cloud/answer/6158840].
182
+ # [Google Cloud Platform project
183
+ # ID](https://support.google.com/cloud/answer/6158840).
169
184
  # Example: +projects/my-project-123+.
170
185
  # @!attribute [rw] group_id
171
186
  # @return [String]
@@ -242,15 +257,15 @@ module Google
242
257
  # @!attribute [rw] service
243
258
  # @return [String]
244
259
  # [Optional] The exact value to match against
245
- # {+ServiceContext.service+}[https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service].
260
+ # [+ServiceContext.service+](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).
246
261
  # @!attribute [rw] version
247
262
  # @return [String]
248
263
  # [Optional] The exact value to match against
249
- # {+ServiceContext.version+}[https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version].
264
+ # [+ServiceContext.version+](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).
250
265
  # @!attribute [rw] resource_type
251
266
  # @return [String]
252
267
  # [Optional] The exact value to match against
253
- # {+ServiceContext.resource_type+}[https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type].
268
+ # [+ServiceContext.resource_type+](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).
254
269
  class ServiceContextFilter; end
255
270
 
256
271
  # Deletes all events in the project.
@@ -258,8 +273,8 @@ module Google
258
273
  # @return [String]
259
274
  # [Required] The resource name of the Google Cloud Platform project. Written
260
275
  # as +projects/+ plus the
261
- # {Google Cloud Platform project
262
- # ID}[https://support.google.com/cloud/answer/6158840].
276
+ # [Google Cloud Platform project
277
+ # ID](https://support.google.com/cloud/answer/6158840).
263
278
  # Example: +projects/my-project-123+.
264
279
  class DeleteEventsRequest; end
265
280
 
@@ -15,13 +15,28 @@
15
15
  module Google
16
16
  module Devtools
17
17
  module Clouderrorreporting
18
+ ##
19
+ # # Stackdriver Error Reporting API Contents
20
+ #
21
+ # | Class | Description |
22
+ # | ----- | ----------- |
23
+ # | [ErrorGroupServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
24
+ # | [ErrorStatsServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
25
+ # | [ReportErrorsServiceClient][] | Stackdriver Error Reporting groups and counts similar errors from cloud services. The Stackdriver Error Reporting API provides a way to report new errors and read access to error groups and their associated errors. |
26
+ # | [Data Types][] | Data types for Google::Cloud::ErrorReporting::V1beta1 |
27
+ #
28
+ # [ErrorGroupServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/errorgroupserviceclient
29
+ # [ErrorStatsServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/errorstatsserviceclient
30
+ # [ReportErrorsServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/reporterrorsserviceclient
31
+ # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-error_reporting/latest/google/devtools/clouderrorreporting/v1beta1/datatypes
32
+ #
18
33
  module V1beta1
19
34
  # A request for reporting an individual error event.
20
35
  # @!attribute [rw] project_name
21
36
  # @return [String]
22
37
  # [Required] The resource name of the Google Cloud Platform project. Written
23
38
  # as +projects/+ plus the
24
- # {Google Cloud Platform project ID}[https://support.google.com/cloud/answer/6158840].
39
+ # [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840).
25
40
  # Example: +projects/my-project-123+.
26
41
  # @!attribute [rw] event
27
42
  # @return [Google::Devtools::Clouderrorreporting::V1beta1::ReportedErrorEvent]
@@ -21,6 +21,8 @@ module Google
21
21
  # two Timestamp values is a Duration and it can be added or subtracted
22
22
  # from a Timestamp. Range is approximately +-10,000 years.
23
23
  #
24
+ # = Examples
25
+ #
24
26
  # Example 1: Compute Duration from two Timestamps in pseudo code.
25
27
  #
26
28
  # Timestamp start = ...;
@@ -60,10 +62,21 @@ module Google
60
62
  # td = datetime.timedelta(days=3, minutes=10)
61
63
  # duration = Duration()
62
64
  # duration.FromTimedelta(td)
65
+ #
66
+ # = JSON Mapping
67
+ #
68
+ # In JSON format, the Duration type is encoded as a string rather than an
69
+ # object, where the string ends in the suffix "s" (indicating seconds) and
70
+ # is preceded by the number of seconds, with nanoseconds expressed as
71
+ # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
72
+ # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
73
+ # be expressed in JSON format as "3.000000001s", and 3 seconds and 1
74
+ # microsecond should be expressed in JSON format as "3.000001s".
63
75
  # @!attribute [rw] seconds
64
76
  # @return [Integer]
65
77
  # Signed seconds of the span of time. Must be from -315,576,000,000
66
- # to +315,576,000,000 inclusive.
78
+ # to +315,576,000,000 inclusive. Note: these bounds are computed from:
79
+ # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
67
80
  # @!attribute [rw] nanos
68
81
  # @return [Integer]
69
82
  # Signed fractions of a second at nanosecond resolution of the span
@@ -24,7 +24,9 @@ module Google
24
24
  # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
25
25
  # By restricting to that range, we ensure that we can convert to
26
26
  # and from RFC 3339 date strings.
27
- # See {https://www.ietf.org/rfc/rfc3339.txt}[https://www.ietf.org/rfc/rfc3339.txt].
27
+ # See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
28
+ #
29
+ # = Examples
28
30
  #
29
31
  # Example 1: Compute Timestamp from POSIX +time()+.
30
32
  #
@@ -65,6 +67,29 @@ module Google
65
67
  #
66
68
  # timestamp = Timestamp()
67
69
  # timestamp.GetCurrentTime()
70
+ #
71
+ # = JSON Mapping
72
+ #
73
+ # In JSON format, the Timestamp type is encoded as a string in the
74
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
75
+ # format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
76
+ # where {year} is always expressed using four digits while {month}, {day},
77
+ # {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
78
+ # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
79
+ # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
80
+ # is required, though only UTC (as indicated by "Z") is presently supported.
81
+ #
82
+ # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
83
+ # 01:30 UTC on January 15, 2017.
84
+ #
85
+ # In JavaScript, one can convert a Date object to this format using the
86
+ # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
87
+ # method. In Python, a standard +datetime.datetime+ object can be converted
88
+ # to this format using [+strftime+](https://docs.python.org/2/library/time.html#time.strftime)
89
+ # with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
90
+ # can use the Joda Time's [+ISODateTimeFormat.dateTime()+](
91
+ # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime())
92
+ # to obtain a formatter capable of generating timestamps in this format.
68
93
  # @!attribute [rw] seconds
69
94
  # @return [Integer]
70
95
  # Represents seconds of UTC time since Unix epoch
@@ -0,0 +1,82 @@
1
+ # Copyright 2017, Google Inc. All rights reserved.
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
+ # http://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 Cloud
17
+ # rubocop:disable LineLength
18
+
19
+ ##
20
+ # # Ruby Client for Stackdriver Error Reporting API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
21
+ #
22
+ # [Stackdriver Error Reporting API][Product Documentation]:
23
+ # Stackdriver Error Reporting groups and counts similar errors from cloud
24
+ # services. The Stackdriver Error Reporting API provides a way to report new
25
+ # errors and read access to error groups and their associated errors.
26
+ # - [Product Documentation][]
27
+ #
28
+ # ## Quick Start
29
+ # In order to use this library, you first need to go through the following
30
+ # steps:
31
+ #
32
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
33
+ # 2. [Enable the Stackdriver Error Reporting API.](https://console.cloud.google.com/apis/api/error-reporting)
34
+ # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
35
+ #
36
+ # ### Installation
37
+ # ```
38
+ # $ gem install google-cloud-error_reporting
39
+ # ```
40
+ #
41
+ # ### Preview
42
+ # #### ReportErrorsServiceClient
43
+ # ```rb
44
+ # require "google/cloud/error_reporting"
45
+ #
46
+ # report_errors_service_client = Google::Cloud::ErrorReporting::ReportErrors.new
47
+ # formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ReportErrorsServiceClient.project_path(project_id)
48
+ # message = "[MESSAGE]"
49
+ # service = "[SERVICE]"
50
+ # service_context = { service: service }
51
+ # file_path = "path/to/file.lang"
52
+ # line_number = 42
53
+ # function_name = "meaningOfLife"
54
+ # report_location = {
55
+ # file_path: file_path,
56
+ # line_number: line_number,
57
+ # function_name: function_name
58
+ # }
59
+ # context = { report_location: report_location }
60
+ # event = {
61
+ # message: message,
62
+ # service_context: service_context,
63
+ # context: context
64
+ # }
65
+ # response = report_errors_service_client.report_error_event(formatted_project_name, event)
66
+ # ```
67
+ #
68
+ # ### Next Steps
69
+ # - Read the [Stackdriver Error Reporting API Product documentation][Product Documentation]
70
+ # to learn more about the product and see How-to Guides.
71
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
72
+ # to see the full list of Cloud APIs that we cover.
73
+ #
74
+ # [Product Documentation]: https://cloud.google.com/error-reporting
75
+ #
76
+ #
77
+ module ErrorReporting
78
+ module V1beta1
79
+ end
80
+ end
81
+ end
82
+ end
@@ -28,6 +28,7 @@ require "pathname"
28
28
  require "google/gax"
29
29
 
30
30
  require "google/devtools/clouderrorreporting/v1beta1/error_group_service_pb"
31
+ require "google/cloud/error_reporting/credentials"
31
32
 
32
33
  module Google
33
34
  module Cloud
@@ -71,29 +72,24 @@ module Google
71
72
  )
72
73
  end
73
74
 
74
- # Parses the project from a group resource.
75
- # @param group_name [String]
76
- # @return [String]
77
- def self.match_project_from_group_name group_name
78
- GROUP_PATH_TEMPLATE.match(group_name)["project"]
79
- end
80
-
81
- # Parses the group from a group resource.
82
- # @param group_name [String]
83
- # @return [String]
84
- def self.match_group_from_group_name group_name
85
- GROUP_PATH_TEMPLATE.match(group_name)["group"]
86
- end
87
-
88
- # @param service_path [String]
89
- # The domain name of the API remote host.
90
- # @param port [Integer]
91
- # The port on which to connect to the remote host.
92
- # @param channel [Channel]
93
- # A Channel object through which to make calls.
94
- # @param chan_creds [Grpc::ChannelCredentials]
95
- # A ChannelCredentials for the setting up the RPC client.
96
- # @param client_config[Hash]
75
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
76
+ # Provides the means for authenticating requests made by the client. This parameter can
77
+ # be many types.
78
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
79
+ # authenticating requests made by this client.
80
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
81
+ # credentials for this client.
82
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
83
+ # credentials for this client.
84
+ # A `GRPC::Core::Channel` will be used to make calls through.
85
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
86
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
87
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
88
+ # metadata for requests, generally, to give OAuth credentials.
89
+ # @param scopes [Array<String>]
90
+ # The OAuth scopes for this service. This parameter is ignored if
91
+ # an updater_proc is supplied.
92
+ # @param client_config [Hash]
97
93
  # A Hash for call options for each method. See
98
94
  # Google::Gax#construct_settings for the structure of
99
95
  # this data. Falls back to the default config if not specified
@@ -105,11 +101,11 @@ module Google
105
101
  port: DEFAULT_SERVICE_PORT,
106
102
  channel: nil,
107
103
  chan_creds: nil,
104
+ updater_proc: nil,
105
+ credentials: nil,
108
106
  scopes: ALL_SCOPES,
109
107
  client_config: {},
110
108
  timeout: DEFAULT_TIMEOUT,
111
- app_name: nil,
112
- app_version: nil,
113
109
  lib_name: nil,
114
110
  lib_version: ""
115
111
  # These require statements are intentionally placed here to initialize
@@ -118,14 +114,38 @@ module Google
118
114
  require "google/gax/grpc"
119
115
  require "google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb"
120
116
 
117
+ if channel || chan_creds || updater_proc
118
+ warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
119
+ "on 2017/09/08"
120
+ credentials ||= channel
121
+ credentials ||= chan_creds
122
+ credentials ||= updater_proc
123
+ end
124
+ if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
125
+ warn "`service_path` and `port` parameters are deprecated and will be removed"
126
+ end
127
+
128
+ credentials ||= Google::Cloud::ErrorReporting::Credentials.default
121
129
 
122
- if app_name || app_version
123
- warn "`app_name` and `app_version` are no longer being used in the request headers."
130
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
131
+ updater_proc = Google::Cloud::ErrorReporting::Credentials.new(credentials).updater_proc
132
+ end
133
+ if credentials.is_a?(GRPC::Core::Channel)
134
+ channel = credentials
135
+ end
136
+ if credentials.is_a?(GRPC::Core::ChannelCredentials)
137
+ chan_creds = credentials
138
+ end
139
+ if credentials.is_a?(Proc)
140
+ updater_proc = credentials
141
+ end
142
+ if credentials.is_a?(Google::Auth::Credentials)
143
+ updater_proc = credentials.updater_proc
124
144
  end
125
145
 
126
146
  google_api_client = "gl-ruby/#{RUBY_VERSION}"
127
147
  google_api_client << " #{lib_name}/#{lib_version}" if lib_name
128
- google_api_client << " gapic/0.6.8 gax/#{Google::Gax::VERSION}"
148
+ google_api_client << " gapic/0.1.0 gax/#{Google::Gax::VERSION}"
129
149
  google_api_client << " grpc/#{GRPC::VERSION}"
130
150
  google_api_client.freeze
131
151
 
@@ -149,6 +169,7 @@ module Google
149
169
  port,
150
170
  chan_creds: chan_creds,
151
171
  channel: channel,
172
+ updater_proc: updater_proc,
152
173
  scopes: scopes,
153
174
  &Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupService::Stub.method(:new)
154
175
  )
@@ -182,49 +203,48 @@ module Google
182
203
  # @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
183
204
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
184
205
  # @example
185
- # require "google/cloud/error_reporting/v1beta1/error_group_service_client"
206
+ # require "google/cloud/error_reporting/v1beta1"
186
207
  #
187
- # ErrorGroupServiceClient = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceClient
188
- #
189
- # error_group_service_client = ErrorGroupServiceClient.new
190
- # formatted_group_name = ErrorGroupServiceClient.group_path("[PROJECT]", "[GROUP]")
208
+ # error_group_service_client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroup.new
209
+ # formatted_group_name = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceClient.group_path("[PROJECT]", "[GROUP]")
191
210
  # response = error_group_service_client.get_group(formatted_group_name)
192
211
 
193
212
  def get_group \
194
213
  group_name,
195
214
  options: nil
196
- req = Google::Devtools::Clouderrorreporting::V1beta1::GetGroupRequest.new({
215
+ req = {
197
216
  group_name: group_name
198
- }.delete_if { |_, v| v.nil? })
217
+ }.delete_if { |_, v| v.nil? }
218
+ req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::GetGroupRequest)
199
219
  @get_group.call(req, options)
200
220
  end
201
221
 
202
222
  # Replace the data for the specified group.
203
223
  # Fails if the group does not exist.
204
224
  #
205
- # @param group [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
225
+ # @param group [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup | Hash]
206
226
  # [Required] The group which replaces the resource on the server.
227
+ # A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup`
228
+ # can also be provided.
207
229
  # @param options [Google::Gax::CallOptions]
208
230
  # Overrides the default settings for this call, e.g, timeout,
209
231
  # retries, etc.
210
232
  # @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
211
233
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
212
234
  # @example
213
- # require "google/cloud/error_reporting/v1beta1/error_group_service_client"
214
- #
215
- # ErrorGroup = Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup
216
- # ErrorGroupServiceClient = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceClient
235
+ # require "google/cloud/error_reporting/v1beta1"
217
236
  #
218
- # error_group_service_client = ErrorGroupServiceClient.new
219
- # group = ErrorGroup.new
237
+ # error_group_service_client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroup.new
238
+ # group = {}
220
239
  # response = error_group_service_client.update_group(group)
221
240
 
222
241
  def update_group \
223
242
  group,
224
243
  options: nil
225
- req = Google::Devtools::Clouderrorreporting::V1beta1::UpdateGroupRequest.new({
244
+ req = {
226
245
  group: group
227
- }.delete_if { |_, v| v.nil? })
246
+ }.delete_if { |_, v| v.nil? }
247
+ req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::UpdateGroupRequest)
228
248
  @update_group.call(req, options)
229
249
  end
230
250
  end