google-cloud-advisory_notifications-v1 0.6.0 → 0.8.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/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/client.rb +35 -10
- data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/paths.rb +62 -16
- data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/client.rb +37 -9
- data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb +28 -2
- data/lib/google/cloud/advisory_notifications/v1/version.rb +1 -1
- data/lib/google/cloud/advisorynotifications/v1/service_pb.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/advisorynotifications/v1/service.rb +6 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99f13d5107805877e1fdb423451e0dd32e4e0f4518950992c70a610fb23bb006
|
4
|
+
data.tar.gz: 125fffc372285b915196006179c9a8866128f84f3349f72ef30d62fd293eb00d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 764217b71cd79c8dd59fd10c45c865135be6ca453d89140b9fe268c820bacd00259975bd6e7ad7a3d05902763943297997a8bda9e579655bd3cda762ad94964f
|
7
|
+
data.tar.gz: d78d40512c1abf9ace821d0e26288a2de9de77154278676c353fc8f4c73df210d07e1b6ec7c097d048122e1ec4ddf80b2e56fe0b064a8a9477509fead98bbf8d
|
data/AUTHENTICATION.md
CHANGED
@@ -1,149 +1,122 @@
|
|
1
1
|
# Authentication
|
2
2
|
|
3
|
-
|
4
|
-
[
|
5
|
-
|
6
|
-
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
7
|
-
credentials will be discovered automatically. When running on other
|
8
|
-
environments, the Service Account credentials can be specified by providing the
|
9
|
-
path to the
|
10
|
-
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
11
|
-
for the account (or the JSON itself) in
|
12
|
-
[environment variables](#environment-variables). Additionally, Cloud SDK
|
13
|
-
credentials can also be discovered automatically, but this is only recommended
|
14
|
-
during development.
|
3
|
+
The recommended way to authenticate to the google-cloud-advisory_notifications-v1 library is to use
|
4
|
+
[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
|
5
|
+
To review all of your authentication options, see [Credentials lookup](#credential-lookup).
|
15
6
|
|
16
7
|
## Quickstart
|
17
8
|
|
18
|
-
|
19
|
-
|
9
|
+
The following example shows how to set up authentication for a local development
|
10
|
+
environment with your user credentials.
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
3. Initialize the client.
|
12
|
+
**NOTE:** This method is _not_ recommended for running in production. User credentials
|
13
|
+
should be used only during development.
|
26
14
|
|
27
|
-
|
28
|
-
|
15
|
+
1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
|
16
|
+
2. Set up a local ADC file with your user credentials:
|
29
17
|
|
30
|
-
|
18
|
+
```sh
|
19
|
+
gcloud auth application-default login
|
31
20
|
```
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
The google-cloud-advisory_notifications-v1 library aims to make authentication
|
36
|
-
as simple as possible, and provides several mechanisms to configure your system
|
37
|
-
without requiring **Service Account Credentials** directly in code.
|
38
|
-
|
39
|
-
**Credentials** are discovered in the following order:
|
40
|
-
|
41
|
-
1. Specify credentials in method arguments
|
42
|
-
2. Specify credentials in configuration
|
43
|
-
3. Discover credentials path in environment variables
|
44
|
-
4. Discover credentials JSON in environment variables
|
45
|
-
5. Discover credentials file in the Cloud SDK's path
|
46
|
-
6. Discover GCP credentials
|
47
|
-
|
48
|
-
### Google Cloud Platform environments
|
22
|
+
3. Write code as if already authenticated.
|
49
23
|
|
50
|
-
|
51
|
-
|
52
|
-
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
53
|
-
Code should be written as if already authenticated.
|
24
|
+
For more information about setting up authentication for a local development environment, see
|
25
|
+
[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
|
54
26
|
|
55
|
-
|
27
|
+
## Credential Lookup
|
56
28
|
|
57
|
-
The
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
**Credentials JSON** file can be stored in the environment variable, or the
|
62
|
-
**Credentials JSON** itself can be stored for environments such as Docker
|
63
|
-
containers where writing files is difficult or not encouraged.
|
29
|
+
The google-cloud-advisory_notifications-v1 library provides several mechanisms to configure your system.
|
30
|
+
Generally, using Application Default Credentials to facilitate automatic
|
31
|
+
credentials discovery is the easist method. But if you need to explicitly specify
|
32
|
+
credentials, there are several methods available to you.
|
64
33
|
|
65
|
-
|
66
|
-
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Credentials}):
|
34
|
+
Credentials are accepted in the following ways, in the following order or precedence:
|
68
35
|
|
69
|
-
|
70
|
-
|
71
|
-
|
36
|
+
1. Credentials specified in method arguments
|
37
|
+
2. Credentials specified in configuration
|
38
|
+
3. Credentials pointed to or included in environment variables
|
39
|
+
4. Credentials found in local ADC file
|
40
|
+
5. Credentials returned by the metadata server for the attached service account (GCP)
|
72
41
|
|
73
|
-
|
74
|
-
require "google/cloud/advisory_notifications/v1"
|
75
|
-
|
76
|
-
ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
|
42
|
+
### Configuration
|
77
43
|
|
78
|
-
client
|
79
|
-
|
44
|
+
You can configure a path to a JSON credentials file, either for an individual client object or
|
45
|
+
globally, for all client objects. The JSON file can contain credentials created for
|
46
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
47
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
48
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
80
49
|
|
81
|
-
|
50
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
51
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
52
|
+
whenever possible.
|
82
53
|
|
83
|
-
|
84
|
-
it in an environment variable. Either on an individual client initialization:
|
54
|
+
To configure a credentials file for an individual client initialization:
|
85
55
|
|
86
56
|
```ruby
|
87
57
|
require "google/cloud/advisory_notifications/v1"
|
88
58
|
|
89
59
|
client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config|
|
90
|
-
config.credentials = "path/to/
|
60
|
+
config.credentials = "path/to/credentialfile.json"
|
91
61
|
end
|
92
62
|
```
|
93
63
|
|
94
|
-
|
64
|
+
To configure a credentials file globally for all clients:
|
95
65
|
|
96
66
|
```ruby
|
97
67
|
require "google/cloud/advisory_notifications/v1"
|
98
68
|
|
99
69
|
::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.configure do |config|
|
100
|
-
config.credentials = "path/to/
|
70
|
+
config.credentials = "path/to/credentialfile.json"
|
101
71
|
end
|
102
72
|
|
103
73
|
client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new
|
104
74
|
```
|
105
75
|
|
106
|
-
###
|
76
|
+
### Environment Variables
|
107
77
|
|
108
|
-
|
109
|
-
|
110
|
-
|
78
|
+
You can also use an environment variable to provide a JSON credentials file.
|
79
|
+
The environment variable can contain a path to the credentials file or, for
|
80
|
+
environments such as Docker containers where writing files is not encouraged,
|
81
|
+
you can include the credentials file itself.
|
111
82
|
|
112
|
-
|
83
|
+
The JSON file can contain credentials created for
|
84
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
85
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
86
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
113
87
|
|
114
|
-
|
115
|
-
|
116
|
-
|
88
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
89
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
90
|
+
whenever possible.
|
91
|
+
|
92
|
+
The environment variables that google-cloud-advisory_notifications-v1
|
93
|
+
checks for credentials are:
|
117
94
|
|
118
|
-
|
119
|
-
*
|
95
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
96
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
120
97
|
|
121
|
-
|
98
|
+
```ruby
|
99
|
+
require "google/cloud/advisory_notifications/v1"
|
122
100
|
|
123
|
-
|
124
|
-
connect to the APIs. You will use the **JSON key file** to
|
125
|
-
connect to most services with google-cloud-advisory_notifications-v1.
|
101
|
+
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
126
102
|
|
127
|
-
|
128
|
-
|
129
|
-
need a Google Developers service account.
|
103
|
+
client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new
|
104
|
+
```
|
130
105
|
|
131
|
-
|
132
|
-
2. Create a new project or click on an existing project.
|
133
|
-
3. Activate the menu in the upper left and select **APIs & Services**. From
|
134
|
-
here, you will enable the APIs that your application requires.
|
106
|
+
### Local ADC file
|
135
107
|
|
136
|
-
|
108
|
+
You can set up a local ADC file with your user credentials for authentication during
|
109
|
+
development. If credentials are not provided in code or in environment variables,
|
110
|
+
then the local ADC credentials are discovered.
|
137
111
|
|
138
|
-
|
112
|
+
Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
|
139
113
|
|
140
|
-
|
141
|
-
"Service account" to be guided through downloading a new JSON key file.
|
114
|
+
### Google Cloud Platform environments
|
142
115
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
116
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
117
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
118
|
+
Functions (GCF) and Cloud Run, credentials are retrieved from the attached
|
119
|
+
service account automatically. Code should be written as if already authenticated.
|
147
120
|
|
148
|
-
|
149
|
-
|
121
|
+
For more information, see
|
122
|
+
[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
|
@@ -30,6 +30,9 @@ module Google
|
|
30
30
|
# Service to manage Security and Privacy Notifications.
|
31
31
|
#
|
32
32
|
class Client
|
33
|
+
# @private
|
34
|
+
DEFAULT_ENDPOINT_TEMPLATE = "advisorynotifications.$UNIVERSE_DOMAIN$"
|
35
|
+
|
33
36
|
include Paths
|
34
37
|
|
35
38
|
# @private
|
@@ -100,6 +103,15 @@ module Google
|
|
100
103
|
@config
|
101
104
|
end
|
102
105
|
|
106
|
+
##
|
107
|
+
# The effective universe domain
|
108
|
+
#
|
109
|
+
# @return [String]
|
110
|
+
#
|
111
|
+
def universe_domain
|
112
|
+
@advisory_notifications_service_stub.universe_domain
|
113
|
+
end
|
114
|
+
|
103
115
|
##
|
104
116
|
# Create a new AdvisoryNotificationsService client object.
|
105
117
|
#
|
@@ -133,8 +145,9 @@ module Google
|
|
133
145
|
credentials = @config.credentials
|
134
146
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
135
147
|
# but only if the default endpoint does not have a region prefix.
|
136
|
-
enable_self_signed_jwt = @config.endpoint
|
137
|
-
|
148
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
149
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
150
|
+
!@config.endpoint.split(".").first.include?("-"))
|
138
151
|
credentials ||= Credentials.default scope: @config.scope,
|
139
152
|
enable_self_signed_jwt: enable_self_signed_jwt
|
140
153
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -145,8 +158,10 @@ module Google
|
|
145
158
|
|
146
159
|
@advisory_notifications_service_stub = ::Gapic::ServiceStub.new(
|
147
160
|
::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Stub,
|
148
|
-
credentials:
|
149
|
-
endpoint:
|
161
|
+
credentials: credentials,
|
162
|
+
endpoint: @config.endpoint,
|
163
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
164
|
+
universe_domain: @config.universe_domain,
|
150
165
|
channel_args: @config.channel_args,
|
151
166
|
interceptors: @config.interceptors,
|
152
167
|
channel_pool_config: @config.channel_pool
|
@@ -175,7 +190,8 @@ module Google
|
|
175
190
|
#
|
176
191
|
# @param parent [::String]
|
177
192
|
# Required. The parent, which owns this collection of notifications.
|
178
|
-
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
193
|
+
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
194
|
+
# or "projects/\\{project}/locations/\\{location}"
|
179
195
|
# @param page_size [::Integer]
|
180
196
|
# The maximum number of notifications to return. The service may return
|
181
197
|
# fewer than this value. If unspecified or equal to 0, at most 50
|
@@ -285,7 +301,8 @@ module Google
|
|
285
301
|
# @param name [::String]
|
286
302
|
# Required. A name of the notification to retrieve.
|
287
303
|
# Format:
|
288
|
-
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
304
|
+
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
305
|
+
# or projects/\\{projects}/locations/\\{location}/notifications/\\{notification}.
|
289
306
|
# @param language_code [::String]
|
290
307
|
# ISO code for requested localization language. If unset, will be
|
291
308
|
# interpereted as "en". If the requested language is valid, but not supported
|
@@ -559,9 +576,9 @@ module Google
|
|
559
576
|
# end
|
560
577
|
#
|
561
578
|
# @!attribute [rw] endpoint
|
562
|
-
#
|
563
|
-
#
|
564
|
-
# @return [::String]
|
579
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
580
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
581
|
+
# @return [::String,nil]
|
565
582
|
# @!attribute [rw] credentials
|
566
583
|
# Credentials to send with calls. You may provide any of the following types:
|
567
584
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -607,13 +624,20 @@ module Google
|
|
607
624
|
# @!attribute [rw] quota_project
|
608
625
|
# A separate project against which to charge quota.
|
609
626
|
# @return [::String]
|
627
|
+
# @!attribute [rw] universe_domain
|
628
|
+
# The universe domain within which to make requests. This determines the
|
629
|
+
# default endpoint URL. The default value of nil uses the environment
|
630
|
+
# universe (usually the default "googleapis.com" universe).
|
631
|
+
# @return [::String,nil]
|
610
632
|
#
|
611
633
|
class Configuration
|
612
634
|
extend ::Gapic::Config
|
613
635
|
|
636
|
+
# @private
|
637
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
614
638
|
DEFAULT_ENDPOINT = "advisorynotifications.googleapis.com"
|
615
639
|
|
616
|
-
config_attr :endpoint,
|
640
|
+
config_attr :endpoint, nil, ::String, nil
|
617
641
|
config_attr :credentials, nil do |value|
|
618
642
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
619
643
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -628,6 +652,7 @@ module Google
|
|
628
652
|
config_attr :metadata, nil, ::Hash, nil
|
629
653
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
630
654
|
config_attr :quota_project, nil, ::String, nil
|
655
|
+
config_attr :universe_domain, nil, ::String, nil
|
631
656
|
|
632
657
|
# @private
|
633
658
|
def initialize parent_config = nil
|
@@ -27,37 +27,83 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Create a fully-qualified Location resource string.
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# @overload location_path(organization:, location:)
|
31
|
+
# The resource will be in the following format:
|
31
32
|
#
|
32
|
-
#
|
33
|
+
# `organizations/{organization}/locations/{location}`
|
33
34
|
#
|
34
|
-
#
|
35
|
-
#
|
35
|
+
# @param organization [String]
|
36
|
+
# @param location [String]
|
37
|
+
#
|
38
|
+
# @overload location_path(project:, location:)
|
39
|
+
# The resource will be in the following format:
|
40
|
+
#
|
41
|
+
# `projects/{project}/locations/{location}`
|
42
|
+
#
|
43
|
+
# @param project [String]
|
44
|
+
# @param location [String]
|
36
45
|
#
|
37
46
|
# @return [::String]
|
38
|
-
def location_path
|
39
|
-
|
47
|
+
def location_path **args
|
48
|
+
resources = {
|
49
|
+
"location:organization" => (proc do |organization:, location:|
|
50
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
51
|
+
|
52
|
+
"organizations/#{organization}/locations/#{location}"
|
53
|
+
end),
|
54
|
+
"location:project" => (proc do |project:, location:|
|
55
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
56
|
+
|
57
|
+
"projects/#{project}/locations/#{location}"
|
58
|
+
end)
|
59
|
+
}
|
40
60
|
|
41
|
-
"
|
61
|
+
resource = resources[args.keys.sort.join(":")]
|
62
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
63
|
+
resource.call(**args)
|
42
64
|
end
|
43
65
|
|
44
66
|
##
|
45
67
|
# Create a fully-qualified Notification resource string.
|
46
68
|
#
|
47
|
-
#
|
69
|
+
# @overload notification_path(organization:, location:, notification:)
|
70
|
+
# The resource will be in the following format:
|
48
71
|
#
|
49
|
-
#
|
72
|
+
# `organizations/{organization}/locations/{location}/notifications/{notification}`
|
50
73
|
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
74
|
+
# @param organization [String]
|
75
|
+
# @param location [String]
|
76
|
+
# @param notification [String]
|
77
|
+
#
|
78
|
+
# @overload notification_path(project:, location:, notification:)
|
79
|
+
# The resource will be in the following format:
|
80
|
+
#
|
81
|
+
# `projects/{project}/locations/{location}/notifications/{notification}`
|
82
|
+
#
|
83
|
+
# @param project [String]
|
84
|
+
# @param location [String]
|
85
|
+
# @param notification [String]
|
54
86
|
#
|
55
87
|
# @return [::String]
|
56
|
-
def notification_path
|
57
|
-
|
58
|
-
|
88
|
+
def notification_path **args
|
89
|
+
resources = {
|
90
|
+
"location:notification:organization" => (proc do |organization:, location:, notification:|
|
91
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
92
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
93
|
+
|
94
|
+
"organizations/#{organization}/locations/#{location}/notifications/#{notification}"
|
95
|
+
end),
|
96
|
+
"location:notification:project" => (proc do |project:, location:, notification:|
|
97
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
98
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
99
|
+
|
100
|
+
"projects/#{project}/locations/#{location}/notifications/#{notification}"
|
101
|
+
end)
|
102
|
+
}
|
59
103
|
|
60
|
-
"
|
104
|
+
resource = resources[args.keys.sort.join(":")]
|
105
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
106
|
+
resource.call(**args)
|
61
107
|
end
|
62
108
|
|
63
109
|
##
|
data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/client.rb
CHANGED
@@ -32,6 +32,9 @@ module Google
|
|
32
32
|
# Service to manage Security and Privacy Notifications.
|
33
33
|
#
|
34
34
|
class Client
|
35
|
+
# @private
|
36
|
+
DEFAULT_ENDPOINT_TEMPLATE = "advisorynotifications.$UNIVERSE_DOMAIN$"
|
37
|
+
|
35
38
|
include Paths
|
36
39
|
|
37
40
|
# @private
|
@@ -102,6 +105,15 @@ module Google
|
|
102
105
|
@config
|
103
106
|
end
|
104
107
|
|
108
|
+
##
|
109
|
+
# The effective universe domain
|
110
|
+
#
|
111
|
+
# @return [String]
|
112
|
+
#
|
113
|
+
def universe_domain
|
114
|
+
@advisory_notifications_service_stub.universe_domain
|
115
|
+
end
|
116
|
+
|
105
117
|
##
|
106
118
|
# Create a new AdvisoryNotificationsService REST client object.
|
107
119
|
#
|
@@ -129,8 +141,9 @@ module Google
|
|
129
141
|
credentials = @config.credentials
|
130
142
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
131
143
|
# but only if the default endpoint does not have a region prefix.
|
132
|
-
enable_self_signed_jwt = @config.endpoint
|
133
|
-
|
144
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
145
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
146
|
+
!@config.endpoint.split(".").first.include?("-"))
|
134
147
|
credentials ||= Credentials.default scope: @config.scope,
|
135
148
|
enable_self_signed_jwt: enable_self_signed_jwt
|
136
149
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -140,7 +153,12 @@ module Google
|
|
140
153
|
@quota_project_id = @config.quota_project
|
141
154
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
142
155
|
|
143
|
-
@advisory_notifications_service_stub = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Rest::ServiceStub.new
|
156
|
+
@advisory_notifications_service_stub = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Rest::ServiceStub.new(
|
157
|
+
endpoint: @config.endpoint,
|
158
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
159
|
+
universe_domain: @config.universe_domain,
|
160
|
+
credentials: credentials
|
161
|
+
)
|
144
162
|
end
|
145
163
|
|
146
164
|
# Service calls
|
@@ -165,7 +183,8 @@ module Google
|
|
165
183
|
#
|
166
184
|
# @param parent [::String]
|
167
185
|
# Required. The parent, which owns this collection of notifications.
|
168
|
-
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
186
|
+
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
187
|
+
# or "projects/\\{project}/locations/\\{location}"
|
169
188
|
# @param page_size [::Integer]
|
170
189
|
# The maximum number of notifications to return. The service may return
|
171
190
|
# fewer than this value. If unspecified or equal to 0, at most 50
|
@@ -268,7 +287,8 @@ module Google
|
|
268
287
|
# @param name [::String]
|
269
288
|
# Required. A name of the notification to retrieve.
|
270
289
|
# Format:
|
271
|
-
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
290
|
+
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
291
|
+
# or projects/\\{projects}/locations/\\{location}/notifications/\\{notification}.
|
272
292
|
# @param language_code [::String]
|
273
293
|
# ISO code for requested localization language. If unset, will be
|
274
294
|
# interpereted as "en". If the requested language is valid, but not supported
|
@@ -521,9 +541,9 @@ module Google
|
|
521
541
|
# end
|
522
542
|
#
|
523
543
|
# @!attribute [rw] endpoint
|
524
|
-
#
|
525
|
-
#
|
526
|
-
# @return [::String]
|
544
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
545
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
546
|
+
# @return [::String,nil]
|
527
547
|
# @!attribute [rw] credentials
|
528
548
|
# Credentials to send with calls. You may provide any of the following types:
|
529
549
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -560,13 +580,20 @@ module Google
|
|
560
580
|
# @!attribute [rw] quota_project
|
561
581
|
# A separate project against which to charge quota.
|
562
582
|
# @return [::String]
|
583
|
+
# @!attribute [rw] universe_domain
|
584
|
+
# The universe domain within which to make requests. This determines the
|
585
|
+
# default endpoint URL. The default value of nil uses the environment
|
586
|
+
# universe (usually the default "googleapis.com" universe).
|
587
|
+
# @return [::String,nil]
|
563
588
|
#
|
564
589
|
class Configuration
|
565
590
|
extend ::Gapic::Config
|
566
591
|
|
592
|
+
# @private
|
593
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
567
594
|
DEFAULT_ENDPOINT = "advisorynotifications.googleapis.com"
|
568
595
|
|
569
|
-
config_attr :endpoint,
|
596
|
+
config_attr :endpoint, nil, ::String, nil
|
570
597
|
config_attr :credentials, nil do |value|
|
571
598
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
572
599
|
allowed.any? { |klass| klass === value }
|
@@ -578,6 +605,7 @@ module Google
|
|
578
605
|
config_attr :metadata, nil, ::Hash, nil
|
579
606
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
580
607
|
config_attr :quota_project, nil, ::String, nil
|
608
|
+
config_attr :universe_domain, nil, ::String, nil
|
581
609
|
|
582
610
|
# @private
|
583
611
|
def initialize parent_config = nil
|
data/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb
CHANGED
@@ -30,16 +30,28 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
43
55
|
##
|
44
56
|
# Baseline implementation for the list_notifications REST call
|
45
57
|
#
|
@@ -210,6 +222,13 @@ module Google
|
|
210
222
|
["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
|
211
223
|
]
|
212
224
|
)
|
225
|
+
.with_bindings(
|
226
|
+
uri_method: :get,
|
227
|
+
uri_template: "/v1/{parent}/notifications",
|
228
|
+
matches: [
|
229
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
230
|
+
]
|
231
|
+
)
|
213
232
|
transcoder.transcode request_pb
|
214
233
|
end
|
215
234
|
|
@@ -231,6 +250,13 @@ module Google
|
|
231
250
|
["name", %r{^organizations/[^/]+/locations/[^/]+/notifications/[^/]+/?$}, false]
|
232
251
|
]
|
233
252
|
)
|
253
|
+
.with_bindings(
|
254
|
+
uri_method: :get,
|
255
|
+
uri_template: "/v1/{name}",
|
256
|
+
matches: [
|
257
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/notifications/[^/]+/?$}, false]
|
258
|
+
]
|
259
|
+
)
|
234
260
|
transcoder.transcode request_pb
|
235
261
|
end
|
236
262
|
|
@@ -11,7 +11,7 @@ require 'google/api/resource_pb'
|
|
11
11
|
require 'google/protobuf/timestamp_pb'
|
12
12
|
|
13
13
|
|
14
|
-
descriptor_data = "\n3google/cloud/advisorynotifications/v1/service.proto\x12%google.cloud.advisorynotifications.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\
|
14
|
+
descriptor_data = "\n3google/cloud/advisorynotifications/v1/service.proto\x12%google.cloud.advisorynotifications.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x04\n\x0cNotification\x12\x0c\n\x04name\x18\x01 \x01(\t\x12?\n\x07subject\x18\x02 \x01(\x0b\x32..google.cloud.advisorynotifications.v1.Subject\x12@\n\x08messages\x18\x03 \x03(\x0b\x32..google.cloud.advisorynotifications.v1.Message\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x11notification_type\x18\x0c \x01(\x0e\x32\x37.google.cloud.advisorynotifications.v1.NotificationType:\xea\x01\xea\x41\xe6\x01\n1advisorynotifications.googleapis.com/Notification\x12Norganizations/{organization}/locations/{location}/notifications/{notification}\x12\x44projects/{project}/locations/{location}/notifications/{notification}*\rnotifications2\x0cnotification\"\x85\x01\n\x04Text\x12\x0f\n\x07\x65n_text\x18\x01 \x01(\t\x12\x16\n\x0elocalized_text\x18\x02 \x01(\t\x12T\n\x12localization_state\x18\x03 \x01(\x0e\x32\x38.google.cloud.advisorynotifications.v1.LocalizationState\"D\n\x07Subject\x12\x39\n\x04text\x18\x01 \x01(\x0b\x32+.google.cloud.advisorynotifications.v1.Text\"\xbf\x02\n\x07Message\x12\x41\n\x04\x62ody\x18\x01 \x01(\x0b\x32\x33.google.cloud.advisorynotifications.v1.Message.Body\x12\x46\n\x0b\x61ttachments\x18\x02 \x03(\x0b\x32\x31.google.cloud.advisorynotifications.v1.Attachment\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11localization_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\x04\x42ody\x12\x39\n\x04text\x18\x01 \x01(\x0b\x32+.google.cloud.advisorynotifications.v1.Text\"e\n\nAttachment\x12\x39\n\x03\x63sv\x18\x02 \x01(\x0b\x32*.google.cloud.advisorynotifications.v1.CsvH\x00\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x06\n\x04\x64\x61ta\"w\n\x03\x43sv\x12\x0f\n\x07headers\x18\x01 \x03(\t\x12\x44\n\tdata_rows\x18\x02 \x03(\x0b\x32\x31.google.cloud.advisorynotifications.v1.Csv.CsvRow\x1a\x19\n\x06\x43svRow\x12\x0f\n\x07\x65ntries\x18\x01 \x03(\t\"\xea\x01\n\x18ListNotificationsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31\x61\x64visorynotifications.googleapis.com/Notification\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x45\n\x04view\x18\x04 \x01(\x0e\x32\x37.google.cloud.advisorynotifications.v1.NotificationView\x12\x15\n\rlanguage_code\x18\x05 \x01(\t\"\x94\x01\n\x19ListNotificationsResponse\x12J\n\rnotifications\x18\x01 \x03(\x0b\x32\x33.google.cloud.advisorynotifications.v1.Notification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"x\n\x16GetNotificationRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1advisorynotifications.googleapis.com/Notification\x12\x15\n\rlanguage_code\x18\x05 \x01(\t\"\x89\x03\n\x08Settings\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12m\n\x15notification_settings\x18\x02 \x03(\x0b\x32I.google.cloud.advisorynotifications.v1.Settings.NotificationSettingsEntryB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1ax\n\x19NotificationSettingsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.advisorynotifications.v1.NotificationSettings:\x02\x38\x01:n\xea\x41k\n-advisorynotifications.googleapis.com/Settings\x12:organizations/{organization}/locations/{location}/settings\"\'\n\x14NotificationSettings\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"Y\n\x12GetSettingsRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-advisorynotifications.googleapis.com/Settings\"_\n\x15UpdateSettingsRequest\x12\x46\n\x08settings\x18\x01 \x01(\x0b\x32/.google.cloud.advisorynotifications.v1.SettingsB\x03\xe0\x41\x02*J\n\x10NotificationView\x12!\n\x1dNOTIFICATION_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02*\xa0\x01\n\x11LocalizationState\x12\"\n\x1eLOCALIZATION_STATE_UNSPECIFIED\x10\x00\x12%\n!LOCALIZATION_STATE_NOT_APPLICABLE\x10\x01\x12\x1e\n\x1aLOCALIZATION_STATE_PENDING\x10\x02\x12 \n\x1cLOCALIZATION_STATE_COMPLETED\x10\x03*\xda\x01\n\x10NotificationType\x12!\n\x1dNOTIFICATION_TYPE_UNSPECIFIED\x10\x00\x12/\n+NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY\x10\x01\x12\'\n#NOTIFICATION_TYPE_SENSITIVE_ACTIONS\x10\x02\x12\"\n\x1eNOTIFICATION_TYPE_SECURITY_MSA\x10\x03\x12%\n!NOTIFICATION_TYPE_THREAT_HORIZONS\x10\x04\x32\xa8\x08\n\x1c\x41\x64visoryNotificationsService\x12\x94\x02\n\x11ListNotifications\x12?.google.cloud.advisorynotifications.v1.ListNotificationsRequest\x1a@.google.cloud.advisorynotifications.v1.ListNotificationsResponse\"|\x82\xd3\xe4\x93\x02m\x12\x36/v1/{parent=organizations/*/locations/*}/notificationsZ3\x12\x31/v1/{parent=projects/*/locations/*}/notifications\xda\x41\x06parent\x12\x81\x02\n\x0fGetNotification\x12=.google.cloud.advisorynotifications.v1.GetNotificationRequest\x1a\x33.google.cloud.advisorynotifications.v1.Notification\"z\x82\xd3\xe4\x93\x02m\x12\x36/v1/{name=organizations/*/locations/*/notifications/*}Z3\x12\x31/v1/{name=projects/*/locations/*/notifications/*}\xda\x41\x04name\x12\xb9\x01\n\x0bGetSettings\x12\x39.google.cloud.advisorynotifications.v1.GetSettingsRequest\x1a/.google.cloud.advisorynotifications.v1.Settings\">\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=organizations/*/locations/*/settings}\xda\x41\x04name\x12\xd6\x01\n\x0eUpdateSettings\x12<.google.cloud.advisorynotifications.v1.UpdateSettingsRequest\x1a/.google.cloud.advisorynotifications.v1.Settings\"U\x82\xd3\xe4\x93\x02\x44\x32\x38/v1/{settings.name=organizations/*/locations/*/settings}:\x08settings\xda\x41\x08settings\x1aX\xca\x41$advisorynotifications.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa6\x03\n)com.google.cloud.advisorynotifications.v1B\x0cServiceProtoP\x01Z_cloud.google.com/go/advisorynotifications/apiv1/advisorynotificationspb;advisorynotificationspb\xaa\x02%Google.Cloud.AdvisoryNotifications.V1\xca\x02%Google\\Cloud\\AdvisoryNotifications\\V1\xea\x02(Google::Cloud::AdvisoryNotifications::V1\xea\x41\x8b\x01\n-advisorynotifications.googleapis.com/Location\x12\x31organizations/{organization}/locations/{location}\x12\'projects/{project}/locations/{location}b\x06proto3"
|
15
15
|
|
16
16
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
17
17
|
|
@@ -21,6 +21,7 @@ module Google
|
|
21
21
|
module Api
|
22
22
|
# Required information for every language.
|
23
23
|
# @!attribute [rw] reference_docs_uri
|
24
|
+
# @deprecated This field is deprecated and may be removed in the next major version update.
|
24
25
|
# @return [::String]
|
25
26
|
# Link to automatically generated reference documentation. Example:
|
26
27
|
# https://cloud.google.com/nodejs/docs/reference/asset/latest
|
@@ -304,6 +305,19 @@ module Google
|
|
304
305
|
# seconds: 360 # 6 minutes
|
305
306
|
# total_poll_timeout:
|
306
307
|
# seconds: 54000 # 90 minutes
|
308
|
+
# @!attribute [rw] auto_populated_fields
|
309
|
+
# @return [::Array<::String>]
|
310
|
+
# List of top-level fields of the request message, that should be
|
311
|
+
# automatically populated by the client libraries based on their
|
312
|
+
# (google.api.field_info).format. Currently supported format: UUID4.
|
313
|
+
#
|
314
|
+
# Example of a YAML configuration:
|
315
|
+
#
|
316
|
+
# publishing:
|
317
|
+
# method_settings:
|
318
|
+
# - selector: google.example.v1.ExampleService.CreateExample
|
319
|
+
# auto_populated_fields:
|
320
|
+
# - request_id
|
307
321
|
class MethodSettings
|
308
322
|
include ::Google::Protobuf::MessageExts
|
309
323
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -27,7 +27,8 @@ module Google
|
|
27
27
|
# @return [::String]
|
28
28
|
# The resource name of the notification.
|
29
29
|
# Format:
|
30
|
-
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
30
|
+
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
31
|
+
# or projects/\\{project}/locations/\\{location}/notifications/\\{notification}.
|
31
32
|
# @!attribute [rw] subject
|
32
33
|
# @return [::Google::Cloud::AdvisoryNotifications::V1::Subject]
|
33
34
|
# The subject line of the notification.
|
@@ -136,7 +137,8 @@ module Google
|
|
136
137
|
# @!attribute [rw] parent
|
137
138
|
# @return [::String]
|
138
139
|
# Required. The parent, which owns this collection of notifications.
|
139
|
-
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
140
|
+
# Must be of the form "organizations/\\{organization}/locations/\\{location}"
|
141
|
+
# or "projects/\\{project}/locations/\\{location}"
|
140
142
|
# @!attribute [rw] page_size
|
141
143
|
# @return [::Integer]
|
142
144
|
# The maximum number of notifications to return. The service may return
|
@@ -185,7 +187,8 @@ module Google
|
|
185
187
|
# @return [::String]
|
186
188
|
# Required. A name of the notification to retrieve.
|
187
189
|
# Format:
|
188
|
-
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
190
|
+
# organizations/\\{organization}/locations/\\{location}/notifications/\\{notification}
|
191
|
+
# or projects/\\{projects}/locations/\\{location}/notifications/\\{notification}.
|
189
192
|
# @!attribute [rw] language_code
|
190
193
|
# @return [::String]
|
191
194
|
# ISO code for requested localization language. If unset, will be
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-advisory_notifications-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.21.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.21.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
212
|
+
rubygems_version: 3.5.3
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: An API for accessing Advisory Notifications in Google Cloud.
|