google-cloud-essential_contacts-v1 0.1.0 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d01b7fee43c4f399f107e051184a858a03c5654ea82045031db3a5c7a06d617d
4
- data.tar.gz: 9590731f9ae43ea7725a794d9f99e0d02bd3c996814e027a65fc20312e12510a
3
+ metadata.gz: 65548253a08c879d115cef0943d9c05261f279b477b8799c212fe7018c0cffdc
4
+ data.tar.gz: c9bb4c75fa6f4d8265eccf70ffb158b32e6a8adeee33b6e9fb9a0cbb5d73eaec
5
5
  SHA512:
6
- metadata.gz: 676adc786565b7917c785e2a39782f99d6678498b9167d09c08165531fd85eceae18a666a38d6ae7870f0cdf9fdfded934b77c1ae2ca457efdd2b3bf91a84c6b
7
- data.tar.gz: c5e5a01397c4cec5cb12b92e4f99d7148fedd1191c49aa4eeff781424b9d9ef22bd43ae53e02cf78f866266aa713c60baa98dc059b197badef51a062e0e24ae9
6
+ metadata.gz: 32deb85ea7376781e00ce648d3c7de1e3542974d28f769fee5fdf620e580945a551a4cfe819861a415baf0efe491d37d4a404e3ee653aa429ae15c1519b2f5cd
7
+ data.tar.gz: 67bcb7b939a5238fd4cb4ca0e446c631d5b68100e0294946f7d1f5e15a541a8823e143fe005e81c7de53ca06ccacf92b242be6f0791a7c40fe3f0e25036f1d34
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Essential Contacts V1 API
2
+ --title="Essential Contacts V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-essential_contacts-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Credentials}):
68
68
 
69
- 1. `ESSENTIAL_CONTACTS_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `ESSENTIAL_CONTACTS_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `ESSENTIAL_CONTACTS_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `ESSENTIAL_CONTACTS_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/essential_contacts/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Clien
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/essential_contacts/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Clien
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/essential_contacts/v1"
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/essential_contacts/v1"
34
34
 
35
35
  client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::EssentialContacts::V1::CreateContactRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_contact request
38
38
  ```
39
39
 
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all EssentialContactsService clients:
47
- #
48
- # ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all EssentialContactsService clients
47
+ # ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -71,18 +70,12 @@ module Google
71
70
 
72
71
  default_config.rpcs.list_contacts.timeout = 60.0
73
72
  default_config.rpcs.list_contacts.retry_policy = {
74
- initial_delay: 1.0,
75
- max_delay: 10.0,
76
- multiplier: 1.3,
77
- retry_codes: [14]
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
74
  }
79
75
 
80
76
  default_config.rpcs.get_contact.timeout = 60.0
81
77
  default_config.rpcs.get_contact.retry_policy = {
82
- initial_delay: 1.0,
83
- max_delay: 10.0,
84
- multiplier: 1.3,
85
- retry_codes: [14]
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
79
  }
87
80
 
88
81
  default_config.rpcs.delete_contact.timeout = 60.0
@@ -120,19 +113,15 @@ module Google
120
113
  ##
121
114
  # Create a new EssentialContactsService client object.
122
115
  #
123
- # ## Examples
124
- #
125
- # To create a new EssentialContactsService client with the default
126
- # configuration:
116
+ # @example
127
117
  #
128
- # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
129
120
  #
130
- # To create a new EssentialContactsService client with a custom
131
- # configuration:
132
- #
133
- # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config|
134
- # config.timeout = 10.0
135
- # end
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
136
125
  #
137
126
  # @yield [config] Configure the EssentialContactsService client.
138
127
  # @yieldparam config [Client::Configuration]
@@ -152,14 +141,13 @@ module Google
152
141
 
153
142
  # Create credentials
154
143
  credentials = @config.credentials
155
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
156
145
  # but only if the default endpoint does not have a region prefix.
157
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
158
- @config.endpoint == Client.configure.endpoint &&
146
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
159
147
  !@config.endpoint.split(".").first.include?("-")
160
148
  credentials ||= Credentials.default scope: @config.scope,
161
149
  enable_self_signed_jwt: enable_self_signed_jwt
162
- if credentials.is_a?(String) || credentials.is_a?(Hash)
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
163
151
  credentials = Credentials.new credentials, scope: @config.scope
164
152
  end
165
153
  @quota_project_id = @config.quota_project
@@ -210,6 +198,21 @@ module Google
210
198
  #
211
199
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
212
200
  #
201
+ # @example Basic example
202
+ # require "google/cloud/essential_contacts/v1"
203
+ #
204
+ # # Create a client object. The client can be reused for multiple calls.
205
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
206
+ #
207
+ # # Create a request. To set request fields, pass in keyword arguments.
208
+ # request = Google::Cloud::EssentialContacts::V1::CreateContactRequest.new
209
+ #
210
+ # # Call the create_contact method.
211
+ # result = client.create_contact request
212
+ #
213
+ # # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact.
214
+ # p result
215
+ #
213
216
  def create_contact request, options = nil
214
217
  raise ::ArgumentError, "request must be provided" if request.nil?
215
218
 
@@ -227,16 +230,20 @@ module Google
227
230
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
228
231
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
232
 
230
- header_params = {
231
- "parent" => request.parent
232
- }
233
+ header_params = {}
234
+ if request.parent
235
+ header_params["parent"] = request.parent
236
+ end
237
+
233
238
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
234
239
  metadata[:"x-goog-request-params"] ||= request_params_header
235
240
 
236
241
  options.apply_defaults timeout: @config.rpcs.create_contact.timeout,
237
242
  metadata: metadata,
238
243
  retry_policy: @config.rpcs.create_contact.retry_policy
239
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
240
247
  retry_policy: @config.retry_policy
241
248
 
242
249
  @essential_contacts_service_stub.call_rpc :create_contact, request, options: options do |response, operation|
@@ -282,6 +289,21 @@ module Google
282
289
  #
283
290
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
284
291
  #
292
+ # @example Basic example
293
+ # require "google/cloud/essential_contacts/v1"
294
+ #
295
+ # # Create a client object. The client can be reused for multiple calls.
296
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
297
+ #
298
+ # # Create a request. To set request fields, pass in keyword arguments.
299
+ # request = Google::Cloud::EssentialContacts::V1::UpdateContactRequest.new
300
+ #
301
+ # # Call the update_contact method.
302
+ # result = client.update_contact request
303
+ #
304
+ # # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact.
305
+ # p result
306
+ #
285
307
  def update_contact request, options = nil
286
308
  raise ::ArgumentError, "request must be provided" if request.nil?
287
309
 
@@ -299,16 +321,20 @@ module Google
299
321
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
300
322
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
323
 
302
- header_params = {
303
- "contact.name" => request.contact.name
304
- }
324
+ header_params = {}
325
+ if request.contact&.name
326
+ header_params["contact.name"] = request.contact.name
327
+ end
328
+
305
329
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
330
  metadata[:"x-goog-request-params"] ||= request_params_header
307
331
 
308
332
  options.apply_defaults timeout: @config.rpcs.update_contact.timeout,
309
333
  metadata: metadata,
310
334
  retry_policy: @config.rpcs.update_contact.retry_policy
311
- options.apply_defaults metadata: @config.metadata,
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
312
338
  retry_policy: @config.retry_policy
313
339
 
314
340
  @essential_contacts_service_stub.call_rpc :update_contact, request, options: options do |response, operation|
@@ -360,6 +386,27 @@ module Google
360
386
  #
361
387
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
362
388
  #
389
+ # @example Basic example
390
+ # require "google/cloud/essential_contacts/v1"
391
+ #
392
+ # # Create a client object. The client can be reused for multiple calls.
393
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
394
+ #
395
+ # # Create a request. To set request fields, pass in keyword arguments.
396
+ # request = Google::Cloud::EssentialContacts::V1::ListContactsRequest.new
397
+ #
398
+ # # Call the list_contacts method.
399
+ # result = client.list_contacts request
400
+ #
401
+ # # The returned object is of type Gapic::PagedEnumerable. You can
402
+ # # iterate over all elements by calling #each, and the enumerable
403
+ # # will lazily make API calls to fetch subsequent pages. Other
404
+ # # methods are also available for managing paging directly.
405
+ # result.each do |response|
406
+ # # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact.
407
+ # p response
408
+ # end
409
+ #
363
410
  def list_contacts request, options = nil
364
411
  raise ::ArgumentError, "request must be provided" if request.nil?
365
412
 
@@ -377,16 +424,20 @@ module Google
377
424
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
378
425
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
379
426
 
380
- header_params = {
381
- "parent" => request.parent
382
- }
427
+ header_params = {}
428
+ if request.parent
429
+ header_params["parent"] = request.parent
430
+ end
431
+
383
432
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
384
433
  metadata[:"x-goog-request-params"] ||= request_params_header
385
434
 
386
435
  options.apply_defaults timeout: @config.rpcs.list_contacts.timeout,
387
436
  metadata: metadata,
388
437
  retry_policy: @config.rpcs.list_contacts.retry_policy
389
- options.apply_defaults metadata: @config.metadata,
438
+
439
+ options.apply_defaults timeout: @config.timeout,
440
+ metadata: @config.metadata,
390
441
  retry_policy: @config.retry_policy
391
442
 
392
443
  @essential_contacts_service_stub.call_rpc :list_contacts, request, options: options do |response, operation|
@@ -430,6 +481,21 @@ module Google
430
481
  #
431
482
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
432
483
  #
484
+ # @example Basic example
485
+ # require "google/cloud/essential_contacts/v1"
486
+ #
487
+ # # Create a client object. The client can be reused for multiple calls.
488
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
489
+ #
490
+ # # Create a request. To set request fields, pass in keyword arguments.
491
+ # request = Google::Cloud::EssentialContacts::V1::GetContactRequest.new
492
+ #
493
+ # # Call the get_contact method.
494
+ # result = client.get_contact request
495
+ #
496
+ # # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact.
497
+ # p result
498
+ #
433
499
  def get_contact request, options = nil
434
500
  raise ::ArgumentError, "request must be provided" if request.nil?
435
501
 
@@ -447,16 +513,20 @@ module Google
447
513
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
448
514
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
449
515
 
450
- header_params = {
451
- "name" => request.name
452
- }
516
+ header_params = {}
517
+ if request.name
518
+ header_params["name"] = request.name
519
+ end
520
+
453
521
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
454
522
  metadata[:"x-goog-request-params"] ||= request_params_header
455
523
 
456
524
  options.apply_defaults timeout: @config.rpcs.get_contact.timeout,
457
525
  metadata: metadata,
458
526
  retry_policy: @config.rpcs.get_contact.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
527
+
528
+ options.apply_defaults timeout: @config.timeout,
529
+ metadata: @config.metadata,
460
530
  retry_policy: @config.retry_policy
461
531
 
462
532
  @essential_contacts_service_stub.call_rpc :get_contact, request, options: options do |response, operation|
@@ -499,6 +569,21 @@ module Google
499
569
  #
500
570
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
501
571
  #
572
+ # @example Basic example
573
+ # require "google/cloud/essential_contacts/v1"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Google::Cloud::EssentialContacts::V1::DeleteContactRequest.new
580
+ #
581
+ # # Call the delete_contact method.
582
+ # result = client.delete_contact request
583
+ #
584
+ # # The returned object is of type Google::Protobuf::Empty.
585
+ # p result
586
+ #
502
587
  def delete_contact request, options = nil
503
588
  raise ::ArgumentError, "request must be provided" if request.nil?
504
589
 
@@ -516,16 +601,20 @@ module Google
516
601
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
517
602
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
518
603
 
519
- header_params = {
520
- "name" => request.name
521
- }
604
+ header_params = {}
605
+ if request.name
606
+ header_params["name"] = request.name
607
+ end
608
+
522
609
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
523
610
  metadata[:"x-goog-request-params"] ||= request_params_header
524
611
 
525
612
  options.apply_defaults timeout: @config.rpcs.delete_contact.timeout,
526
613
  metadata: metadata,
527
614
  retry_policy: @config.rpcs.delete_contact.retry_policy
528
- options.apply_defaults metadata: @config.metadata,
615
+
616
+ options.apply_defaults timeout: @config.timeout,
617
+ metadata: @config.metadata,
529
618
  retry_policy: @config.retry_policy
530
619
 
531
620
  @essential_contacts_service_stub.call_rpc :delete_contact, request, options: options do |response, operation|
@@ -583,6 +672,27 @@ module Google
583
672
  #
584
673
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
585
674
  #
675
+ # @example Basic example
676
+ # require "google/cloud/essential_contacts/v1"
677
+ #
678
+ # # Create a client object. The client can be reused for multiple calls.
679
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
680
+ #
681
+ # # Create a request. To set request fields, pass in keyword arguments.
682
+ # request = Google::Cloud::EssentialContacts::V1::ComputeContactsRequest.new
683
+ #
684
+ # # Call the compute_contacts method.
685
+ # result = client.compute_contacts request
686
+ #
687
+ # # The returned object is of type Gapic::PagedEnumerable. You can
688
+ # # iterate over all elements by calling #each, and the enumerable
689
+ # # will lazily make API calls to fetch subsequent pages. Other
690
+ # # methods are also available for managing paging directly.
691
+ # result.each do |response|
692
+ # # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact.
693
+ # p response
694
+ # end
695
+ #
586
696
  def compute_contacts request, options = nil
587
697
  raise ::ArgumentError, "request must be provided" if request.nil?
588
698
 
@@ -600,16 +710,20 @@ module Google
600
710
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
601
711
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
602
712
 
603
- header_params = {
604
- "parent" => request.parent
605
- }
713
+ header_params = {}
714
+ if request.parent
715
+ header_params["parent"] = request.parent
716
+ end
717
+
606
718
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
607
719
  metadata[:"x-goog-request-params"] ||= request_params_header
608
720
 
609
721
  options.apply_defaults timeout: @config.rpcs.compute_contacts.timeout,
610
722
  metadata: metadata,
611
723
  retry_policy: @config.rpcs.compute_contacts.retry_policy
612
- options.apply_defaults metadata: @config.metadata,
724
+
725
+ options.apply_defaults timeout: @config.timeout,
726
+ metadata: @config.metadata,
613
727
  retry_policy: @config.retry_policy
614
728
 
615
729
  @essential_contacts_service_stub.call_rpc :compute_contacts, request, options: options do |response, operation|
@@ -663,6 +777,21 @@ module Google
663
777
  #
664
778
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
665
779
  #
780
+ # @example Basic example
781
+ # require "google/cloud/essential_contacts/v1"
782
+ #
783
+ # # Create a client object. The client can be reused for multiple calls.
784
+ # client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new
785
+ #
786
+ # # Create a request. To set request fields, pass in keyword arguments.
787
+ # request = Google::Cloud::EssentialContacts::V1::SendTestMessageRequest.new
788
+ #
789
+ # # Call the send_test_message method.
790
+ # result = client.send_test_message request
791
+ #
792
+ # # The returned object is of type Google::Protobuf::Empty.
793
+ # p result
794
+ #
666
795
  def send_test_message request, options = nil
667
796
  raise ::ArgumentError, "request must be provided" if request.nil?
668
797
 
@@ -680,16 +809,20 @@ module Google
680
809
  gapic_version: ::Google::Cloud::EssentialContacts::V1::VERSION
681
810
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
682
811
 
683
- header_params = {
684
- "resource" => request.resource
685
- }
812
+ header_params = {}
813
+ if request.resource
814
+ header_params["resource"] = request.resource
815
+ end
816
+
686
817
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
687
818
  metadata[:"x-goog-request-params"] ||= request_params_header
688
819
 
689
820
  options.apply_defaults timeout: @config.rpcs.send_test_message.timeout,
690
821
  metadata: metadata,
691
822
  retry_policy: @config.rpcs.send_test_message.retry_policy
692
- options.apply_defaults metadata: @config.metadata,
823
+
824
+ options.apply_defaults timeout: @config.timeout,
825
+ metadata: @config.metadata,
693
826
  retry_policy: @config.retry_policy
694
827
 
695
828
  @essential_contacts_service_stub.call_rpc :send_test_message, request, options: options do |response, operation|
@@ -713,22 +846,21 @@ module Google
713
846
  # Configuration can be applied globally to all clients, or to a single client
714
847
  # on construction.
715
848
  #
716
- # # Examples
717
- #
718
- # To modify the global config, setting the timeout for create_contact
719
- # to 20 seconds, and all remaining timeouts to 10 seconds:
720
- #
721
- # ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.configure do |config|
722
- # config.timeout = 10.0
723
- # config.rpcs.create_contact.timeout = 20.0
724
- # end
725
- #
726
- # To apply the above configuration only to a new client:
727
- #
728
- # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config|
729
- # config.timeout = 10.0
730
- # config.rpcs.create_contact.timeout = 20.0
731
- # end
849
+ # @example
850
+ #
851
+ # # Modify the global config, setting the timeout for
852
+ # # create_contact to 20 seconds,
853
+ # # and all remaining timeouts to 10 seconds.
854
+ # ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.configure do |config|
855
+ # config.timeout = 10.0
856
+ # config.rpcs.create_contact.timeout = 20.0
857
+ # end
858
+ #
859
+ # # Apply the above configuration only to a new client.
860
+ # client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config|
861
+ # config.timeout = 10.0
862
+ # config.rpcs.create_contact.timeout = 20.0
863
+ # end
732
864
  #
733
865
  # @!attribute [rw] endpoint
734
866
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module EssentialContacts
23
23
  module V1
24
- VERSION = "0.1.0"
24
+ VERSION = "0.1.4"
25
25
  end
26
26
  end
27
27
  end
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/essentialcontacts/v1/service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -11,6 +9,8 @@ require 'google/cloud/essentialcontacts/v1/enums_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/field_mask_pb'
13
11
  require 'google/protobuf/timestamp_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/essentialcontacts/v1/service.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.essentialcontacts.v1.Contact" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Manages contacts for important Google Cloud notifications.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -60,6 +60,12 @@ module Google
60
60
  # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-essential_contacts-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2022-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.5'
19
+ version: '0.7'
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.5'
29
+ version: '0.7'
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.2.17
212
+ rubygems_version: 3.3.4
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: API Client library for the Essential Contacts V1 API