google-cloud-translate-v3 1.1.1 → 1.3.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: a1fc2b1914d1ba875131cc8925c88e150f74c973402a39d2b04ef3c3db10ece4
4
- data.tar.gz: b1268089dbbb59c346cbdb0361edef8eeefe31c18531d6511d49821da8c4cdc9
3
+ metadata.gz: 6fb1a41f87d23bfedd751f7aada04345edc7878ced33397db72db1818d8d4d57
4
+ data.tar.gz: '083dd68f5c3da20db363953bb66380fbb55476e5311cc3e9034e53cdc9ae2f19'
5
5
  SHA512:
6
- metadata.gz: 7f2d9a2d0c11c9e6eff65c41895f15ef1804afe288e11f43a16aaa0199b0d482e847c7ba12e4093ada342b87e1247350f41dfaaabe72771c1ff19de4c024355a
7
- data.tar.gz: cc39650cc47f4959cf7297f98f621dc67057fa6f8b601f1db1dbf82351c5df408838381d2914b80986b750b9a34a050c783646e70b43fbd327666f54c5d452f0
6
+ metadata.gz: 846dcd55e6018a2c2b275e0c2743ca4da92bc30a5c3af3e028764a3f2f68b01d06c1c5f17774775614b66f448e13ba91899d5076e6ef037524f98202a301b625
7
+ data.tar.gz: d991d41563edcfcb48177266c873e08a5603ae1d78e781809370f101483e9d8b37d691a4687513cde3eb180554227d65c49fd73f90cc194e508d05d8c90424a9
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/translate)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
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/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
- 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
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/translate/v3"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -10,7 +10,7 @@ require 'google/cloud/translate/v3/common_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
11
 
12
12
 
13
- descriptor_data = "\n+google/cloud/translate/v3/adaptive_mt.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa1\x03\n\x11\x41\x64\x61ptiveMtDataset\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x15\n\rexample_count\x18\x05 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:u\xea\x41r\n*translate.googleapis.com/AdaptiveMtDataset\x12\x44projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}\"\xad\x01\n\x1e\x43reateAdaptiveMtDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12P\n\x13\x61\x64\x61ptive_mt_dataset\x18\x02 \x01(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x02\"b\n\x1e\x44\x65leteAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"_\n\x1bGetAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"\xa0\x01\n\x1dListAdaptiveMtDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x1eListAdaptiveMtDatasetsResponse\x12Q\n\x14\x61\x64\x61ptive_mt_datasets\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xdd\x07\n\x1a\x41\x64\x61ptiveMtTranslateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x07\x64\x61taset\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x07\x63ontent\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12w\n\x19reference_sentence_config\x18\x06 \x01(\x0b\x32O.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfigH\x00\x88\x01\x01\x12i\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x46.google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1aI\n\x15ReferenceSentencePair\x12\x17\n\x0fsource_sentence\x18\x01 \x01(\t\x12\x17\n\x0ftarget_sentence\x18\x02 \x01(\t\x1a\x8c\x01\n\x19ReferenceSentencePairList\x12o\n\x18reference_sentence_pairs\x18\x01 \x03(\x0b\x32M.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair\x1a\xcf\x01\n\x17ReferenceSentenceConfig\x12x\n\x1dreference_sentence_pair_lists\x18\x01 \x03(\x0b\x32Q.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t\x1ag\n\x0eGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1c\n\x1a_reference_sentence_configB\x12\n\x10_glossary_config\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1b\x41\x64\x61ptiveMtTranslateResponse\x12M\n\x0ctranslations\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslationB\x03\xe0\x41\x03\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x15glossary_translations\x18\x04 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslation\"\x94\x03\n\x0e\x41\x64\x61ptiveMtFile\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xab\x01\xea\x41\xa7\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}*\x0f\x61\x64\x61ptiveMtFiles2\x0e\x61\x64\x61ptiveMtFile\"Y\n\x18GetAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\\\n\x1b\x44\x65leteAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\xff\x01\n\x1bImportAdaptiveMtFileRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12I\n\x11\x66ile_input_source\x18\x02 \x01(\x0b\x32,.google.cloud.translation.v3.FileInputSourceH\x00\x12G\n\x10gcs_input_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"j\n\x1cImportAdaptiveMtFileResponse\x12J\n\x10\x61\x64\x61ptive_mt_file\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\"\x91\x01\n\x1aListAdaptiveMtFilesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x88\x01\n\x1bListAdaptiveMtFilesResponse\x12K\n\x11\x61\x64\x61ptive_mt_files\x18\x01 \x03(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xd8\x03\n\x12\x41\x64\x61ptiveMtSentence\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+translate.googleapis.com/AdaptiveMtSentence\x12\x1c\n\x0fsource_sentence\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarget_sentence\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xd6\x01\xea\x41\xd2\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}*\x13\x61\x64\x61ptiveMtSentences2\x12\x61\x64\x61ptiveMtSentence\"\x88\x01\n\x1eListAdaptiveMtSentencesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x94\x01\n\x1fListAdaptiveMtSentencesResponse\x12S\n\x15\x61\x64\x61ptive_mt_sentences\x18\x01 \x03(\x0b\x32/.google.cloud.translation.v3.AdaptiveMtSentenceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\xc9\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\x06proto3"
13
+ descriptor_data = "\n+google/cloud/translate/v3/adaptive_mt.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa1\x03\n\x11\x41\x64\x61ptiveMtDataset\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x15\n\rexample_count\x18\x05 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:u\xea\x41r\n*translate.googleapis.com/AdaptiveMtDataset\x12\x44projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}\"\xad\x01\n\x1e\x43reateAdaptiveMtDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12P\n\x13\x61\x64\x61ptive_mt_dataset\x18\x02 \x01(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x02\"b\n\x1e\x44\x65leteAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"_\n\x1bGetAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"\xa0\x01\n\x1dListAdaptiveMtDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x1eListAdaptiveMtDatasetsResponse\x12Q\n\x14\x61\x64\x61ptive_mt_datasets\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8b\x08\n\x1a\x41\x64\x61ptiveMtTranslateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x07\x64\x61taset\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x07\x63ontent\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12w\n\x19reference_sentence_config\x18\x06 \x01(\x0b\x32O.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfigH\x00\x88\x01\x01\x12i\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x46.google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1aI\n\x15ReferenceSentencePair\x12\x17\n\x0fsource_sentence\x18\x01 \x01(\t\x12\x17\n\x0ftarget_sentence\x18\x02 \x01(\t\x1a\x8c\x01\n\x19ReferenceSentencePairList\x12o\n\x18reference_sentence_pairs\x18\x01 \x03(\x0b\x32M.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair\x1a\xcf\x01\n\x17ReferenceSentenceConfig\x12x\n\x1dreference_sentence_pair_lists\x18\x01 \x03(\x0b\x32Q.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t\x1a\x94\x01\n\x0eGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1e\x63ontextual_translation_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1c\n\x1a_reference_sentence_configB\x12\n\x10_glossary_config\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1b\x41\x64\x61ptiveMtTranslateResponse\x12M\n\x0ctranslations\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslationB\x03\xe0\x41\x03\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x15glossary_translations\x18\x04 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslation\"\x94\x03\n\x0e\x41\x64\x61ptiveMtFile\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xab\x01\xea\x41\xa7\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}*\x0f\x61\x64\x61ptiveMtFiles2\x0e\x61\x64\x61ptiveMtFile\"Y\n\x18GetAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\\\n\x1b\x44\x65leteAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\xff\x01\n\x1bImportAdaptiveMtFileRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12I\n\x11\x66ile_input_source\x18\x02 \x01(\x0b\x32,.google.cloud.translation.v3.FileInputSourceH\x00\x12G\n\x10gcs_input_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"j\n\x1cImportAdaptiveMtFileResponse\x12J\n\x10\x61\x64\x61ptive_mt_file\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\"\x91\x01\n\x1aListAdaptiveMtFilesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x88\x01\n\x1bListAdaptiveMtFilesResponse\x12K\n\x11\x61\x64\x61ptive_mt_files\x18\x01 \x03(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xd8\x03\n\x12\x41\x64\x61ptiveMtSentence\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+translate.googleapis.com/AdaptiveMtSentence\x12\x1c\n\x0fsource_sentence\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarget_sentence\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xd6\x01\xea\x41\xd2\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}*\x13\x61\x64\x61ptiveMtSentences2\x12\x61\x64\x61ptiveMtSentence\"\x88\x01\n\x1eListAdaptiveMtSentencesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x94\x01\n\x1fListAdaptiveMtSentencesResponse\x12S\n\x15\x61\x64\x61ptive_mt_sentences\x18\x01 \x03(\x0b\x32/.google.cloud.translation.v3.AdaptiveMtSentenceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\xc9\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\x06proto3"
14
14
 
15
15
  pool = Google::Protobuf::DescriptorPool.generated_pool
16
16
 
@@ -198,14 +198,26 @@ module Google
198
198
  universe_domain: @config.universe_domain,
199
199
  channel_args: @config.channel_args,
200
200
  interceptors: @config.interceptors,
201
- channel_pool_config: @config.channel_pool
201
+ channel_pool_config: @config.channel_pool,
202
+ logger: @config.logger
202
203
  )
203
204
 
205
+ @translation_service_stub.stub_logger&.info do |entry|
206
+ entry.set_system_name
207
+ entry.set_service
208
+ entry.message = "Created client for #{entry.service}"
209
+ entry.set_credentials_fields credentials
210
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
211
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
212
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
213
+ end
214
+
204
215
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
205
216
  config.credentials = credentials
206
217
  config.quota_project = @quota_project_id
207
218
  config.endpoint = @translation_service_stub.endpoint
208
219
  config.universe_domain = @translation_service_stub.universe_domain
220
+ config.logger = @translation_service_stub.logger if config.respond_to? :logger=
209
221
  end
210
222
 
211
223
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -213,6 +225,7 @@ module Google
213
225
  config.quota_project = @quota_project_id
214
226
  config.endpoint = @translation_service_stub.endpoint
215
227
  config.universe_domain = @translation_service_stub.universe_domain
228
+ config.logger = @translation_service_stub.logger if config.respond_to? :logger=
216
229
  end
217
230
  end
218
231
 
@@ -237,6 +250,15 @@ module Google
237
250
  #
238
251
  attr_reader :iam_policy_client
239
252
 
253
+ ##
254
+ # The logger used for request/response debug logging.
255
+ #
256
+ # @return [Logger]
257
+ #
258
+ def logger
259
+ @translation_service_stub.logger
260
+ end
261
+
240
262
  # Service calls
241
263
 
242
264
  ##
@@ -383,7 +405,6 @@ module Google
383
405
 
384
406
  @translation_service_stub.call_rpc :translate_text, request, options: options do |response, operation|
385
407
  yield response, operation if block_given?
386
- return response
387
408
  end
388
409
  rescue ::GRPC::BadStatus => e
389
410
  raise ::Google::Cloud::Error.from_error(e)
@@ -483,7 +504,6 @@ module Google
483
504
 
484
505
  @translation_service_stub.call_rpc :romanize_text, request, options: options do |response, operation|
485
506
  yield response, operation if block_given?
486
- return response
487
507
  end
488
508
  rescue ::GRPC::BadStatus => e
489
509
  raise ::Google::Cloud::Error.from_error(e)
@@ -604,7 +624,6 @@ module Google
604
624
 
605
625
  @translation_service_stub.call_rpc :detect_language, request, options: options do |response, operation|
606
626
  yield response, operation if block_given?
607
- return response
608
627
  end
609
628
  rescue ::GRPC::BadStatus => e
610
629
  raise ::Google::Cloud::Error.from_error(e)
@@ -720,7 +739,6 @@ module Google
720
739
 
721
740
  @translation_service_stub.call_rpc :get_supported_languages, request, options: options do |response, operation|
722
741
  yield response, operation if block_given?
723
- return response
724
742
  end
725
743
  rescue ::GRPC::BadStatus => e
726
744
  raise ::Google::Cloud::Error.from_error(e)
@@ -879,7 +897,6 @@ module Google
879
897
 
880
898
  @translation_service_stub.call_rpc :translate_document, request, options: options do |response, operation|
881
899
  yield response, operation if block_given?
882
- return response
883
900
  end
884
901
  rescue ::GRPC::BadStatus => e
885
902
  raise ::Google::Cloud::Error.from_error(e)
@@ -1029,7 +1046,7 @@ module Google
1029
1046
  @translation_service_stub.call_rpc :batch_translate_text, request, options: options do |response, operation|
1030
1047
  response = ::Gapic::Operation.new response, @operations_client, options: options
1031
1048
  yield response, operation if block_given?
1032
- return response
1049
+ throw :response, response
1033
1050
  end
1034
1051
  rescue ::GRPC::BadStatus => e
1035
1052
  raise ::Google::Cloud::Error.from_error(e)
@@ -1194,7 +1211,7 @@ module Google
1194
1211
  @translation_service_stub.call_rpc :batch_translate_document, request, options: options do |response, operation|
1195
1212
  response = ::Gapic::Operation.new response, @operations_client, options: options
1196
1213
  yield response, operation if block_given?
1197
- return response
1214
+ throw :response, response
1198
1215
  end
1199
1216
  rescue ::GRPC::BadStatus => e
1200
1217
  raise ::Google::Cloud::Error.from_error(e)
@@ -1291,7 +1308,7 @@ module Google
1291
1308
  @translation_service_stub.call_rpc :create_glossary, request, options: options do |response, operation|
1292
1309
  response = ::Gapic::Operation.new response, @operations_client, options: options
1293
1310
  yield response, operation if block_given?
1294
- return response
1311
+ throw :response, response
1295
1312
  end
1296
1313
  rescue ::GRPC::BadStatus => e
1297
1314
  raise ::Google::Cloud::Error.from_error(e)
@@ -1389,7 +1406,7 @@ module Google
1389
1406
  @translation_service_stub.call_rpc :update_glossary, request, options: options do |response, operation|
1390
1407
  response = ::Gapic::Operation.new response, @operations_client, options: options
1391
1408
  yield response, operation if block_given?
1392
- return response
1409
+ throw :response, response
1393
1410
  end
1394
1411
  rescue ::GRPC::BadStatus => e
1395
1412
  raise ::Google::Cloud::Error.from_error(e)
@@ -1506,7 +1523,7 @@ module Google
1506
1523
  @translation_service_stub.call_rpc :list_glossaries, request, options: options do |response, operation|
1507
1524
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossaries, request, response, operation, options
1508
1525
  yield response, operation if block_given?
1509
- return response
1526
+ throw :response, response
1510
1527
  end
1511
1528
  rescue ::GRPC::BadStatus => e
1512
1529
  raise ::Google::Cloud::Error.from_error(e)
@@ -1593,7 +1610,6 @@ module Google
1593
1610
 
1594
1611
  @translation_service_stub.call_rpc :get_glossary, request, options: options do |response, operation|
1595
1612
  yield response, operation if block_given?
1596
- return response
1597
1613
  end
1598
1614
  rescue ::GRPC::BadStatus => e
1599
1615
  raise ::Google::Cloud::Error.from_error(e)
@@ -1689,7 +1705,7 @@ module Google
1689
1705
  @translation_service_stub.call_rpc :delete_glossary, request, options: options do |response, operation|
1690
1706
  response = ::Gapic::Operation.new response, @operations_client, options: options
1691
1707
  yield response, operation if block_given?
1692
- return response
1708
+ throw :response, response
1693
1709
  end
1694
1710
  rescue ::GRPC::BadStatus => e
1695
1711
  raise ::Google::Cloud::Error.from_error(e)
@@ -1775,7 +1791,6 @@ module Google
1775
1791
 
1776
1792
  @translation_service_stub.call_rpc :get_glossary_entry, request, options: options do |response, operation|
1777
1793
  yield response, operation if block_given?
1778
- return response
1779
1794
  end
1780
1795
  rescue ::GRPC::BadStatus => e
1781
1796
  raise ::Google::Cloud::Error.from_error(e)
@@ -1875,7 +1890,7 @@ module Google
1875
1890
  @translation_service_stub.call_rpc :list_glossary_entries, request, options: options do |response, operation|
1876
1891
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, request, response, operation, options
1877
1892
  yield response, operation if block_given?
1878
- return response
1893
+ throw :response, response
1879
1894
  end
1880
1895
  rescue ::GRPC::BadStatus => e
1881
1896
  raise ::Google::Cloud::Error.from_error(e)
@@ -1963,7 +1978,6 @@ module Google
1963
1978
 
1964
1979
  @translation_service_stub.call_rpc :create_glossary_entry, request, options: options do |response, operation|
1965
1980
  yield response, operation if block_given?
1966
- return response
1967
1981
  end
1968
1982
  rescue ::GRPC::BadStatus => e
1969
1983
  raise ::Google::Cloud::Error.from_error(e)
@@ -2049,7 +2063,6 @@ module Google
2049
2063
 
2050
2064
  @translation_service_stub.call_rpc :update_glossary_entry, request, options: options do |response, operation|
2051
2065
  yield response, operation if block_given?
2052
- return response
2053
2066
  end
2054
2067
  rescue ::GRPC::BadStatus => e
2055
2068
  raise ::Google::Cloud::Error.from_error(e)
@@ -2135,7 +2148,6 @@ module Google
2135
2148
 
2136
2149
  @translation_service_stub.call_rpc :delete_glossary_entry, request, options: options do |response, operation|
2137
2150
  yield response, operation if block_given?
2138
- return response
2139
2151
  end
2140
2152
  rescue ::GRPC::BadStatus => e
2141
2153
  raise ::Google::Cloud::Error.from_error(e)
@@ -2231,7 +2243,7 @@ module Google
2231
2243
  @translation_service_stub.call_rpc :create_dataset, request, options: options do |response, operation|
2232
2244
  response = ::Gapic::Operation.new response, @operations_client, options: options
2233
2245
  yield response, operation if block_given?
2234
- return response
2246
+ throw :response, response
2235
2247
  end
2236
2248
  rescue ::GRPC::BadStatus => e
2237
2249
  raise ::Google::Cloud::Error.from_error(e)
@@ -2317,7 +2329,6 @@ module Google
2317
2329
 
2318
2330
  @translation_service_stub.call_rpc :get_dataset, request, options: options do |response, operation|
2319
2331
  yield response, operation if block_given?
2320
- return response
2321
2332
  end
2322
2333
  rescue ::GRPC::BadStatus => e
2323
2334
  raise ::Google::Cloud::Error.from_error(e)
@@ -2416,7 +2427,7 @@ module Google
2416
2427
  @translation_service_stub.call_rpc :list_datasets, request, options: options do |response, operation|
2417
2428
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_datasets, request, response, operation, options
2418
2429
  yield response, operation if block_given?
2419
- return response
2430
+ throw :response, response
2420
2431
  end
2421
2432
  rescue ::GRPC::BadStatus => e
2422
2433
  raise ::Google::Cloud::Error.from_error(e)
@@ -2510,7 +2521,7 @@ module Google
2510
2521
  @translation_service_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
2511
2522
  response = ::Gapic::Operation.new response, @operations_client, options: options
2512
2523
  yield response, operation if block_given?
2513
- return response
2524
+ throw :response, response
2514
2525
  end
2515
2526
  rescue ::GRPC::BadStatus => e
2516
2527
  raise ::Google::Cloud::Error.from_error(e)
@@ -2599,7 +2610,6 @@ module Google
2599
2610
 
2600
2611
  @translation_service_stub.call_rpc :create_adaptive_mt_dataset, request, options: options do |response, operation|
2601
2612
  yield response, operation if block_given?
2602
- return response
2603
2613
  end
2604
2614
  rescue ::GRPC::BadStatus => e
2605
2615
  raise ::Google::Cloud::Error.from_error(e)
@@ -2687,7 +2697,6 @@ module Google
2687
2697
 
2688
2698
  @translation_service_stub.call_rpc :delete_adaptive_mt_dataset, request, options: options do |response, operation|
2689
2699
  yield response, operation if block_given?
2690
- return response
2691
2700
  end
2692
2701
  rescue ::GRPC::BadStatus => e
2693
2702
  raise ::Google::Cloud::Error.from_error(e)
@@ -2774,7 +2783,6 @@ module Google
2774
2783
 
2775
2784
  @translation_service_stub.call_rpc :get_adaptive_mt_dataset, request, options: options do |response, operation|
2776
2785
  yield response, operation if block_given?
2777
- return response
2778
2786
  end
2779
2787
  rescue ::GRPC::BadStatus => e
2780
2788
  raise ::Google::Cloud::Error.from_error(e)
@@ -2878,7 +2886,7 @@ module Google
2878
2886
  @translation_service_stub.call_rpc :list_adaptive_mt_datasets, request, options: options do |response, operation|
2879
2887
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, request, response, operation, options
2880
2888
  yield response, operation if block_given?
2881
- return response
2889
+ throw :response, response
2882
2890
  end
2883
2891
  rescue ::GRPC::BadStatus => e
2884
2892
  raise ::Google::Cloud::Error.from_error(e)
@@ -2977,7 +2985,6 @@ module Google
2977
2985
 
2978
2986
  @translation_service_stub.call_rpc :adaptive_mt_translate, request, options: options do |response, operation|
2979
2987
  yield response, operation if block_given?
2980
- return response
2981
2988
  end
2982
2989
  rescue ::GRPC::BadStatus => e
2983
2990
  raise ::Google::Cloud::Error.from_error(e)
@@ -3064,7 +3071,6 @@ module Google
3064
3071
 
3065
3072
  @translation_service_stub.call_rpc :get_adaptive_mt_file, request, options: options do |response, operation|
3066
3073
  yield response, operation if block_given?
3067
- return response
3068
3074
  end
3069
3075
  rescue ::GRPC::BadStatus => e
3070
3076
  raise ::Google::Cloud::Error.from_error(e)
@@ -3151,7 +3157,6 @@ module Google
3151
3157
 
3152
3158
  @translation_service_stub.call_rpc :delete_adaptive_mt_file, request, options: options do |response, operation|
3153
3159
  yield response, operation if block_given?
3154
- return response
3155
3160
  end
3156
3161
  rescue ::GRPC::BadStatus => e
3157
3162
  raise ::Google::Cloud::Error.from_error(e)
@@ -3243,7 +3248,6 @@ module Google
3243
3248
 
3244
3249
  @translation_service_stub.call_rpc :import_adaptive_mt_file, request, options: options do |response, operation|
3245
3250
  yield response, operation if block_given?
3246
- return response
3247
3251
  end
3248
3252
  rescue ::GRPC::BadStatus => e
3249
3253
  raise ::Google::Cloud::Error.from_error(e)
@@ -3344,7 +3348,7 @@ module Google
3344
3348
  @translation_service_stub.call_rpc :list_adaptive_mt_files, request, options: options do |response, operation|
3345
3349
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, request, response, operation, options
3346
3350
  yield response, operation if block_given?
3347
- return response
3351
+ throw :response, response
3348
3352
  end
3349
3353
  rescue ::GRPC::BadStatus => e
3350
3354
  raise ::Google::Cloud::Error.from_error(e)
@@ -3446,7 +3450,7 @@ module Google
3446
3450
  @translation_service_stub.call_rpc :list_adaptive_mt_sentences, request, options: options do |response, operation|
3447
3451
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, request, response, operation, options
3448
3452
  yield response, operation if block_given?
3449
- return response
3453
+ throw :response, response
3450
3454
  end
3451
3455
  rescue ::GRPC::BadStatus => e
3452
3456
  raise ::Google::Cloud::Error.from_error(e)
@@ -3543,7 +3547,7 @@ module Google
3543
3547
  @translation_service_stub.call_rpc :import_data, request, options: options do |response, operation|
3544
3548
  response = ::Gapic::Operation.new response, @operations_client, options: options
3545
3549
  yield response, operation if block_given?
3546
- return response
3550
+ throw :response, response
3547
3551
  end
3548
3552
  rescue ::GRPC::BadStatus => e
3549
3553
  raise ::Google::Cloud::Error.from_error(e)
@@ -3640,7 +3644,7 @@ module Google
3640
3644
  @translation_service_stub.call_rpc :export_data, request, options: options do |response, operation|
3641
3645
  response = ::Gapic::Operation.new response, @operations_client, options: options
3642
3646
  yield response, operation if block_given?
3643
- return response
3647
+ throw :response, response
3644
3648
  end
3645
3649
  rescue ::GRPC::BadStatus => e
3646
3650
  raise ::Google::Cloud::Error.from_error(e)
@@ -3743,7 +3747,7 @@ module Google
3743
3747
  @translation_service_stub.call_rpc :list_examples, request, options: options do |response, operation|
3744
3748
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_examples, request, response, operation, options
3745
3749
  yield response, operation if block_given?
3746
- return response
3750
+ throw :response, response
3747
3751
  end
3748
3752
  rescue ::GRPC::BadStatus => e
3749
3753
  raise ::Google::Cloud::Error.from_error(e)
@@ -3840,7 +3844,7 @@ module Google
3840
3844
  @translation_service_stub.call_rpc :create_model, request, options: options do |response, operation|
3841
3845
  response = ::Gapic::Operation.new response, @operations_client, options: options
3842
3846
  yield response, operation if block_given?
3843
- return response
3847
+ throw :response, response
3844
3848
  end
3845
3849
  rescue ::GRPC::BadStatus => e
3846
3850
  raise ::Google::Cloud::Error.from_error(e)
@@ -3943,7 +3947,7 @@ module Google
3943
3947
  @translation_service_stub.call_rpc :list_models, request, options: options do |response, operation|
3944
3948
  response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_models, request, response, operation, options
3945
3949
  yield response, operation if block_given?
3946
- return response
3950
+ throw :response, response
3947
3951
  end
3948
3952
  rescue ::GRPC::BadStatus => e
3949
3953
  raise ::Google::Cloud::Error.from_error(e)
@@ -4029,7 +4033,6 @@ module Google
4029
4033
 
4030
4034
  @translation_service_stub.call_rpc :get_model, request, options: options do |response, operation|
4031
4035
  yield response, operation if block_given?
4032
- return response
4033
4036
  end
4034
4037
  rescue ::GRPC::BadStatus => e
4035
4038
  raise ::Google::Cloud::Error.from_error(e)
@@ -4123,7 +4126,7 @@ module Google
4123
4126
  @translation_service_stub.call_rpc :delete_model, request, options: options do |response, operation|
4124
4127
  response = ::Gapic::Operation.new response, @operations_client, options: options
4125
4128
  yield response, operation if block_given?
4126
- return response
4129
+ throw :response, response
4127
4130
  end
4128
4131
  rescue ::GRPC::BadStatus => e
4129
4132
  raise ::Google::Cloud::Error.from_error(e)
@@ -4212,6 +4215,11 @@ module Google
4212
4215
  # default endpoint URL. The default value of nil uses the environment
4213
4216
  # universe (usually the default "googleapis.com" universe).
4214
4217
  # @return [::String,nil]
4218
+ # @!attribute [rw] logger
4219
+ # A custom logger to use for request/response debug logging, or the value
4220
+ # `:default` (the default) to construct a default logger, or `nil` to
4221
+ # explicitly disable logging.
4222
+ # @return [::Logger,:default,nil]
4215
4223
  #
4216
4224
  class Configuration
4217
4225
  extend ::Gapic::Config
@@ -4236,6 +4244,7 @@ module Google
4236
4244
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4237
4245
  config_attr :quota_project, nil, ::String, nil
4238
4246
  config_attr :universe_domain, nil, ::String, nil
4247
+ config_attr :logger, :default, ::Logger, nil, :default
4239
4248
 
4240
4249
  # @private
4241
4250
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -607,7 +598,7 @@ module Google
607
598
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
608
599
  response = ::Gapic::Operation.new response, @operations_client, options: options
609
600
  yield response, operation if block_given?
610
- return response
601
+ throw :response, response
611
602
  end
612
603
  rescue ::GRPC::BadStatus => e
613
604
  raise ::Google::Cloud::Error.from_error(e)
@@ -696,6 +687,11 @@ module Google
696
687
  # default endpoint URL. The default value of nil uses the environment
697
688
  # universe (usually the default "googleapis.com" universe).
698
689
  # @return [::String,nil]
690
+ # @!attribute [rw] logger
691
+ # A custom logger to use for request/response debug logging, or the value
692
+ # `:default` (the default) to construct a default logger, or `nil` to
693
+ # explicitly disable logging.
694
+ # @return [::Logger,:default,nil]
699
695
  #
700
696
  class Configuration
701
697
  extend ::Gapic::Config
@@ -720,6 +716,7 @@ module Google
720
716
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
721
717
  config_attr :quota_project, nil, ::String, nil
722
718
  config_attr :universe_domain, nil, ::String, nil
719
+ config_attr :logger, :default, ::Logger, nil, :default
723
720
 
724
721
  # @private
725
722
  def initialize parent_config = nil