google-cloud-error_reporting 0.35.2 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +23 -0
- data/lib/google-cloud-error_reporting.rb +7 -14
- data/lib/google/cloud/error_reporting.rb +16 -13
- data/lib/google/cloud/error_reporting/credentials.rb +2 -2
- data/lib/google/cloud/error_reporting/error_event.rb +14 -18
- data/lib/google/cloud/error_reporting/service.rb +12 -36
- data/lib/google/cloud/error_reporting/version.rb +1 -1
- metadata +7 -68
- data/lib/google/cloud/error_reporting/v1beta1.rb +0 -19
- data/lib/google/cloud/error_reporting/v1beta1/credentials.rb +0 -41
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/common.rb +0 -158
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb +0 -39
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb +0 -314
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb +0 -79
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client.rb +0 -283
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json +0 -36
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client.rb +0 -457
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json +0 -41
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client.rb +0 -254
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client_config.json +0 -31
- data/lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb +0 -64
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb +0 -30
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb +0 -50
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb +0 -116
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb +0 -52
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb +0 -38
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb +0 -55
@@ -1,79 +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 Devtools
|
18
|
-
module Clouderrorreporting
|
19
|
-
module V1beta1
|
20
|
-
# A request for reporting an individual error event.
|
21
|
-
# @!attribute [rw] project_name
|
22
|
-
# @return [String]
|
23
|
-
# Required. The resource name of the Google Cloud Platform project. Written
|
24
|
-
# as `projects/` plus the
|
25
|
-
# [Google Cloud Platform project
|
26
|
-
# ID](https://support.google.com/cloud/answer/6158840). Example:
|
27
|
-
# `projects/my-project-123`.
|
28
|
-
# @!attribute [rw] event
|
29
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ReportedErrorEvent]
|
30
|
-
# Required. The error event to be reported.
|
31
|
-
class ReportErrorEventRequest; end
|
32
|
-
|
33
|
-
# Response for reporting an individual error event.
|
34
|
-
# Data may be added to this message in the future.
|
35
|
-
class ReportErrorEventResponse; end
|
36
|
-
|
37
|
-
# An error event which is reported to the Error Reporting system.
|
38
|
-
# @!attribute [rw] event_time
|
39
|
-
# @return [Google::Protobuf::Timestamp]
|
40
|
-
# Optional. Time when the event occurred.
|
41
|
-
# If not provided, the time when the event was received by the
|
42
|
-
# Error Reporting system will be used.
|
43
|
-
# @!attribute [rw] service_context
|
44
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContext]
|
45
|
-
# Required. The service context in which this error has occurred.
|
46
|
-
# @!attribute [rw] message
|
47
|
-
# @return [String]
|
48
|
-
# Required. The error message.
|
49
|
-
# If no `context.reportLocation` is provided, the message must contain a
|
50
|
-
# header (typically consisting of the exception type name and an error
|
51
|
-
# message) and an exception stack trace in one of the supported programming
|
52
|
-
# languages and formats.
|
53
|
-
# Supported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go.
|
54
|
-
# Supported stack trace formats are:
|
55
|
-
#
|
56
|
-
# * **Java**: Must be the return value of
|
57
|
-
# [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29).
|
58
|
-
# * **Python**: Must be the return value of
|
59
|
-
# [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc).
|
60
|
-
# * **JavaScript**: Must be the value of
|
61
|
-
# [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) as returned
|
62
|
-
# by V8.
|
63
|
-
# * **Ruby**: Must contain frames returned by
|
64
|
-
# [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace).
|
65
|
-
# * **C#**: Must be the return value of
|
66
|
-
# [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx).
|
67
|
-
# * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)`
|
68
|
-
# and contain the result of
|
69
|
-
# [`(string)$exception`](http://php.net/manual/en/exception.tostring.php).
|
70
|
-
# * **Go**: Must be the return value of
|
71
|
-
# [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack).
|
72
|
-
# @!attribute [rw] context
|
73
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorContext]
|
74
|
-
# Optional. A description of the context in which the error occurred.
|
75
|
-
class ReportedErrorEvent; end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
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
|
@@ -1,113 +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 Timestamp represents a point in time independent of any time zone or local
|
19
|
-
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
-
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
-
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
-
# Gregorian calendar backwards to year one.
|
23
|
-
#
|
24
|
-
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
-
# second table is needed for interpretation, using a [24-hour linear
|
26
|
-
# smear](https://developers.google.com/time/smear).
|
27
|
-
#
|
28
|
-
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
-
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
-
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
31
|
-
#
|
32
|
-
# = Examples
|
33
|
-
#
|
34
|
-
# Example 1: Compute Timestamp from POSIX `time()`.
|
35
|
-
#
|
36
|
-
# Timestamp timestamp;
|
37
|
-
# timestamp.set_seconds(time(NULL));
|
38
|
-
# timestamp.set_nanos(0);
|
39
|
-
#
|
40
|
-
# Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
41
|
-
#
|
42
|
-
# struct timeval tv;
|
43
|
-
# gettimeofday(&tv, NULL);
|
44
|
-
#
|
45
|
-
# Timestamp timestamp;
|
46
|
-
# timestamp.set_seconds(tv.tv_sec);
|
47
|
-
# timestamp.set_nanos(tv.tv_usec * 1000);
|
48
|
-
#
|
49
|
-
# Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
50
|
-
#
|
51
|
-
# FILETIME ft;
|
52
|
-
# GetSystemTimeAsFileTime(&ft);
|
53
|
-
# UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
54
|
-
#
|
55
|
-
# // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
56
|
-
# // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
57
|
-
# Timestamp timestamp;
|
58
|
-
# timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
59
|
-
# timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
60
|
-
#
|
61
|
-
# Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
62
|
-
#
|
63
|
-
# long millis = System.currentTimeMillis();
|
64
|
-
#
|
65
|
-
# Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
66
|
-
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# Example 5: Compute Timestamp from current time in Python.
|
70
|
-
#
|
71
|
-
# timestamp = Timestamp()
|
72
|
-
# timestamp.GetCurrentTime()
|
73
|
-
#
|
74
|
-
# = JSON Mapping
|
75
|
-
#
|
76
|
-
# In JSON format, the Timestamp type is encoded as a string in the
|
77
|
-
# [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
78
|
-
# format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
|
79
|
-
# where \\{year} is always expressed using four digits while \\{month}, \\{day},
|
80
|
-
# \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
|
81
|
-
# seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
82
|
-
# are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
83
|
-
# is required. A proto3 JSON serializer should always use UTC (as indicated by
|
84
|
-
# "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
85
|
-
# able to accept both UTC and other timezones (as indicated by an offset).
|
86
|
-
#
|
87
|
-
# For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
88
|
-
# 01:30 UTC on January 15, 2017.
|
89
|
-
#
|
90
|
-
# In JavaScript, one can convert a Date object to this format using the
|
91
|
-
# standard
|
92
|
-
# [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
93
|
-
# method. In Python, a standard `datetime.datetime` object can be converted
|
94
|
-
# to this format using
|
95
|
-
# [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
96
|
-
# the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
97
|
-
# the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
98
|
-
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
99
|
-
# ) to obtain a formatter capable of generating timestamps in this format.
|
100
|
-
# @!attribute [rw] seconds
|
101
|
-
# @return [Integer]
|
102
|
-
# Represents seconds of UTC time since Unix epoch
|
103
|
-
# 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
104
|
-
# 9999-12-31T23:59:59Z inclusive.
|
105
|
-
# @!attribute [rw] nanos
|
106
|
-
# @return [Integer]
|
107
|
-
# Non-negative fractions of a second at nanosecond resolution. Negative
|
108
|
-
# second values with fractions must still have non-negative nanos values
|
109
|
-
# that count forward in time. Must be from 0 to 999,999,999
|
110
|
-
# inclusive.
|
111
|
-
class Timestamp; end
|
112
|
-
end
|
113
|
-
end
|
@@ -1,283 +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
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_group_service.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
|
28
|
-
require "google/devtools/clouderrorreporting/v1beta1/error_group_service_pb"
|
29
|
-
require "google/cloud/error_reporting/v1beta1/credentials"
|
30
|
-
require "google/cloud/error_reporting/version"
|
31
|
-
|
32
|
-
module Google
|
33
|
-
module Cloud
|
34
|
-
module ErrorReporting
|
35
|
-
module V1beta1
|
36
|
-
# Service for retrieving and updating individual error groups.
|
37
|
-
#
|
38
|
-
# @!attribute [r] error_group_service_stub
|
39
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupService::Stub]
|
40
|
-
class ErrorGroupServiceClient
|
41
|
-
# @private
|
42
|
-
attr_reader :error_group_service_stub
|
43
|
-
|
44
|
-
# The default address of the service.
|
45
|
-
SERVICE_ADDRESS = "clouderrorreporting.googleapis.com".freeze
|
46
|
-
|
47
|
-
# The default port of the service.
|
48
|
-
DEFAULT_SERVICE_PORT = 443
|
49
|
-
|
50
|
-
# The default set of gRPC interceptors.
|
51
|
-
GRPC_INTERCEPTORS = []
|
52
|
-
|
53
|
-
DEFAULT_TIMEOUT = 30
|
54
|
-
|
55
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
56
|
-
# this service.
|
57
|
-
ALL_SCOPES = [
|
58
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
59
|
-
].freeze
|
60
|
-
|
61
|
-
|
62
|
-
ERROR_GROUP_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
63
|
-
"projects/{project}/groups/{group}"
|
64
|
-
)
|
65
|
-
|
66
|
-
private_constant :ERROR_GROUP_PATH_TEMPLATE
|
67
|
-
|
68
|
-
# Returns a fully-qualified error_group resource name string.
|
69
|
-
# @param project [String]
|
70
|
-
# @param group [String]
|
71
|
-
# @return [String]
|
72
|
-
def self.error_group_path project, group
|
73
|
-
ERROR_GROUP_PATH_TEMPLATE.render(
|
74
|
-
:"project" => project,
|
75
|
-
:"group" => group
|
76
|
-
)
|
77
|
-
end
|
78
|
-
|
79
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
80
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
81
|
-
# be many types.
|
82
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
83
|
-
# authenticating requests made by this client.
|
84
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
85
|
-
# credentials for this client.
|
86
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
87
|
-
# credentials for this client.
|
88
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
89
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
90
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
91
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
92
|
-
# metadata for requests, generally, to give OAuth credentials.
|
93
|
-
# @param scopes [Array<String>]
|
94
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
95
|
-
# an updater_proc is supplied.
|
96
|
-
# @param client_config [Hash]
|
97
|
-
# A Hash for call options for each method. See
|
98
|
-
# Google::Gax#construct_settings for the structure of
|
99
|
-
# this data. Falls back to the default config if not specified
|
100
|
-
# or the specified config is missing data points.
|
101
|
-
# @param timeout [Numeric]
|
102
|
-
# The default timeout, in seconds, for calls made through this client.
|
103
|
-
# @param metadata [Hash]
|
104
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
105
|
-
# @param service_address [String]
|
106
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
107
|
-
# @param service_port [Integer]
|
108
|
-
# Override for the service port, or `nil` to leave as the default.
|
109
|
-
# @param exception_transformer [Proc]
|
110
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
111
|
-
# custom error handling.
|
112
|
-
def initialize \
|
113
|
-
credentials: nil,
|
114
|
-
scopes: ALL_SCOPES,
|
115
|
-
client_config: {},
|
116
|
-
timeout: DEFAULT_TIMEOUT,
|
117
|
-
metadata: nil,
|
118
|
-
service_address: nil,
|
119
|
-
service_port: nil,
|
120
|
-
exception_transformer: nil,
|
121
|
-
lib_name: nil,
|
122
|
-
lib_version: ""
|
123
|
-
# These require statements are intentionally placed here to initialize
|
124
|
-
# the gRPC module only when it's required.
|
125
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
126
|
-
require "google/gax/grpc"
|
127
|
-
require "google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb"
|
128
|
-
|
129
|
-
credentials ||= Google::Cloud::ErrorReporting::V1beta1::Credentials.default
|
130
|
-
|
131
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
132
|
-
updater_proc = Google::Cloud::ErrorReporting::V1beta1::Credentials.new(credentials).updater_proc
|
133
|
-
end
|
134
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
135
|
-
channel = credentials
|
136
|
-
end
|
137
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
138
|
-
chan_creds = credentials
|
139
|
-
end
|
140
|
-
if credentials.is_a?(Proc)
|
141
|
-
updater_proc = credentials
|
142
|
-
end
|
143
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
144
|
-
updater_proc = credentials.updater_proc
|
145
|
-
end
|
146
|
-
|
147
|
-
package_version = Google::Cloud::ErrorReporting::VERSION
|
148
|
-
|
149
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
150
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
151
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
152
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
153
|
-
google_api_client.freeze
|
154
|
-
|
155
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
156
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
157
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
158
|
-
end
|
159
|
-
headers.merge!(metadata) unless metadata.nil?
|
160
|
-
client_config_file = Pathname.new(__dir__).join(
|
161
|
-
"error_group_service_client_config.json"
|
162
|
-
)
|
163
|
-
defaults = client_config_file.open do |f|
|
164
|
-
Google::Gax.construct_settings(
|
165
|
-
"google.devtools.clouderrorreporting.v1beta1.ErrorGroupService",
|
166
|
-
JSON.parse(f.read),
|
167
|
-
client_config,
|
168
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
169
|
-
timeout,
|
170
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
171
|
-
metadata: headers
|
172
|
-
)
|
173
|
-
end
|
174
|
-
|
175
|
-
# Allow overriding the service path/port in subclasses.
|
176
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
177
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
178
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
179
|
-
@error_group_service_stub = Google::Gax::Grpc.create_stub(
|
180
|
-
service_path,
|
181
|
-
port,
|
182
|
-
chan_creds: chan_creds,
|
183
|
-
channel: channel,
|
184
|
-
updater_proc: updater_proc,
|
185
|
-
scopes: scopes,
|
186
|
-
interceptors: interceptors,
|
187
|
-
&Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupService::Stub.method(:new)
|
188
|
-
)
|
189
|
-
|
190
|
-
@update_group = Google::Gax.create_api_call(
|
191
|
-
@error_group_service_stub.method(:update_group),
|
192
|
-
defaults["update_group"],
|
193
|
-
exception_transformer: exception_transformer,
|
194
|
-
params_extractor: proc do |request|
|
195
|
-
{'group.name' => request.group.name}
|
196
|
-
end
|
197
|
-
)
|
198
|
-
@get_group = Google::Gax.create_api_call(
|
199
|
-
@error_group_service_stub.method(:get_group),
|
200
|
-
defaults["get_group"],
|
201
|
-
exception_transformer: exception_transformer,
|
202
|
-
params_extractor: proc do |request|
|
203
|
-
{'group_name' => request.group_name}
|
204
|
-
end
|
205
|
-
)
|
206
|
-
end
|
207
|
-
|
208
|
-
# Service calls
|
209
|
-
|
210
|
-
# Replace the data for the specified group.
|
211
|
-
# Fails if the group does not exist.
|
212
|
-
#
|
213
|
-
# @param group [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup | Hash]
|
214
|
-
# Required. The group which replaces the resource on the server.
|
215
|
-
# A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup`
|
216
|
-
# can also be provided.
|
217
|
-
# @param options [Google::Gax::CallOptions]
|
218
|
-
# Overrides the default settings for this call, e.g, timeout,
|
219
|
-
# retries, etc.
|
220
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
221
|
-
# @yieldparam result [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
|
222
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
223
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
|
224
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
225
|
-
# @example
|
226
|
-
# require "google/cloud/error_reporting"
|
227
|
-
#
|
228
|
-
# error_group_client = Google::Cloud::ErrorReporting::ErrorGroup.new(version: :v1beta1)
|
229
|
-
#
|
230
|
-
# # TODO: Initialize `group`:
|
231
|
-
# group = {}
|
232
|
-
# response = error_group_client.update_group(group)
|
233
|
-
|
234
|
-
def update_group \
|
235
|
-
group,
|
236
|
-
options: nil,
|
237
|
-
&block
|
238
|
-
req = {
|
239
|
-
group: group
|
240
|
-
}.delete_if { |_, v| v.nil? }
|
241
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::UpdateGroupRequest)
|
242
|
-
@update_group.call(req, options, &block)
|
243
|
-
end
|
244
|
-
|
245
|
-
# Get the specified group.
|
246
|
-
#
|
247
|
-
# @param group_name [String]
|
248
|
-
# The group resource name. Written as
|
249
|
-
# `projects/{projectID}/groups/{group_name}`. Call
|
250
|
-
# [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
|
251
|
-
# to return a list of groups belonging to this project.
|
252
|
-
#
|
253
|
-
# Example: `projects/my-project-123/groups/my-group`
|
254
|
-
# @param options [Google::Gax::CallOptions]
|
255
|
-
# Overrides the default settings for this call, e.g, timeout,
|
256
|
-
# retries, etc.
|
257
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
258
|
-
# @yieldparam result [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
|
259
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
260
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroup]
|
261
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
262
|
-
# @example
|
263
|
-
# require "google/cloud/error_reporting"
|
264
|
-
#
|
265
|
-
# error_group_client = Google::Cloud::ErrorReporting::ErrorGroup.new(version: :v1beta1)
|
266
|
-
# formatted_group_name = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupServiceClient.error_group_path("[PROJECT]", "[GROUP]")
|
267
|
-
# response = error_group_client.get_group(formatted_group_name)
|
268
|
-
|
269
|
-
def get_group \
|
270
|
-
group_name,
|
271
|
-
options: nil,
|
272
|
-
&block
|
273
|
-
req = {
|
274
|
-
group_name: group_name
|
275
|
-
}.delete_if { |_, v| v.nil? }
|
276
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::GetGroupRequest)
|
277
|
-
@get_group.call(req, options, &block)
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
end
|
282
|
-
end
|
283
|
-
end
|