google-cloud-api_gateway-v1 0.2.0 → 0.4.0

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: cf08457a825f8d93a5b4acde15f311b7360aaa43ddf6d786594e8b91f4d02dc8
4
- data.tar.gz: fdba547a70c8b9ece6f25295b135da295a5e1675736019f1ae5cbfed4077b8df
3
+ metadata.gz: fcb83e2b772cbc09b4eeadd9c08e95e74a31d0c87fbd45b80a8436457c592d95
4
+ data.tar.gz: 45274ef63a4b8ef2d42ca1065175aa86a7d6a741c5806c0c941d1c3d4519ccf6
5
5
  SHA512:
6
- metadata.gz: 9bfbac1960092a80a8163d9f62ab9ad1a40ee6d729d87c801975edac85db77b235346129b760b41fdefdc3730f8c6db93772e3d0e102d2a119de469b4974c24c
7
- data.tar.gz: 1d9395d20153f0c01e2b0d0e83e90402f2814d1421adfc8e164fa6fa0f6d9c409833a02507ffce157727a6adc9c055a7d4e394194b37f6d642aefa5a3225ee5a
6
+ metadata.gz: f0a6a66f6dd70a8e4e1076308a6045d4f398def0127358594758ff03d85e09a731de47a71a60382e018b935268867aad5c8c12b4dce4596222dc2cfbed32f916
7
+ data.tar.gz: 4b8645013351e885cbfbb050e0522756100498b0f70c602713beb5f0a224a9f28d9c30661e2180222fa3811348e11419fedd2dd48392c858426ae0b2482c4410
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,8 +46,8 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -168,7 +168,7 @@ module Google
168
168
  credentials = @config.credentials
169
169
  # Use self-signed JWT if the endpoint is unchanged from default,
170
170
  # but only if the default endpoint does not have a region prefix.
171
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
171
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
172
172
  !@config.endpoint.split(".").first.include?("-")
173
173
  credentials ||= Credentials.default scope: @config.scope,
174
174
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -252,13 +252,11 @@ module Google
252
252
  # # Call the list_gateways method.
253
253
  # result = client.list_gateways request
254
254
  #
255
- # # The returned object is of type Gapic::PagedEnumerable. You can
256
- # # iterate over all elements by calling #each, and the enumerable
257
- # # will lazily make API calls to fetch subsequent pages. Other
258
- # # methods are also available for managing paging directly.
259
- # result.each do |response|
255
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
256
+ # # over elements, and API calls will be issued to fetch pages as needed.
257
+ # result.each do |item|
260
258
  # # Each element is of type ::Google::Cloud::ApiGateway::V1::Gateway.
261
- # p response
259
+ # p item
262
260
  # end
263
261
  #
264
262
  def list_gateways request, options = nil
@@ -436,14 +434,14 @@ module Google
436
434
  # # Call the create_gateway method.
437
435
  # result = client.create_gateway request
438
436
  #
439
- # # The returned object is of type Gapic::Operation. You can use this
440
- # # object to check the status of an operation, cancel it, or wait
441
- # # for results. Here is how to block until completion:
437
+ # # The returned object is of type Gapic::Operation. You can use it to
438
+ # # check the status of an operation, cancel it, or wait for results.
439
+ # # Here is how to wait for a response.
442
440
  # result.wait_until_done! timeout: 60
443
441
  # if result.response?
444
442
  # p result.response
445
443
  # else
446
- # puts "Error!"
444
+ # puts "No response received."
447
445
  # end
448
446
  #
449
447
  def create_gateway request, options = nil
@@ -535,14 +533,14 @@ module Google
535
533
  # # Call the update_gateway method.
536
534
  # result = client.update_gateway request
537
535
  #
538
- # # The returned object is of type Gapic::Operation. You can use this
539
- # # object to check the status of an operation, cancel it, or wait
540
- # # for results. Here is how to block until completion:
536
+ # # The returned object is of type Gapic::Operation. You can use it to
537
+ # # check the status of an operation, cancel it, or wait for results.
538
+ # # Here is how to wait for a response.
541
539
  # result.wait_until_done! timeout: 60
542
540
  # if result.response?
543
541
  # p result.response
544
542
  # else
545
- # puts "Error!"
543
+ # puts "No response received."
546
544
  # end
547
545
  #
548
546
  def update_gateway request, options = nil
@@ -629,14 +627,14 @@ module Google
629
627
  # # Call the delete_gateway method.
630
628
  # result = client.delete_gateway request
631
629
  #
632
- # # The returned object is of type Gapic::Operation. You can use this
633
- # # object to check the status of an operation, cancel it, or wait
634
- # # for results. Here is how to block until completion:
630
+ # # The returned object is of type Gapic::Operation. You can use it to
631
+ # # check the status of an operation, cancel it, or wait for results.
632
+ # # Here is how to wait for a response.
635
633
  # result.wait_until_done! timeout: 60
636
634
  # if result.response?
637
635
  # p result.response
638
636
  # else
639
- # puts "Error!"
637
+ # puts "No response received."
640
638
  # end
641
639
  #
642
640
  def delete_gateway request, options = nil
@@ -731,13 +729,11 @@ module Google
731
729
  # # Call the list_apis method.
732
730
  # result = client.list_apis request
733
731
  #
734
- # # The returned object is of type Gapic::PagedEnumerable. You can
735
- # # iterate over all elements by calling #each, and the enumerable
736
- # # will lazily make API calls to fetch subsequent pages. Other
737
- # # methods are also available for managing paging directly.
738
- # result.each do |response|
732
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
733
+ # # over elements, and API calls will be issued to fetch pages as needed.
734
+ # result.each do |item|
739
735
  # # Each element is of type ::Google::Cloud::ApiGateway::V1::Api.
740
- # p response
736
+ # p item
741
737
  # end
742
738
  #
743
739
  def list_apis request, options = nil
@@ -915,14 +911,14 @@ module Google
915
911
  # # Call the create_api method.
916
912
  # result = client.create_api request
917
913
  #
918
- # # The returned object is of type Gapic::Operation. You can use this
919
- # # object to check the status of an operation, cancel it, or wait
920
- # # for results. Here is how to block until completion:
914
+ # # The returned object is of type Gapic::Operation. You can use it to
915
+ # # check the status of an operation, cancel it, or wait for results.
916
+ # # Here is how to wait for a response.
921
917
  # result.wait_until_done! timeout: 60
922
918
  # if result.response?
923
919
  # p result.response
924
920
  # else
925
- # puts "Error!"
921
+ # puts "No response received."
926
922
  # end
927
923
  #
928
924
  def create_api request, options = nil
@@ -1014,14 +1010,14 @@ module Google
1014
1010
  # # Call the update_api method.
1015
1011
  # result = client.update_api request
1016
1012
  #
1017
- # # The returned object is of type Gapic::Operation. You can use this
1018
- # # object to check the status of an operation, cancel it, or wait
1019
- # # for results. Here is how to block until completion:
1013
+ # # The returned object is of type Gapic::Operation. You can use it to
1014
+ # # check the status of an operation, cancel it, or wait for results.
1015
+ # # Here is how to wait for a response.
1020
1016
  # result.wait_until_done! timeout: 60
1021
1017
  # if result.response?
1022
1018
  # p result.response
1023
1019
  # else
1024
- # puts "Error!"
1020
+ # puts "No response received."
1025
1021
  # end
1026
1022
  #
1027
1023
  def update_api request, options = nil
@@ -1108,14 +1104,14 @@ module Google
1108
1104
  # # Call the delete_api method.
1109
1105
  # result = client.delete_api request
1110
1106
  #
1111
- # # The returned object is of type Gapic::Operation. You can use this
1112
- # # object to check the status of an operation, cancel it, or wait
1113
- # # for results. Here is how to block until completion:
1107
+ # # The returned object is of type Gapic::Operation. You can use it to
1108
+ # # check the status of an operation, cancel it, or wait for results.
1109
+ # # Here is how to wait for a response.
1114
1110
  # result.wait_until_done! timeout: 60
1115
1111
  # if result.response?
1116
1112
  # p result.response
1117
1113
  # else
1118
- # puts "Error!"
1114
+ # puts "No response received."
1119
1115
  # end
1120
1116
  #
1121
1117
  def delete_api request, options = nil
@@ -1210,13 +1206,11 @@ module Google
1210
1206
  # # Call the list_api_configs method.
1211
1207
  # result = client.list_api_configs request
1212
1208
  #
1213
- # # The returned object is of type Gapic::PagedEnumerable. You can
1214
- # # iterate over all elements by calling #each, and the enumerable
1215
- # # will lazily make API calls to fetch subsequent pages. Other
1216
- # # methods are also available for managing paging directly.
1217
- # result.each do |response|
1209
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1210
+ # # over elements, and API calls will be issued to fetch pages as needed.
1211
+ # result.each do |item|
1218
1212
  # # Each element is of type ::Google::Cloud::ApiGateway::V1::ApiConfig.
1219
- # p response
1213
+ # p item
1220
1214
  # end
1221
1215
  #
1222
1216
  def list_api_configs request, options = nil
@@ -1397,14 +1391,14 @@ module Google
1397
1391
  # # Call the create_api_config method.
1398
1392
  # result = client.create_api_config request
1399
1393
  #
1400
- # # The returned object is of type Gapic::Operation. You can use this
1401
- # # object to check the status of an operation, cancel it, or wait
1402
- # # for results. Here is how to block until completion:
1394
+ # # The returned object is of type Gapic::Operation. You can use it to
1395
+ # # check the status of an operation, cancel it, or wait for results.
1396
+ # # Here is how to wait for a response.
1403
1397
  # result.wait_until_done! timeout: 60
1404
1398
  # if result.response?
1405
1399
  # p result.response
1406
1400
  # else
1407
- # puts "Error!"
1401
+ # puts "No response received."
1408
1402
  # end
1409
1403
  #
1410
1404
  def create_api_config request, options = nil
@@ -1496,14 +1490,14 @@ module Google
1496
1490
  # # Call the update_api_config method.
1497
1491
  # result = client.update_api_config request
1498
1492
  #
1499
- # # The returned object is of type Gapic::Operation. You can use this
1500
- # # object to check the status of an operation, cancel it, or wait
1501
- # # for results. Here is how to block until completion:
1493
+ # # The returned object is of type Gapic::Operation. You can use it to
1494
+ # # check the status of an operation, cancel it, or wait for results.
1495
+ # # Here is how to wait for a response.
1502
1496
  # result.wait_until_done! timeout: 60
1503
1497
  # if result.response?
1504
1498
  # p result.response
1505
1499
  # else
1506
- # puts "Error!"
1500
+ # puts "No response received."
1507
1501
  # end
1508
1502
  #
1509
1503
  def update_api_config request, options = nil
@@ -1590,14 +1584,14 @@ module Google
1590
1584
  # # Call the delete_api_config method.
1591
1585
  # result = client.delete_api_config request
1592
1586
  #
1593
- # # The returned object is of type Gapic::Operation. You can use this
1594
- # # object to check the status of an operation, cancel it, or wait
1595
- # # for results. Here is how to block until completion:
1587
+ # # The returned object is of type Gapic::Operation. You can use it to
1588
+ # # check the status of an operation, cancel it, or wait for results.
1589
+ # # Here is how to wait for a response.
1596
1590
  # result.wait_until_done! timeout: 60
1597
1591
  # if result.response?
1598
1592
  # p result.response
1599
1593
  # else
1600
- # puts "Error!"
1594
+ # puts "No response received."
1601
1595
  # end
1602
1596
  #
1603
1597
  def delete_api_config request, options = nil
@@ -1680,9 +1674,9 @@ module Google
1680
1674
  # * (`String`) The path to a service account key file in JSON format
1681
1675
  # * (`Hash`) A service account key as a Hash
1682
1676
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1683
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1677
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1684
1678
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1685
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1679
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1686
1680
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1687
1681
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1688
1682
  # * (`nil`) indicating no credentials
@@ -1724,7 +1718,9 @@ module Google
1724
1718
  class Configuration
1725
1719
  extend ::Gapic::Config
1726
1720
 
1727
- config_attr :endpoint, "apigateway.googleapis.com", ::String
1721
+ DEFAULT_ENDPOINT = "apigateway.googleapis.com"
1722
+
1723
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1728
1724
  config_attr :credentials, nil do |value|
1729
1725
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1730
1726
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -622,9 +620,9 @@ module Google
622
620
  # * (`String`) The path to a service account key file in JSON format
623
621
  # * (`Hash`) A service account key as a Hash
624
622
  # * (`Google::Auth::Credentials`) A googleauth credentials object
625
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
623
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
626
624
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
627
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
625
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
628
626
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
629
627
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
630
628
  # * (`nil`) indicating no credentials
@@ -666,7 +664,9 @@ module Google
666
664
  class Configuration
667
665
  extend ::Gapic::Config
668
666
 
669
- config_attr :endpoint, "apigateway.googleapis.com", ::String
667
+ DEFAULT_ENDPOINT = "apigateway.googleapis.com"
668
+
669
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
670
670
  config_attr :credentials, nil do |value|
671
671
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
672
672
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC