google-cloud-service_directory-v1beta1 0.7.0 → 0.7.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9dbd5753cd1f9cdaa0ef5ea57d5c720ebc2731900c3224c9a4296bfb50a942b0
4
- data.tar.gz: 42125fbf91f807801f8171b3424538221d4a713b5233ac8c75e49e946506d2ae
3
+ metadata.gz: f5a271b2f883314b663b13a50a4ee651d24d095b563754ef9151f4da36b62e16
4
+ data.tar.gz: 8f6dd6508066f7535cb0da0d0ea98bd3a23ebed348bd3a25d2c43019e300aef4
5
5
  SHA512:
6
- metadata.gz: 878b03786e5fb06d9dd4a1e829759a5f24496f80c1a76cc020ef42455f6b7286a5258c200682b1d6aa4f1a760affeff10527322b169d0e56ef4f89a50f60887c
7
- data.tar.gz: '03561611104928b7ff027601d15b442359344c18ed55985d4e8de01dbf974a4403a4fddbc8778334d982a127a0ba16a258421a6cb55520c5ae9bb3eaf182cacb'
6
+ metadata.gz: 81bea97ddbc9b9b5990a1b29f159ae23511ac5cee0552a3e4bbe5af0a8eb4131dbb7a6cbdcca28ed4a0408be3eb5991866ff54673fd24290c48103043bb12cd6
7
+ data.tar.gz: be0ffc3af76acc8eebc158efb4172dccb03b8a0672c1fe6e5c671744ff14257334a7bba210d801c3b278a7388b433fc0ce842c127ca81f3995908ad25b71dfb7
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Service Directory V1beta1 API
2
+ --title="Service Directory V1beta1 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-service_directory-v1beta1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Credentials}):
68
68
 
69
- 1. `SERVICE_DIRECTORY_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `SERVICE_DIRECTORY_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
+ * `SERVICE_DIRECTORY_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `SERVICE_DIRECTORY_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/service_directory/v1beta1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new
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/service_directory/v1beta1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new d
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/service_directory/v1beta1"
@@ -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/service_directory/v1beta1"
34
34
 
35
35
  client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new # (request fields as keyword arguments...)
37
37
  response = client.resolve_service request
38
38
  ```
39
39
 
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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 LookupService clients:
47
- #
48
- # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all LookupService clients
47
+ # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.timeout = 15.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 1.0,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14, 2]
69
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2]
74
70
  }
75
71
 
76
72
  default_config
@@ -102,19 +98,15 @@ module Google
102
98
  ##
103
99
  # Create a new LookupService client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new LookupService client with the default
108
- # configuration:
101
+ # @example
109
102
  #
110
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new
111
105
  #
112
- # To create a new LookupService client with a custom
113
- # configuration:
114
- #
115
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config|
116
- # config.timeout = 10.0
117
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the LookupService client.
120
112
  # @yieldparam config [Client::Configuration]
@@ -134,14 +126,13 @@ module Google
134
126
 
135
127
  # Create credentials
136
128
  credentials = @config.credentials
137
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
130
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
132
  !@config.endpoint.split(".").first.include?("-")
142
133
  credentials ||= Credentials.default scope: @config.scope,
143
134
  enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
136
  credentials = Credentials.new credentials, scope: @config.scope
146
137
  end
147
138
  @quota_project_id = @config.quota_project
@@ -227,6 +218,21 @@ module Google
227
218
  #
228
219
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
229
220
  #
221
+ # @example Basic example
222
+ # require "google/cloud/service_directory/v1beta1"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new
229
+ #
230
+ # # Call the resolve_service method.
231
+ # result = client.resolve_service request
232
+ #
233
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.
234
+ # p result
235
+ #
230
236
  def resolve_service request, options = nil
231
237
  raise ::ArgumentError, "request must be provided" if request.nil?
232
238
 
@@ -244,16 +250,20 @@ module Google
244
250
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
245
251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
246
252
 
247
- header_params = {
248
- "name" => request.name
249
- }
253
+ header_params = {}
254
+ if request.name
255
+ header_params["name"] = request.name
256
+ end
257
+
250
258
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
251
259
  metadata[:"x-goog-request-params"] ||= request_params_header
252
260
 
253
261
  options.apply_defaults timeout: @config.rpcs.resolve_service.timeout,
254
262
  metadata: metadata,
255
263
  retry_policy: @config.rpcs.resolve_service.retry_policy
256
- options.apply_defaults metadata: @config.metadata,
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
257
267
  retry_policy: @config.retry_policy
258
268
 
259
269
  @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation|
@@ -277,22 +287,21 @@ module Google
277
287
  # Configuration can be applied globally to all clients, or to a single client
278
288
  # on construction.
279
289
  #
280
- # # Examples
281
- #
282
- # To modify the global config, setting the timeout for resolve_service
283
- # to 20 seconds, and all remaining timeouts to 10 seconds:
284
- #
285
- # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config|
286
- # config.timeout = 10.0
287
- # config.rpcs.resolve_service.timeout = 20.0
288
- # end
289
- #
290
- # To apply the above configuration only to a new client:
291
- #
292
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config|
293
- # config.timeout = 10.0
294
- # config.rpcs.resolve_service.timeout = 20.0
295
- # end
290
+ # @example
291
+ #
292
+ # # Modify the global config, setting the timeout for
293
+ # # resolve_service to 20 seconds,
294
+ # # and all remaining timeouts to 10 seconds.
295
+ # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config|
296
+ # config.timeout = 10.0
297
+ # config.rpcs.resolve_service.timeout = 20.0
298
+ # end
299
+ #
300
+ # # Apply the above configuration only to a new client.
301
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config|
302
+ # config.timeout = 10.0
303
+ # config.rpcs.resolve_service.timeout = 20.0
304
+ # end
296
305
  #
297
306
  # @!attribute [rw] endpoint
298
307
  # The hostname or hostname:port of the service endpoint.