google-cloud-service_directory-v1 0.3.2 → 0.3.6

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: 0222cd31287ee425eb3ee5cff0d991fdb3c4b299ef259158063bbc7eb81c0018
4
- data.tar.gz: dfbc5981b4cfa8dfbf9191915f4c24fff0552db9e2219aa55bc94463f7582a57
3
+ metadata.gz: add551a374838cea816f62ca5128c16f23f5913e455ae84915417ec93daebd1b
4
+ data.tar.gz: 26b37e7584b78c5ff230ac65cde679906fcdc13bfe4471e185c48ba51ed5db1a
5
5
  SHA512:
6
- metadata.gz: 688405fecec04431d59e3a9f82aca0b9c1f1dc207b7a8951c5b0d1816b35b59fb43725f11afb0bc30e4c9dc20066095ed3a6ba7470c5bcd11d9c1b04c27128fa
7
- data.tar.gz: dfcb0196b7f616bae82f76993de6a31cc1f9ed743eb334f7d050fb0eec7d7a658e9a1876b63b35759f4eee7cb5cf9de8ab4af29e754653f16910dd14a8d68b53
6
+ metadata.gz: 9c6252683a0cb8e7bd700569013193ab7169e7b8ddbac3fbe3b784fdc23cc6b56c2232d5df541bbe60d5c72c4229b2049e4a114ce858c5124a7e1a8ad9c875db
7
+ data.tar.gz: 2073cd1daf9680f1ed8aecf7a7fc9836a53e09476cc013ee7bb1d191f9a4c6fb664cc53c4945fe508c870eac18840143352e4d18f2d32688ba17295ff822a925
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Service Directory V1 API
2
+ --title="Service Directory V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -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.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::ServiceDirectory::V1::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::V1::LookupService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all LookupService clients
47
+ # ::Google::Cloud::ServiceDirectory::V1::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]
@@ -99,19 +98,15 @@ module Google
99
98
  ##
100
99
  # Create a new LookupService client object.
101
100
  #
102
- # ## Examples
103
- #
104
- # To create a new LookupService client with the default
105
- # configuration:
101
+ # @example
106
102
  #
107
- # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new
108
105
  #
109
- # To create a new LookupService client with a custom
110
- # configuration:
111
- #
112
- # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
113
- # config.timeout = 10.0
114
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
115
110
  #
116
111
  # @yield [config] Configure the LookupService client.
117
112
  # @yieldparam config [Client::Configuration]
@@ -131,10 +126,9 @@ module Google
131
126
 
132
127
  # Create credentials
133
128
  credentials = @config.credentials
134
- # 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,
135
130
  # but only if the default endpoint does not have a region prefix.
136
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
137
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
132
  !@config.endpoint.split(".").first.include?("-")
139
133
  credentials ||= Credentials.default scope: @config.scope,
140
134
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -209,6 +203,21 @@ module Google
209
203
  #
210
204
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
211
205
  #
206
+ # @example Basic example
207
+ # require "google/cloud/service_directory/v1"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new
214
+ #
215
+ # # Call the resolve_service method.
216
+ # result = client.resolve_service request
217
+ #
218
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.
219
+ # p result
220
+ #
212
221
  def resolve_service request, options = nil
213
222
  raise ::ArgumentError, "request must be provided" if request.nil?
214
223
 
@@ -226,16 +235,20 @@ module Google
226
235
  gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION
227
236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
228
237
 
229
- header_params = {
230
- "name" => request.name
231
- }
238
+ header_params = {}
239
+ if request.name
240
+ header_params["name"] = request.name
241
+ end
242
+
232
243
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
233
244
  metadata[:"x-goog-request-params"] ||= request_params_header
234
245
 
235
246
  options.apply_defaults timeout: @config.rpcs.resolve_service.timeout,
236
247
  metadata: metadata,
237
248
  retry_policy: @config.rpcs.resolve_service.retry_policy
238
- options.apply_defaults metadata: @config.metadata,
249
+
250
+ options.apply_defaults timeout: @config.timeout,
251
+ metadata: @config.metadata,
239
252
  retry_policy: @config.retry_policy
240
253
 
241
254
  @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation|
@@ -259,22 +272,21 @@ module Google
259
272
  # Configuration can be applied globally to all clients, or to a single client
260
273
  # on construction.
261
274
  #
262
- # # Examples
263
- #
264
- # To modify the global config, setting the timeout for resolve_service
265
- # to 20 seconds, and all remaining timeouts to 10 seconds:
266
- #
267
- # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config|
268
- # config.timeout = 10.0
269
- # config.rpcs.resolve_service.timeout = 20.0
270
- # end
271
- #
272
- # To apply the above configuration only to a new client:
273
- #
274
- # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
275
- # config.timeout = 10.0
276
- # config.rpcs.resolve_service.timeout = 20.0
277
- # end
275
+ # @example
276
+ #
277
+ # # Modify the global config, setting the timeout for
278
+ # # resolve_service to 20 seconds,
279
+ # # and all remaining timeouts to 10 seconds.
280
+ # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config|
281
+ # config.timeout = 10.0
282
+ # config.rpcs.resolve_service.timeout = 20.0
283
+ # end
284
+ #
285
+ # # Apply the above configuration only to a new client.
286
+ # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config|
287
+ # config.timeout = 10.0
288
+ # config.rpcs.resolve_service.timeout = 20.0
289
+ # end
278
290
  #
279
291
  # @!attribute [rw] endpoint
280
292
  # The hostname or hostname:port of the service endpoint.